Skip to content

Commit

Permalink
Fix Xamarin project compiles (opentk#725)
Browse files Browse the repository at this point in the history
* Fix Generator.Rewrite failing on iOS builds

* Fix incorrect path

* Directly link to Xamarin.iOS facades

* Fix Xamarin.Mac framework directory

* Add TVOS/WatchOS framework directories

* Add Android framework directory

* Remove unused framework dirs for now

Maybe we can add these back in later, when we have compiling support for these platforms.

* Remove ProjectExtensions
  • Loading branch information
smoogipoo authored and VPeruS committed Jul 8, 2018
1 parent b1aee95 commit 1039f00
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion src/Generator.Rewrite/OpenTKAssemblyResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ public AssemblyDefinition Resolve(AssemblyNameReference name, ReaderParameters p

var framework_dir = Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName);
var framework_dirs = on_mono
? new[] { framework_dir, Path.Combine(framework_dir, "Facades") }
? new[]
{
framework_dir,
Path.Combine(framework_dir, "Facades"),
"/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS",
"/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Facades",
"/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1"
}
: new[] { framework_dir };

if (IsZero(name.Version))
Expand Down
8 changes: 4 additions & 4 deletions src/OpenTK.iOS/OpenTK.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@
</Target>
-->
<Target Name="AfterBuild">
<Exec Command="$(OutputPath)..\..\..\..\Generator.Rewrite\bin\Debug\Rewrite.exe $(OutputPath)OpenTK.dll ..\..\OpenTK.snk -dllimport -debug" Condition="$(OS) == 'Windows_NT' and $(Configuration) == 'Debug'" />
<Exec Command="$(OutputPath)..\..\..\..\Generator.Rewrite\bin\Release\Rewrite.exe $(OutputPath)OpenTK.dll ..\..\OpenTK.snk -dllimport" Condition="$(OS) == 'Windows_NT' and $(Configuration) == 'Release'" />
<Exec WorkingDirectory="$(SolutionDir)src/Generator.Rewrite/bin/Debug/" Command="mono ./Rewrite.exe $(SolutionDir)src/OpenTK/bin/Debug/iOS/OpenTK.dll $(SolutionDir)OpenTK.snk -dllimport -debug" Condition="$(OS) != 'Windows_NT' and $(Configuration) == 'Debug'" />
<Exec WorkingDirectory="$(SolutionDir)src/Generator.Rewrite/bin/Release" Command="mono ./Rewrite.exe $(SolutionDir)src/OpenTK/bin/Release/iOS/OpenTK.dll $(SolutionDir)OpenTK.snk -dllimport" Condition="$(OS) != 'Windows_NT' and $(Configuration) == 'Release'" />
<Exec Condition="$(OS) == 'Windows_NT' and $(Configuration) == 'Debug'" Command="$(OutputPath)..\..\..\..\Generator.Rewrite\bin\Debug\Rewrite.exe --assembly $(OutputPath)OpenTK.dll --signing-key ..\..\OpenTK.snk --debug" />
<Exec Condition="$(OS) == 'Windows_NT' and $(Configuration) == 'Release'" Command="$(OutputPath)..\..\..\..\Generator.Rewrite\bin\Release\Rewrite.exe --assembly $(OutputPath)OpenTK.dll --signing-key ..\..\OpenTK.snk" />
<Exec Condition="$(OS) != 'Windows_NT' and $(Configuration) == 'Debug'" Command="mono $(OutputPath)../../../../Generator.Rewrite/bin/Debug/Rewrite.exe --assembly $(OutputPath)OpenTK.dll --signing-key ../../OpenTK.snk --debug" />
<Exec Condition="$(OS) != 'Windows_NT' and $(Configuration) == 'Release'" Command="mono $(OutputPath)../../../../Generator.Rewrite/bin/Release/Rewrite.exe --assembly $(OutputPath)OpenTK.dll --signing-key ../../OpenTK.snk" />
</Target>
<ItemGroup>
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll">
Expand Down

0 comments on commit 1039f00

Please sign in to comment.