|
1 | 1 | <Project> |
2 | 2 |
|
| 3 | + <Target Name="_CreateMonoInfoProps" |
| 4 | + Condition=" $([MSBuild]::IsOSPlatform ('linux')) Or $([MSBuild]::IsOSPlatform ('osx')) " |
| 5 | + AfterTargets="AfterBuild" |
| 6 | + DependsOnTargets="_GetLinuxMonoPaths;_GetMacOSMonoPaths" |
| 7 | + Inputs="$(MSBuildThisFileFullPath);$(MSBuildThisFileDirectory)Java.Interop.BootstrapTasks.csproj" |
| 8 | + Outputs="$(_OutputPath)MonoInfo.props"> |
| 9 | + <ItemGroup> |
| 10 | + <_MonoInfoLine Include="<Project>" /> |
| 11 | + <_MonoInfoLine Include=" <Choose>" /> |
| 12 | + <_MonoInfoLine Include=" <When Condition=" %27%24(MonoFrameworkPath)%27 == %27%27 ">" /> |
| 13 | + <_MonoInfoLine Include=" <PropertyGroup>" /> |
| 14 | + <_MonoInfoLine Include=" <MonoFrameworkPath>$(_MonoFrameworkPath)</MonoFrameworkPath>" /> |
| 15 | + <_MonoInfoLine Include=" <MonoLibs >$(_MonoLibs)</MonoLibs>" /> |
| 16 | + <_MonoInfoLine Include=" </PropertyGroup>" /> |
| 17 | + <_MonoInfoLine Include=" <ItemGroup>" /> |
| 18 | + <_MonoInfoLine Include=" <MonoIncludePath Include="$(_MonoIncludePath)" />" /> |
| 19 | + <_MonoInfoLine Include=" </ItemGroup>" /> |
| 20 | + <_MonoInfoLine Include=" </When>" /> |
| 21 | + <_MonoInfoLine Include=" </Choose>" /> |
| 22 | + <_MonoInfoLine Include="</Project>" /> |
| 23 | + </ItemGroup> |
| 24 | + <WriteLinesToFile |
| 25 | + File="$(_OutputPath)MonoInfo.props" |
| 26 | + Lines="@(_MonoInfoLine)" |
| 27 | + Overwrite="True" |
| 28 | + /> |
| 29 | + <Touch Files="$(_OutputPath)MonoInfo.props" /> |
| 30 | + </Target> |
| 31 | + |
| 32 | + <Target Name="_CreateMonoMk" |
| 33 | + AfterTargets="AfterBuild" |
| 34 | + DependsOnTargets="_GetLinuxMonoPaths;_GetMacOSMonoPaths" |
| 35 | + Inputs="$(MSBuildThisFileFullPath);$(MSBuildThisFileDirectory)Java.Interop.BootstrapTasks.csproj" |
| 36 | + Outputs="$(_OutputPath)mono.mk"> |
| 37 | + <ItemGroup> |
| 38 | + <_MonoMkLine Include="JI_MONO_LIB_PATH=$(_MonoLibPath)" /> |
| 39 | + </ItemGroup> |
| 40 | + <WriteLinesToFile |
| 41 | + File="$(_OutputPath)mono.mk" |
| 42 | + Lines="@(_MonoMkLine)" |
| 43 | + Overwrite="True" |
| 44 | + /> |
| 45 | + <Touch Files="$(_OutputPath)mono.mk" /> |
| 46 | + </Target> |
| 47 | + |
| 48 | + <Target Name="_GetLinuxMonoPaths" |
| 49 | + Condition=" $([MSBuild]::IsOSPlatform ('linux')) "> |
| 50 | + <Exec |
| 51 | + Command="which mono" |
| 52 | + ConsoleToMsBuild="True"> |
| 53 | + <Output TaskParameter="ConsoleOutput" PropertyName="_MonoPath" /> |
| 54 | + </Exec> |
| 55 | + <Exec |
| 56 | + Command="pkg-config --variable=libdir mono-2" |
| 57 | + ConsoleToMsBuild="True"> |
| 58 | + <Output TaskParameter="ConsoleOutput" PropertyName="_MonoPkgConfigLibdir" /> |
| 59 | + </Exec> |
| 60 | + <Exec |
| 61 | + Command="pkg-config --variable=includedir mono-2" |
| 62 | + ConsoleToMsBuild="True"> |
| 63 | + <Output TaskParameter="ConsoleOutput" PropertyName="_MonoPkgConfigIncludedir" /> |
| 64 | + </Exec> |
| 65 | + <PropertyGroup> |
| 66 | + <_MonoLibPath>$([System.IO.Path]::GetDirectoryName($(_MonoPath)))/../lib/</_MonoLibPath> |
| 67 | + <_MonoFrameworkPath>$(_MonoPkgConfigLibdir)/libmonosgen-2.0.so</_MonoFrameworkPath> |
| 68 | + <_MonoIncludePath>$(_MonoPkgConfigIncludedir)</_MonoIncludePath> |
| 69 | + <_MonoLibs>-L "$(_MonoPkgConfigLibdir)" -lmonosgen-2.0</_MonoLibs> |
| 70 | + </PropertyGroup> |
| 71 | + </Target> |
| 72 | + |
| 73 | + <Target Name="_GetMacOSMonoPaths" |
| 74 | + Condition=" $([MSBuild]::IsOSPlatform ('osx')) "> |
| 75 | + <PropertyGroup> |
| 76 | + <_MonoBase>/Library/Frameworks/Mono.framework/</_MonoBase> |
| 77 | + <_MonoLibPath>$(_MonoBase)Libraries/</_MonoLibPath> |
| 78 | + <_MonoFrameworkPath>$(_MonoLibPath)libmonosgen-2.0.1.dylib</_MonoFrameworkPath> |
| 79 | + <_MonoIncludePath>$(_MonoBase)Headers/mono-2.0</_MonoIncludePath> |
| 80 | + <_MonoLibs>-L "$(_MonoLibPath)" -lmonosgen-2.0</_MonoLibs> |
| 81 | + </PropertyGroup> |
| 82 | + </Target> |
| 83 | + |
| 84 | + |
3 | 85 | <Target Name="_CreatePackagePathsProps" |
4 | 86 | AfterTargets="AfterBuild" |
5 | 87 | Inputs="$(MSBuildThisFileFullPath);$(MSBuildThisFileDirectory)Java.Interop.BootstrapTasks.csproj" |
6 | 88 | Outputs="$(_OutputPath)PackagePaths.props"> |
7 | 89 | <ItemGroup> |
8 | 90 | <_Path Include="PkgNUnit_ConsoleRunner" Destination="$(PkgNUnit_ConsoleRunner)" /> |
9 | 91 | </ItemGroup> |
10 | | - <Message Text="PkgNUnit_ConsoleRunner=$(PkgNUnit_ConsoleRunner)" /> |
11 | 92 | <ItemGroup> |
12 | | - <_Line Include="<Project>" /> |
13 | | - <_Line Include=" <PropertyGroup>" /> |
14 | | - <_Line Include="@(_Path->' <%(Identity) Condition=" %27%24(%(Identity))%27 == %27%27 ">%(Destination)</%(Identity)>', ' |
| 93 | + <_PackagePathsLine Include="<Project>" /> |
| 94 | + <_PackagePathsLine Include=" <PropertyGroup>" /> |
| 95 | + <_PackagePathsLine Include="@(_Path->' <%(Identity) Condition=" %27%24(%(Identity))%27 == %27%27 ">%(Destination)</%(Identity)>', ' |
15 | 96 | ')" /> |
16 | | - <_Line Include=" </PropertyGroup>" /> |
17 | | - <_Line Include="</Project>" /> |
| 97 | + <_PackagePathsLine Include=" </PropertyGroup>" /> |
| 98 | + <_PackagePathsLine Include="</Project>" /> |
18 | 99 | </ItemGroup> |
19 | 100 | <WriteLinesToFile |
20 | 101 | File="$(_OutputPath)PackagePaths.props" |
21 | | - Lines="@(_Line)" |
| 102 | + Lines="@(_PackagePathsLine)" |
22 | 103 | Overwrite="True" |
23 | 104 | /> |
24 | 105 | <Touch Files="$(_OutputPath)PackagePaths.props" /> |
|
0 commit comments