Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions SharedInfrastructure.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29709.97
# Visual Studio Version 17
VisualStudioVersion = 17.14.36310.24
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharedInfrastructure.Tests", "tests\SharedInfrastructure.Tests\SharedInfrastructure.Tests.csproj", "{1664B46A-D99F-4C66-9424-A3A17C926A4C}"
EndProject
Expand Down Expand Up @@ -66,10 +66,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "targets", "targets", "{A411
EndProjectSection
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\SharedInfrastructure\SharedInfrastructure.projitems*{1664b46a-d99f-4c66-9424-a3a17c926a4c}*SharedItemsImports = 5
src\SharedInfrastructure\SharedInfrastructure.projitems*{68a8cc40-6aed-4e96-b524-31b1158fdeea}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Expand All @@ -95,4 +91,8 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CDD6BE8E-01A1-4A70-AA7E-F1D64E8FA829}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\SharedInfrastructure\SharedInfrastructure.projitems*{1664b46a-d99f-4c66-9424-a3a17c926a4c}*SharedItemsImports = 5
src\SharedInfrastructure\SharedInfrastructure.projitems*{68a8cc40-6aed-4e96-b524-31b1158fdeea}*SharedItemsImports = 13
EndGlobalSection
EndGlobal
15 changes: 13 additions & 2 deletions msbuild/props/SixLabors.Src.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

<!--
Define Environmental conditionals. Determined by environmental settings set in build-and-test.yml
These properties are defined 2X to ensure both MSBuild and Visual Studio (preprocessor directives)
can correctly detect them.
-->
<PropertyGroup>
<IsContinuousIntegration Condition="'$(CI)' == 'true'">true</IsContinuousIntegration>
Expand All @@ -47,6 +45,19 @@
<MinVerVerbosity>normal</MinVerVerbosity>
</PropertyGroup>

<!--
Package reference to the license project which is consumed by src projects
This is a dev only reference. See the SixLabors.Src.targets file for usage.
-->
<ItemGroup>
<PackageReference
Include="SixLabors.Licensing"
Version="1.0.0"
PrivateAssets="all"
GeneratePathProperty="true"
Condition="'$(PackageId)' != 'SixLabors.Licensing' and '$(MSBuildProjectName)' != 'SixLabors.Licensing'" />
</ItemGroup>

<!-- Package references and additional files which are consumed by src projects. CI Only -->
<ItemGroup Condition="'$(IsContinuousIntegration)'=='true'">
<PackageReference Include="Microsoft.SourceLink.GitHub"
Expand Down
52 changes: 52 additions & 0 deletions msbuild/targets/SixLabors.Src.targets
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,56 @@
DestinationFolder="$(SixLaborsSolutionDirectory)" />
</Target>

<!--
This target is responsible for copying licensing files to the licensing NuGet package
to our build output.
See SixLabors.Src.props for the package references.
Hook into NuGet pack.
-->
<PropertyGroup>
<TargetsForTfmSpecificContentInPackage>
$(TargetsForTfmSpecificContentInPackage);_SixLabors_AddLicensingFiles
</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>

<!-- Add files per TFM from the *package cache* only -->
<Target Name="_SixLabors_AddLicensingFiles"
Condition="'$(IsPackable)'=='true'
and '$(TargetFramework)'!=''
and $([System.String]::Copy('$(PackageId)').StartsWith('SixLabors.'))
and '$(PackageId)'!='SixLabors.Licensing'
and '$(PkgSixLabors_Licensing)'!=''">

<ItemGroup>
<!-- Rename the validator template into the consuming package -->
<TfmSpecificPackageFile Include="$(PkgSixLabors_Licensing)\build\SixLabors.ValidateLicense.targets"
Condition="Exists('$(PkgSixLabors_Licensing)\build\SixLabors.ValidateLicense.targets')">
<PackagePath>build\$(PackageId).targets</PackagePath>
</TfmSpecificPackageFile>

<!-- dotnet MSBuild task -->
<TfmSpecificPackageFile Include="$(PkgSixLabors_Licensing)\build\net8.0\SixLabors.Licensing.dll"
Condition="Exists('$(PkgSixLabors_Licensing)\build\net8.0\SixLabors.Licensing.dll')">
<PackagePath>build\net8.0\SixLabors.Licensing.dll</PackagePath>
</TfmSpecificPackageFile>

<!-- VS/CLR4 MSBuild task -->
<TfmSpecificPackageFile Include="$(PkgSixLabors_Licensing)\build\net472\SixLabors.Licensing.dll"
Condition="Exists('$(PkgSixLabors_Licensing)\build\net472\SixLabors.Licensing.dll')">
<PackagePath>build\net472\SixLabors.Licensing.dll</PackagePath>
</TfmSpecificPackageFile>
</ItemGroup>
</Target>

<!-- Hard fail if the package path isn't resolvable -->
<Target Name="FailIfLicensingPathMissing" BeforeTargets="Pack"
Condition="'$(IsPackable)'=='true'
and '$(TargetFramework)'!=''
and $([System.String]::Copy('$(PackageId)').StartsWith('SixLabors.'))
and '$(PackageId)'!='SixLabors.Licensing'
and ( '$(PkgSixLabors_Licensing)'==''
or !Exists('$(PkgSixLabors_Licensing)\build\net8.0\SixLabors.Licensing.dll') )">
<Error Text="Licensing task not found under $(PkgSixLabors_Licensing)\build\net8.0. Ensure the dev-only PackageReference (GeneratePathProperty='true') is present and restore ran." />
</Target>

</Project>
Loading