|
168 | 168 | <Target Name="AndroidSupportLibrariesTypeForwardersGenerationWithGenAPI" BeforeTargets="Build"> |
169 | 169 | <Message Text="AndroidSupportLibrariesTypeForwardersGenerationWithGenAPI" ></Message> |
170 | 170 | <PropertyGroup> |
171 | | - <GenAPIPath>$(MSBuildProjectDirectory)/../../tools/microsoft.dotnet.buildtools.genapi.1.0.0-beta-00081/Microsoft.DotNet.BuildTools.GenAPI/tools/GenAPI.exe</GenAPIPath> |
| 171 | + <GenAPITargetFramework>$(TargetFramework)</GenAPITargetFramework> |
| 172 | + <GenAPITargetFramework Condition=" '$(GenAPITargetFramework)' == '' ">$(TargetFrameworks)</GenAPITargetFramework> |
| 173 | + <GenAPIPath>$(MSBuildProjectDirectory)\..\..\tools\microsoft.dotnet.buildtools.genapi.1.0.0-beta-00081\Microsoft.DotNet.BuildTools.GenAPI\tools\GenAPI.exe</GenAPIPath> |
| 174 | + |
| 175 | + <GenAPIIntermediateOutputPath>bin\Release\MonoAndroid90\</GenAPIIntermediateOutputPath> |
| 176 | + |
| 177 | + <GenAPILibPaths Condition=" '$(OS)' == 'Windows_NT' ">$(VsInstallRoot)\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0,$(VsInstallRoot)\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9.0</GenAPILibPaths> |
| 178 | + <GenAPILibPaths Condition=" '$(OS)' != 'Windows_NT' ">$(VsInstallRoot)\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0,$(VsInstallRoot)\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9.0</GenAPILibPaths> |
| 179 | + |
| 180 | + <GenAPICommand Condition=" '$(OS)' == 'Windows_NT'">"$(GenAPIPath)"</GenAPICommand> |
| 181 | + <GenAPICommand Condition=" '$(OS)' != 'Windows_NT'">mono --runtime=v4.0.30319 "$(GenAPIPath)"</GenAPICommand> |
172 | 182 | </PropertyGroup> |
173 | 183 |
|
174 | 184 | <ItemGroup> |
|
177 | 187 | if (dep.IsProjectReference) |
178 | 188 | { |
179 | 189 | <GenAPIItemBase |
180 | | - Include="../../generated/@(dep.MavenArtifact.MavenGroupId).@(dep.MavenArtifact.MavenArtifactId)/" |
181 | | - > |
182 | | - <GenAPIAssembly>"$(IntermediateOutputPath)/@(dep.NuGetPackageId).dll"</GenAPIAssembly> |
183 | | - <GenAPICSCode>./Additions/@(dep.NuGetPackageId).cs</GenAPICSCode> |
| 190 | + Include="$(MSBuildProjectDirectory)\..\@(dep.MavenArtifact.MavenGroupId).@(dep.MavenArtifact.MavenArtifactId)\"> |
| 191 | + <GenAPIAssembly>$(GenAPIIntermediateOutputPath)@(dep.NuGetPackageId).dll</GenAPIAssembly> |
| 192 | + <GenAPICSCode>$(MSBuildProjectDirectory)\Additions\@(dep.NuGetPackageId).cs</GenAPICSCode> |
184 | 193 | </GenAPIItemBase> |
185 | 194 | } |
186 | 195 | } |
|
191 | 200 | // For some reason GenAPI.exe can't handle absolute paths on mac/unix properly, so always make them relative |
192 | 201 | // GenAPI.exe -libPath:$(MONOANDROID) -out:Some.generated.cs -w:TypeForwards ./relative/path/to/Assembly.dll |
193 | 202 | --> |
194 | | - <MakeDir Directories="./Additions" /> |
| 203 | + <MakeDir Directories="$(MSBuildProjectDirectory)\Additions" /> |
195 | 204 | <Exec |
196 | | - Command="mono $(GenAPIPath) -libPath:$(MONOANDROID) -out:%(GenAPIItemBase.GenAPICSCode) -w:TypeForwards %(GenAPIItemBase.Identity)/%(GenAPIItemBase.GenAPIAssembly) " |
| 205 | + Command="$(GenAPIPath) -libPath:"$(GenAPILibPaths)" -out:"%(GenAPIItemBase.GenAPICSCode)" -w:TypeForwards "%(GenAPIItemBase.Identity)%(GenAPIItemBase.GenAPIAssembly)"" |
197 | 206 | /> |
198 | 207 | </Target> |
199 | 208 | } |
|
0 commit comments