|
17 | 17 | DestinationFolder="$(SixLaborsSolutionDirectory)" /> |
18 | 18 | </Target> |
19 | 19 |
|
| 20 | + <!-- |
| 21 | + This target is responsible for copying licensing files to the licensing NuGet package |
| 22 | + to our build output. |
| 23 | + See SixLabors.Src.props for the package references. |
| 24 | + Hook into NuGet pack. |
| 25 | + --> |
| 26 | + <PropertyGroup> |
| 27 | + <TargetsForTfmSpecificContentInPackage> |
| 28 | + $(TargetsForTfmSpecificContentInPackage);_SixLabors_AddLicensingFiles |
| 29 | + </TargetsForTfmSpecificContentInPackage> |
| 30 | + </PropertyGroup> |
| 31 | + |
| 32 | + <!-- Add files per TFM from the *package cache* only --> |
| 33 | + <Target Name="_SixLabors_AddLicensingFiles" |
| 34 | + Condition="'$(IsPackable)'=='true' |
| 35 | + and '$(TargetFramework)'!='' |
| 36 | + and $([System.String]::Copy('$(PackageId)').StartsWith('SixLabors.')) |
| 37 | + and '$(PackageId)'!='SixLabors.Licensing' |
| 38 | + and '$(PkgSixLabors_Licensing)'!=''"> |
| 39 | + |
| 40 | + <ItemGroup> |
| 41 | + <!-- Rename the validator template into the consuming package --> |
| 42 | + <TfmSpecificPackageFile Include="$(PkgSixLabors_Licensing)\build\SixLabors.ValidateLicense.targets" |
| 43 | + Condition="Exists('$(PkgSixLabors_Licensing)\build\SixLabors.ValidateLicense.targets')"> |
| 44 | + <PackagePath>build\$(PackageId).targets</PackagePath> |
| 45 | + </TfmSpecificPackageFile> |
| 46 | + |
| 47 | + <!-- dotnet MSBuild task --> |
| 48 | + <TfmSpecificPackageFile Include="$(PkgSixLabors_Licensing)\build\net8.0\SixLabors.Licensing.dll" |
| 49 | + Condition="Exists('$(PkgSixLabors_Licensing)\build\net8.0\SixLabors.Licensing.dll')"> |
| 50 | + <PackagePath>build\net8.0\SixLabors.Licensing.dll</PackagePath> |
| 51 | + </TfmSpecificPackageFile> |
| 52 | + |
| 53 | + <!-- VS/CLR4 MSBuild task --> |
| 54 | + <TfmSpecificPackageFile Include="$(PkgSixLabors_Licensing)\build\net472\SixLabors.Licensing.dll" |
| 55 | + Condition="Exists('$(PkgSixLabors_Licensing)\build\net472\SixLabors.Licensing.dll')"> |
| 56 | + <PackagePath>build\net472\SixLabors.Licensing.dll</PackagePath> |
| 57 | + </TfmSpecificPackageFile> |
| 58 | + </ItemGroup> |
| 59 | + </Target> |
| 60 | + |
| 61 | + <!-- Hard fail if the package path isn't resolvable --> |
| 62 | + <Target Name="FailIfLicensingPathMissing" BeforeTargets="Pack" |
| 63 | + Condition="'$(IsPackable)'=='true' |
| 64 | + and '$(TargetFramework)'!='' |
| 65 | + and $([System.String]::Copy('$(PackageId)').StartsWith('SixLabors.')) |
| 66 | + and '$(PackageId)'!='SixLabors.Licensing' |
| 67 | + and ( '$(PkgSixLabors_Licensing)'=='' |
| 68 | + or !Exists('$(PkgSixLabors_Licensing)\build\net8.0\SixLabors.Licensing.dll') )"> |
| 69 | + <Error Text="Licensing task not found under $(PkgSixLabors_Licensing)\build\net8.0. Ensure the dev-only PackageReference (GeneratePathProperty='true') is present and restore ran." /> |
| 70 | + </Target> |
| 71 | + |
20 | 72 | </Project> |
0 commit comments