You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
8.8 KiB

<Project>
<!-- Please replace the target name with "ApplyLicenseFor[YourProductGUID]",
otherwise the target may be overridden because of the same name -->
<!-- Since the Studio product will be the same for multiple installs that may differ otherwise,
add unique info to the target name, e.g. WF, WPF, SL, ETC -->
<Target Name="ApplyLicense-Rev1-da3d5d14-691f-4908-aa3c-fd3239734232" AfterTargets="CompileLicxFiles"
Inputs="" Outputs="$(IntermediateOutputPath).gclicx" Condition="$(DisableGclm) != true">
<PropertyGroup>
<!-- Your Product GUID. In most cases, the GCPID specifies the GUID of the most inclusive
product and the product for which there is a trial license
-->
<GCPID>331cf6cd-b73c-429f-ba79-fa2f85eebd68</GCPID>
<!-- Your Product Info, the LocalNames element is optional. The content of GCPInfo specifies the
content of the .info file in the license folder. The Name is shown in the GCLM.exe dialog.
-->
<GCPInfo>
<Product Name="ComponentOne Studio Enterprise">
<!-- The local names are optional -->
<!--<LocalNames>
<LocalName Culture="ja" Name="Sample .NET Core Component v1.0 (JA)" />
<LocalName Culture="zh" Name="Sample .NET Core Component v1.0 (ZH)" />
</LocalNames>-->
</Product>
</GCPInfo>
<!-- The min version of GCLM tool that your Product needs -->
<GclmMinVersion>2.0</GclmMinVersion>
<!-- The Built-in Trial License Data (Remember to replace ";" with %3B ) -->
<!-- The GCPTrialLic element can contain a built in trial license which must be specified
as a Base64 string. ToDo: check this statement for accuracy -->
<GCPTrialLic>MzMxY2Y2Y2QtYjczYy00MjlmLWJhNzktZmEyZjg1ZWViZDY4,NDYwNTkwMDZYWFhYWFhYWDA5Nw,Kg,VHJ1ZQ,NzQ0MA,VHJ1ZQ,LTMw,LTMw,VHJpYWw,,%3BFOh5mQqnDeQRF5vyT/FbVqgtHaqARg2xoIG6CtHFzVC6tc/7/ApSMCWZKiCd8vJMYBTTZ+Xbr/KzcD55MFob2rfjKSR0UWap2oexQP9njn6xf1zg5ytl1CJm/8Wxd2d0p5KxUgJbAVQcSx9F3qk1Ao9NI+3KVneEVkhn1SEdCUk</GCPTrialLic>
<!-- License folder path -->
<!-- Linux (per user) -->
<GrapeCityRootFolder Condition="$([MSBuild]::IsOSUnixLike())">$([System.Environment]::GetFolderPath(System.Environment+SpecialFolder.LocalApplicationData))</GrapeCityRootFolder>
<GclmExe Condition="$([MSBuild]::IsOSUnixLike())">gclm</GclmExe>
<!-- Windows (per machine) -->
<GrapeCityRootFolder Condition="!$([MSBuild]::IsOSUnixLike())">$([System.Environment]::GetFolderPath(System.Environment+SpecialFolder.CommonApplicationData))</GrapeCityRootFolder>
<GclmPath Condition="!$([MSBuild]::IsOSUnixLike())">$([MSBuild]::NormalizePath($(GrapeCityRootFolder),'GrapeCity','gclm'))</GclmPath>
<GclmExe Condition="!$([MSBuild]::IsOSUnixLike())">$([MSBuild]::NormalizePath($(GclmPath),'gclm.exe'))</GclmExe>
<C1Release>$([System.Text.RegularExpressions.Regex]::Match($(MSBuildThisFileFullPath),"\d+\.\d+\.(\d+)?\.\d+\\buildTransitive").Groups[1].Value)</C1Release>
<TempFolder>$([System.IO.Path]::GetTempPath())</TempFolder>
<DeployPath>$([MSBuild]::NormalizePath($(TempFolder),'gclm_deploy.exe'))</DeployPath>
<!-- Common -->
<!-- GCPInfoPath property element specifies the path the GCPID .info file. -->
<GCPInfoPath>$([MSBuild]::NormalizePath($(GrapeCityRootFolder),'GrapeCity',$(GCPID),'.info'))</GCPInfoPath>
</PropertyGroup>
<!-- Register the Product Info in GrapeCity licensing folder -->
<!-- Include each guid and name as appropriate for the nuget install.
Note that these guids and names correspond to the C1Product classes in GCLicensing code.
The guids of these entries are used to both create .info files in the licensing folder
so that the entries appear in the GLCM dialog and also to build the MyBuildID property
which is specifies which products can be used for licensing the installed assemblies.
C1Product entries without a name are not initialized for GCLM, but are checked for a license.
Each is checked and the first valid license will be used to generate .gclicx. -->
<!-- The product that has the trial license should always be last -->
<ItemGroup>
<C1Product Remove="@(C1Product)" />
<C1Product Include="da3d5d14-691f-4908-aa3c-fd3239734232">
<Name>ComponentOne WinForms Edition</Name>
</C1Product>
<C1Product Include="44f06ce6-f604-4c52-9e69-a00cf1af27fb">
<Name>ComponentOne WinForms Data Services Edition</Name>
</C1Product>
<C1Product Include="1E2DD705-CD7C-42CE-8098-C4717DF794B1">
<Name />
</C1Product>
<!-- WF JP -->
<C1Product Include="154B86E3-6B5B-4B2E-ACDC-91D24D249879">
<Name />
</C1Product>
<!-- Enterprise JP -->
<C1Product Include="331cf6cd-b73c-429f-ba79-fa2f85eebd68">
<Name>ComponentOne Studio Enterprise</Name>
</C1Product>
</ItemGroup>
<!-- create .info files for each product to allow any of them to be activated -->
<MakeDir Directories="$([MSBuild]::NormalizePath($(GrapeCityRootFolder),'GrapeCity',%(Identity)))" Condition="'%(C1Product.Name)' != ''" />
<WriteLinesToFile File="$([MSBuild]::NormalizePath($(GrapeCityRootFolder),'GrapeCity',%(Identity),'.info'))"
Condition="!Exists($([MSBuild]::NormalizePath($(GrapeCityRootFolder),'GrapeCity',%(Identity),'.info'))) And '%(C1Product.Name)' != ''"
Lines='&lt;?xml version="1.0" encoding="utf-8"?&gt;&#13;&#10;&lt;Product Name="%(C1Product.Name)"/&gt;'
Encoding="utf-8" Overwrite ="false" />
<!-- create the MyBuildID property from the elements of the ItemGroup above -->
<CreateProperty Value="@(C1Product,',')">
<Output PropertyName="MyBuildID" TaskParameter="Value"/>
</CreateProperty>
<Message Text="Created MyBuildID: $(MyBuildID)" />
<!--Check License Tool installation-->
<Exec Command="$(GclmExe) --version" ConsoleToMsBuild="true" ContinueOnError="true" IgnoreExitCode="true">
<Output PropertyName="GclmVersionResult" TaskParameter="ConsoleOutput"/>
</Exec>
<CreateProperty Value="true" Condition="$(GclmVersionResult.StartsWith('GrapeCity License Manager'))">
<Output PropertyName="GclmInstalled" TaskParameter="Value"/>
</CreateProperty>
<CreateProperty Value="$(GclmVersionResult.Split(',')[1])" Condition="$(GclmInstalled) == true">
<Output PropertyName="GclmVersion" TaskParameter="Value"/>
</CreateProperty>
<!-- For Linux -->
<!-- If not installed, install the License Tool -->
<Exec Command="dotnet tool install -g GrapeCity.LicenseManagerTool" ContinueOnError="true"
IgnoreExitCode="true" Condition="$([MSBuild]::IsOSUnixLike()) AND $(GclmInstalled) != true"/>
<!-- If not latest, update the License Tool -->
<Exec Command="dotnet tool update -g GrapeCity.LicenseManagerTool" ContinueOnError="true"
IgnoreExitCode="true" Condition="$([MSBuild]::IsOSUnixLike()) AND $(GclmInstalled) == true AND $(GclmVersion) &lt; $(GclmMinVersion)"/>
<!-- End Linux -->
<!-- For Windows -->
<!-- Verify need download gclm tool or not -->
<CreateProperty Value="Yes" Condition="!$([MSBuild]::IsOSUnixLike()) AND ($(GclmInstalled) != true OR ($(GclmInstalled) == true AND $(GclmVersion) &lt; $(GclmMinVersion)))">
<Output PropertyName="NeedDownloadGclm" TaskParameter="Value"/>
</CreateProperty>
<!-- Download gclm deploy tool -->
<DownloadFile SourceUrl="https://cdn.grapecity.com/license/gclm_deploy.exe" DestinationFolder="$(TempFolder)" Condition="$(NeedDownloadGclm) == 'Yes'" SkipUnchangedFiles="false"/>
<!-- Run gclm deploy tool -->
<Exec Command="$(DeployPath)" IgnoreExitCode="true" Condition="$(NeedDownloadGclm) == 'Yes'"/>
<!-- End Windows -->
<Message Text="Release for $(MSBuildThisFileName): $(C1Release)" />
<!-- Initialize the Trial Product License if a license is not already present -->
<Exec Command="$(GCLMExe) $(GCPID) -init &quot;$(GCPTrialLic)&quot;" IgnoreExitCode="true" />
<!-- Compile the Product License into .gclicx file and link it with the output assembly -->
<FindInList List="@(CompiledLicenseFile)" ItemSpecToFind="$(IntermediateOutputPath).gclicx">
<Output TaskParameter="ItemFound" ItemName="GclicxItems"/>
</FindInList>
<!-- Execute GCLM.EXE to generate the .gclicx file to be added to the resources -->
<!-- Note that MyBuildID property is specified. If BuildId if not disable can be used instead. -->
<Exec Command='$(GCLMExe) $(MyBuildID) -lc $(IntermediateOutputPath).gclicx "$(TargetFileName)"'
Outputs="$(IntermediateOutputPath).gclicx"
IgnoreExitCode="true">
<Output Condition="@(GclicxItems->Count()) == 0" TaskParameter="Outputs" ItemName="CompiledLicenseFile" />
</Exec>
</Target>
</Project>