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.
 
 
 
 
 
 

81 lines
4.8 KiB

  1. <Project>
  2. <Target Name="ApplyLicenseForActiveReports" AfterTargets="CompileLicxFiles" Inputs="" Outputs="$(IntermediateOutputPath).gclicx"
  3. Condition="$(DisableGclm) != true">
  4. <PropertyGroup>
  5. <GCPID>de456e2c-d2e3-4246-94e8-9648bbd6fbf0</GCPID>
  6. <GCPInfo>
  7. <Product Name="ActiveReports 14"/>
  8. </GCPInfo>
  9. <!-- The min version of GCLM tool that your Product need -->
  10. <GclmMinVersion>1.0</GclmMinVersion>
  11. <!-- The Built-in Trial License Data (Remeber to replace ";" with %3B ) -->
  12. <GCPTrialLic>ZGU0NTZlMmMtZDJlMy00MjQ2LTk0ZTgtOTY0OGJiZDZmYmYw,MDIwMjM4MzZYWFhYWFhYWDA1MQ,Kg,VHJ1ZQ,NzI1NQ,VHJ1ZQ,LTMw,LTMw,UHJvZmVzc2lvbmFs,ZGVzaWduZXIsd2ViLXZpZXdlcix3ZWItZGVzaWduZXIsZXhwb3J0LXBybyxjb250cm9sLXBybw,;KWous0ATlrZW4qG0QfOkJDuHkIRm6TKPRL6wxPU0HCX0tC5ZN1paXqhQ3gnquhUnJy3QTiJdat2b3nZ48RicFOTvgR5imucWeecCzK7OLYSNkKoK3TPu1nL85yUTFcrLwXNpyxjSwOiNgmdGV59zKJi1L2YYWv62iwSc0WPR9cY</GCPTrialLic>
  13. <!-- License folder path -->
  14. <!-- Linux (per user) -->
  15. <GrapeCityRootFolder Condition="$([MSBuild]::IsOSUnixLike())">$([System.Environment]::GetFolderPath(System.Environment+SpecialFolder.LocalApplicationData))</GrapeCityRootFolder>
  16. <GclmExe Condition="$([MSBuild]::IsOSUnixLike())">gclm</GclmExe>
  17. <!-- Windows (per machine) -->
  18. <GrapeCityRootFolder Condition="!$([MSBuild]::IsOSUnixLike())">$([System.Environment]::GetFolderPath(System.Environment+SpecialFolder.CommonApplicationData))</GrapeCityRootFolder>
  19. <GclmPath Condition="!$([MSBuild]::IsOSUnixLike())">$([MSBuild]::NormalizePath($(GrapeCityRootFolder),'GrapeCity','gclm'))</GclmPath>
  20. <GclmExe Condition="!$([MSBuild]::IsOSUnixLike())">$([MSBuild]::NormalizePath($(GclmPath),'gclm.exe'))</GclmExe>
  21. <TempFolder>$([System.IO.Path]::GetTempPath())</TempFolder>
  22. <DeployPath>$([MSBuild]::NormalizePath($(TempFolder),'gclm_deploy.exe'))</DeployPath>
  23. <!-- Common -->
  24. <GCPInfoPath>$([MSBuild]::NormalizePath($(GrapeCityRootFolder),'GrapeCity',$(GCPID),'.info'))</GCPInfoPath>
  25. </PropertyGroup>
  26. <!-- Register the Product Info in system folder -->
  27. <WriteLinesToFile Condition="!Exists($(GCPInfoPath))" File="$(GCPInfoPath)" Lines="$(GCPInfo)" Encoding="utf-8" Overwrite="true"/>
  28. <!--Check License Tool installation-->
  29. <Exec Command="$(GclmExe) --version" ConsoleToMsBuild="true" ContinueOnError="true" IgnoreExitCode="true">
  30. <Output PropertyName="GclmVersionResult" TaskParameter="ConsoleOutput"/>
  31. </Exec>
  32. <CreateProperty Value="true" Condition="$(GclmVersionResult.StartsWith('GrapeCity License Manager'))">
  33. <Output PropertyName="GclmInstalled" TaskParameter="Value"/>
  34. </CreateProperty>
  35. <CreateProperty Value="$(GclmVersionResult.Split(',')[1])" Condition="$(GclmInstalled) == true">
  36. <Output PropertyName="GclmVersion" TaskParameter="Value"/>
  37. </CreateProperty>
  38. <!-- For Linux -->
  39. <!-- If not installed, install the License Tool -->
  40. <Exec Command="dotnet tool install -g GrapeCity.LicenseManagerTool" ContinueOnError="true" IgnoreExitCode="true" Condition="$([MSBuild]::IsOSUnixLike()) AND $(GclmInstalled) != true"/>
  41. <!-- If not latest, update the License Tool -->
  42. <Exec Command="dotnet tool update -g GrapeCity.LicenseManagerTool" ContinueOnError="true" IgnoreExitCode="true" Condition="$([MSBuild]::IsOSUnixLike()) AND $(GclmInstalled) == true AND $(GclmVersion) &lt; $(GclmMinVersion)"/>
  43. <!-- End Linux -->
  44. <!-- For Windows -->
  45. <!-- Verify need download gclm tool or not -->
  46. <CreateProperty Value="Yes" Condition="!$([MSBuild]::IsOSUnixLike()) AND ($(GclmInstalled) != true OR ($(GclmInstalled) == true AND $(GclmVersion) &lt; $(GclmMinVersion)))">
  47. <Output PropertyName="NeedDownloadGclm" TaskParameter="Value"/>
  48. </CreateProperty>
  49. <!-- Download gclm deploy tool -->
  50. <DownloadFile SourceUrl="https://cdn.grapecity.com/license/gclm_deploy.exe" DestinationFolder="$(TempFolder)" Condition="$(NeedDownloadGclm) == 'Yes'" SkipUnchangedFiles="false"/>
  51. <!-- Run gclm deploy tool -->
  52. <Exec Command="$(DeployPath)" IgnoreExitCode="true" Condition="$(NeedDownloadGclm) == 'Yes'"/>
  53. <!-- End Windows -->
  54. <!-- Initialize the Product License -->
  55. <Exec Command="$(GCLMExe) $(GCPID) -init &quot;$(GCPTrialLic)&quot;"
  56. IgnoreExitCode="true">
  57. </Exec>
  58. <!-- Compile the Product License into .gclicx file and link it with the output assembly -->
  59. <FindInList List="@(CompiledLicenseFile)" ItemSpecToFind="$(IntermediateOutputPath).gclicx">
  60. <Output TaskParameter="ItemFound" ItemName="GclicxItems"/>
  61. </FindInList>
  62. <Exec Command="$(GCLMExe) $(GCPID) -lc $(IntermediateOutputPath).gclicx $(TargetFileName)"
  63. Outputs="$(IntermediateOutputPath).gclicx"
  64. IgnoreExitCode="true">
  65. <Output Condition="@(GclicxItems->Count()) == 0" TaskParameter="Outputs" ItemName="CompiledLicenseFile" />
  66. </Exec>
  67. </Target>
  68. </Project>