|
9 | 9 | <LibClangPathogenPathWindows>$(MSBuildThisFileDirectory)../build/bin/libclang.dll</LibClangPathogenPathWindows> |
10 | 10 | <LibClangPathogenPathLinux>$(MSBuildThisFileDirectory)../build-linux/lib/libclang.so</LibClangPathogenPathLinux> |
11 | 11 | <PathogenExtensionsCppPath>$(MSBuildThisFileDirectory)../external/llvm-project/clang/tools/libclang/PathogenExtensions.cpp</PathogenExtensionsCppPath> |
| 12 | + <ClangResourceDirectoryPath>$(MSBuildThisFileDirectory)../build-linux/lib/clang/10.0.0/</ClangResourceDirectoryPath> |
12 | 13 | <LicenseFilePath>$(MSBuildThisFileDirectory)../external/llvm-project/clang/LICENSE.TXT</LicenseFilePath> |
13 | 14 |
|
14 | 15 | <!-- Package Info --> |
|
45 | 46 | <Pack>true</Pack> |
46 | 47 | <PackagePath>runtimes/linux-x64/native/libclang-pathogen.so</PackagePath> |
47 | 48 | </None> |
| 49 | + <None Include="$(ClangResourceDirectoryPath)**/*" LinkBase="clang-resources" Condition="Exists('$(ClangResourceDirectoryPath)')"> |
| 50 | + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| 51 | + <Pack>true</Pack> |
| 52 | + <!-- |
| 53 | + We use MSBuild to copy the Clang resource directory to the build output of dependents using MSBuild instead of ContentFiles primarily to avoid having them pollute Solution Explorer: |
| 54 | + https://github.com/NuGet/Home/issues/4856 |
| 55 | + --> |
| 56 | + <PackagePath>clang-resources/</PackagePath> |
| 57 | + </None> |
| 58 | + <None Update="ClangSharp.Pathogen.Runtime.props"> |
| 59 | + <Pack>true</Pack> |
| 60 | + <!-- |
| 61 | + buildTransitive is required to ensure the resource directory is also copied to indirect dependents |
| 62 | + We put the props file in both build and buildTransitive for legacy compatibility even though we don't really expect legacy consumers. (IE: Visual Studio 2017) |
| 63 | + NuGet will only use the one from buildTransitive when it's buildTransitive-aware. |
| 64 | + https://github.com/NuGet/Home/wiki/Allow-package%2D-authors-to-define-build-assets-transitive-behavior |
| 65 | + --> |
| 66 | + <PackagePath>build;buildTransitive</PackagePath> |
| 67 | + </None> |
48 | 68 | </ItemGroup> |
49 | 69 | <!-- Error if native runtime needs to be built or llvm-project is missing --> |
50 | 70 | <Target Name="_NativeRuntimeChecks" BeforeTargets="Build;Pack"> |
51 | 71 | <Error Text="PathogenExtensions.cpp is missing, ensure Git submodules are up-to-date." Condition="!Exists('$(PathogenExtensionsCppPath)')" /> |
52 | 72 | <Error Text="Clang LICENSE.TXT is missing, ensure Git submodules are up-to-date." Condition="!Exists('$(LicenseFilePath)')" /> |
| 73 | + <!-- Check for resource directory on CI builds --> |
| 74 | + <Error Text="Clang resource directory is missing." Condition="'$(ContinuousIntegrationBuild)' == 'true' and !Exists('$(ClangResourceDirectoryPath)')" /> |
53 | 75 |
|
54 | 76 | <PropertyGroup> |
55 | 77 | <_AllRuntimesPresent>true</_AllRuntimesPresent> |
|
0 commit comments