|
20 | 20 | Package Info |
21 | 21 | =============================================================================================================== --> |
22 | 22 | <PackageId>$(MSBuildProjectName).$(RuntimeIdentifier)</PackageId> |
23 | | - <PackageLicenseFile>LICENSE.txt</PackageLicenseFile> |
| 23 | + <PackageLicenseFile>LICENSE-COMBINED.md</PackageLicenseFile> |
24 | 24 | <Description>Native runtime support package for ClangSharp.Pathogen on $(RuntimeIdentifier). This package exists primarily to support Biohazrd and should only be used as instructed.</Description> |
25 | 25 | <!-- Microsoft is here because we embed components of libClangSharp --> |
26 | | - <Authors>LLVM Team, Microsoft, David Maas, and Contributors</Authors> |
| 26 | + <Authors>LLVM Team, .NET Foundation, David Maas, and Contributors</Authors> |
27 | 27 | <!-- LLVM does not have a good canonical copyright string. They're supposed to put it in their source file as part of Apache 2.0 but they don't. --> |
28 | | - <Copyright>Pathogen extensions copyright David Maas and Contributors. libClangSharp copyright © Microsoft and Contributors. LLVM copyright (c) 2003-2019 University of Illinois at Urbana-Champaign, LLVM Team.</Copyright> |
| 28 | + <Copyright>Pathogen extensions copyright David Maas and Contributors. libClangSharp copyright © .NET Foundation and Contributors. LLVM copyright (c) 2003-2019 University of Illinois at Urbana-Champaign, LLVM Team.</Copyright> |
29 | 29 |
|
30 | 30 | <!-- This package is only for native runtime, don't try to build/pack the .NET assembly or specify a framework dependency --> |
31 | 31 | <IncludeBuildOutput>false</IncludeBuildOutput> |
32 | 32 | <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> |
33 | 33 | </PropertyGroup> |
34 | 34 | <ItemGroup> |
35 | 35 | <None Condition="Exists('$(PathogenExtensionsCppPath)')" Include="$(PathogenExtensionsCppPath)" Link="PathogenExtensions.cpp" /> |
36 | | - <None Condition="Exists('$(ClangLicensePath)')" Include="$(ClangLicensePath)" Link="LICENSE.txt" Pack="true" PackagePath="LICENSE.txt" /> |
| 36 | + <None Condition="Exists('$(ClangLicensePath)')" Include="$(ClangLicensePath)" Link="LICENSE-LLVM.txt" Pack="true" PackagePath="LICENSE-LLVM.txt" /> |
| 37 | + <None Condition="Exists('$(LibClangSharpLicensePath)')" Include="$(LibClangSharpLicensePath)" Link="LICENSE-LIBCLANGSHARP.md" Pack="true" PackagePath="LICENSE-LIBCLANGSHARP.md" /> |
37 | 38 | <None Include="$(LibClangPath)" Link="$(LibClangPathogenFileName)" Condition="Exists('$(LibClangPath)')"> |
38 | 39 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
39 | 40 | <Pack>true</Pack> |
|
45 | 46 | <!-- PathogenExtensions.cpp is only used to check if LLVM is cloned and it's our fork. Don't check for it on CI where we might not actually clone LLVM. --> |
46 | 47 | <Error Text="PathogenExtensions.cpp is missing, ensure Git submodules are up-to-date." Condition="!Exists('$(PathogenExtensionsCppPath)') and '$(ContinuousIntegrationBuild)' != 'true'" /> |
47 | 48 | <Error Text="Clang LICENSE.TXT is missing, ensure Git submodules are up-to-date." Condition="!Exists('$(ClangLicensePath)')" /> |
| 49 | + <Error Text="libClangSharp LICENSE.md is missing, ensure Git submodules are up-to-date." Condition="!Exists('$(LibClangSharpLicensePath)')" /> |
48 | 50 | <Error Text="Could not automatically determine LibClangSubPath based on runtime identifier '$(RuntimeIdentifier)'" Condition="'$(LibClangSubPath)' == ''" /> |
49 | 51 | <Error Text="Could not automatically determine LibClangPathogenFileName based on runtime identifier '$(RuntimeIdentifier)'" Condition="'$(LibClangPathogenFileName)' == ''" /> |
50 | 52 | <Error Text="Could not locate native runtime for '$(RuntimeIdentifier)' at '$(LibClangPath)', did you run build-native.cmd/sh?" Condition="!Exists('$(LibClangPath)')" /> |
51 | 53 | </Target> |
| 54 | + <UsingTask TaskName="_GenerateCombinedLicenseFileTask" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll"> |
| 55 | + <ParameterGroup> |
| 56 | + <PackageId ParameterType="System.String" Required="true" /> |
| 57 | + <Path ParameterType="System.String" Required="true" /> |
| 58 | + <ClangLicensePath ParameterType="System.String" Required="true" /> |
| 59 | + <LibClangSharpLicensePath ParameterType="System.String" Required="true" /> |
| 60 | + </ParameterGroup> |
| 61 | + <Task> |
| 62 | + <Using Namespace="System.IO" /> |
| 63 | + <Using Namespace="System.Linq" /> |
| 64 | + <Code Type="Fragment" Language="cs"> |
| 65 | + <![CDATA[ |
| 66 | + string[] clangLicense = File.ReadAllLines(ClangLicensePath); |
| 67 | + string[] libClangSharpLicense = File.ReadAllLines(LibClangSharpLicensePath); |
| 68 | + |
| 69 | + using StreamWriter f = new(Path); |
| 70 | + f.WriteLine($"{PackageId} incorporates multiple components licensed as follows."); |
| 71 | + f.WriteLine(); |
| 72 | + f.WriteLine("# The LLVM Project"); |
| 73 | + f.WriteLine(); |
| 74 | + f.WriteLine("```"); |
| 75 | + foreach (string line in clangLicense) |
| 76 | + { f.WriteLine(line); } |
| 77 | + f.WriteLine("```"); |
| 78 | + f.WriteLine(); |
| 79 | + f.WriteLine("# libClangSharp"); |
| 80 | + f.WriteLine(); |
| 81 | + foreach (string line in libClangSharpLicense) |
| 82 | + { f.WriteLine($"> {line}"); } |
| 83 | + ]]> |
| 84 | + </Code> |
| 85 | + </Task> |
| 86 | + </UsingTask> |
| 87 | + <Target Name="_GenerateCombinedLicenseFile" DependsOnTargets="_NativeRuntimeChecks" BeforeTargets="GetCopyToOutputDirectoryItems;Build;GenerateNuspec;Pack;_GetPackageFiles"> |
| 88 | + <PropertyGroup> |
| 89 | + <_CombinedLicenseFile>$(IntermediateOutputPath)LICENSE-COMBINED.md</_CombinedLicenseFile> |
| 90 | + </PropertyGroup> |
| 91 | + <_GenerateCombinedLicenseFileTask PackageId="$(PackageId)" Path="$(_CombinedLicenseFile)" ClangLicensePath="$(ClangLicensePath)" LibClangSharpLicensePath="$(LibClangSharpLicensePath)" /> |
| 92 | + <ItemGroup> |
| 93 | + <None Include="$(_CombinedLicenseFile)" Visible="false" Pack="true" PackagePath="LICENSE-COMBINED.md" /> |
| 94 | + </ItemGroup> |
| 95 | + </Target> |
52 | 96 | </Project> |
0 commit comments