Skip to content

Commit

Permalink
[build] remove remnants of OpenTK-1.0.dll (#9610)
Browse files Browse the repository at this point in the history
Context: #5755

After #5755, `<Reference Include="OpenTK-1.0" />` should be replaced
with a `Xamarin.Legacy.OpenTK` NuGet package. `external\opentk` is no
longer a git submodule, etc.

We can completely remove `src/OpenTK-1.0` and related code, which
contains a Xamarin.Android class library project.

This also led me to remove a list of assemblies in
`FrameworkAssembliesToTreatAsUserAssemblies`.
  • Loading branch information
jonathanpeppers authored Dec 10, 2024
1 parent 68da9e9 commit 6aa2522
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 604 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

/eng @jonathanpeppers @pjcollins @jonpryor

/src/OpenTK-1.0 @radekdoulik @jonpryor
/src/Mono.Android.Export @jonpryor
/src/r8 @jonathanpeppers @jonpryor
/src/Xamarin.Android.Build.Tasks @dellis1972 @jonathanpeppers
Expand Down
2 changes: 0 additions & 2 deletions Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
<MonoRequiredMaximumVersion Condition=" '$(MonoRequiredMaximumVersion)' == '' ">$(MonoRequiredMinimumVersion)</MonoRequiredMaximumVersion>
<IgnoreMaxMonoVersion Condition=" '$(IgnoreMaxMonoVersion)' == '' And '$(RunningOnCI)' == 'true' ">False</IgnoreMaxMonoVersion>
<IgnoreMaxMonoVersion Condition=" '$(IgnoreMaxMonoVersion)' == '' ">True</IgnoreMaxMonoVersion>
<OpenTKSourceDirectory>$(MSBuildThisFileDirectory)external\opentk</OpenTKSourceDirectory>
<SqliteSourceDirectory Condition=" '$(SqliteSourceDirectory)' == '' ">$(MSBuildThisFileDirectory)external\sqlite</SqliteSourceDirectory>
<LibUnwindSourceDirectory Condition=" '$(LibUnwindSourceDirectory)' == '' ">$(MSBuildThisFileDirectory)external\libunwind</LibUnwindSourceDirectory>
<LibUnwindGeneratedHeadersDirectory Condition=" '$(LibUnwindGeneratedHeadersDirectory)' == '' ">$(BootstrapOutputDirectory)\libunwind</LibUnwindGeneratedHeadersDirectory>
Expand Down Expand Up @@ -143,7 +142,6 @@
<LibUnwindSourceFullPath>$([System.IO.Path]::GetFullPath ('$(LibUnwindSourceDirectory)'))</LibUnwindSourceFullPath>
<LibUnwindGeneratedHeadersFullPath>$([System.IO.Path]::GetFullPath ('$(LibUnwindGeneratedHeadersDirectory)'))</LibUnwindGeneratedHeadersFullPath>
<LZ4SourceFullPath>$([System.IO.Path]::GetFullPath ('$(LZ4SourceDirectory)'))</LZ4SourceFullPath>
<OpenTKSourceFullPath>$([System.IO.Path]::GetFullPath ('$(OpenTKSourceDirectory)'))</OpenTKSourceFullPath>
<JavaInteropTargetFrameworkVersion>net8.0</JavaInteropTargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
Expand Down
3 changes: 0 additions & 3 deletions build-tools/installers/create-installers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@
<ItemGroup>
<_FrameworkFiles Include="$(FrameworkSrcDir)\$(FirstInstallerFrameworkVersion)\Mono.Android.Export.dll" />
<_FrameworkFiles Include="$(FrameworkSrcDir)\$(FirstInstallerFrameworkVersion)\Mono.Android.Export.pdb" />
<_FrameworkFiles Include="$(FrameworkSrcDir)\$(FirstInstallerFrameworkVersion)\OpenTK-1.0.dll" />
<_FrameworkFiles Include="$(FrameworkSrcDir)\$(FirstInstallerFrameworkVersion)\OpenTK-1.0.pdb" />
<_FrameworkFiles Include="@(MonoFacadeAssembly->'$(FrameworkSrcDir)\$(BclFrameworkVersion)\Facades\%(Identity)')" />
<_FrameworkFiles Include="@(MonoFacadeAssemblySymbol->'$(FrameworkSrcDir)\$(BclFrameworkVersion)\Facades\%(Identity)')" />
<_FrameworkFiles Include="@(MonoProfileAssembly->'$(FrameworkSrcDir)\$(BclFrameworkVersion)\%(Identity)')" />
Expand All @@ -96,7 +94,6 @@
<_FrameworkFiles Include="$(FrameworkSrcDir)\$(BclFrameworkVersion)\System.EnterpriseServices.pdb" />
<_FrameworkFiles Include="$(FrameworkSrcDir)\$(BclFrameworkVersion)\Xamarin.Android.NUnitLite.dll" />
<_FrameworkFiles Include="$(FrameworkSrcDir)\$(BclFrameworkVersion)\Xamarin.Android.NUnitLite.pdb" />
<_FrameworkFilesWin Include="$(FrameworkSrcDir)\$(FirstInstallerFrameworkVersion)\OpenTK-1.0.xml" />
<_FrameworkFilesWin Include="$(FrameworkSrcDir)\$(BclFrameworkVersion)\Xamarin.Android.NUnitLite.xml" />
</ItemGroup>
<ItemGroup>
Expand Down
20 changes: 0 additions & 20 deletions src/OpenTK-1.0/GlobalAssemblyInfo.cs

This file was deleted.

544 changes: 0 additions & 544 deletions src/OpenTK-1.0/OpenTK.csproj

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
-keep class mono.android.** { *; <init>(...); }
-keep class mono.java.** { *; <init>(...); }
-keep class mono.javax.** { *; <init>(...); }
-keep class opentk.platform.android.AndroidGameView { *; <init>(...); }
-keep class opentk.GameViewBase { *; <init>(...); }
-keep class opentk_1_0.platform.android.AndroidGameView { *; <init>(...); }
-keep class opentk_1_0.GameViewBase { *; <init>(...); }
-keep class net.dot.jni.ManagedPeer { *; <init>(...); }
-keep class xamarin.android.net.ServerCertificateCustomValidator_TrustManager { *; <init>(...); }
-keep class xamarin.android.net.ServerCertificateCustomValidator_TrustManager_FakeSSLSession { *; <init>(...); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@ public override bool RunTask ()
continue;
pkgmgr.WriteLine ("\t\t\"" + Path.GetFileName (assembly.ItemSpec) + "\",");
}
foreach (var assembly in MonoAndroidHelper.GetFrameworkAssembliesToTreatAsUserAssemblies (ResolvedAssemblies)) {
if (string.Compare (Path.GetFileName (assembly.ItemSpec), mainFileName, StringComparison.OrdinalIgnoreCase) == 0)
continue;
pkgmgr.WriteLine ("\t\t\"" + Path.GetFileName (assembly.ItemSpec) + "\",");
}

// Write the assembly dependencies
pkgmgr.WriteLine ("\t};");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ public partial class MonoAndroidHelper
"Mono.Data.Sqlite.dll",
"Mono.Posix.dll",
};
internal static readonly HashSet<string> FrameworkAssembliesToTreatAsUserAssemblies = new HashSet<string> (StringComparer.OrdinalIgnoreCase) {
"OpenTK-1.0.dll",
"Mono.Android.Support.v13.dll",
"Mono.Android.Support.v4.dll",
"Xamarin.Android.NUnitLite.dll",
};

public static bool IsFrameworkAssembly (string assembly)
{
Expand All @@ -33,14 +27,6 @@ public static bool IsFrameworkAssembly (string assembly)
public static bool IsFrameworkAssembly (string assembly, bool checkSdkPath)
{
if (IsSharedRuntimeAssembly (assembly)) {
#if MSBUILD
bool treatAsUser = FrameworkAssembliesToTreatAsUserAssemblies.Contains (Path.GetFileName (assembly));
// Framework assemblies don't come from outside the SDK Path;
// user assemblies do
if (checkSdkPath && treatAsUser && TargetFrameworkDirectories != null) {
return ExistsInFrameworkPath (assembly);
}
#endif
return true;
}
return TargetFrameworkDirectories == null || !checkSdkPath ? false : ExistsInFrameworkPath (assembly);
Expand Down
11 changes: 0 additions & 11 deletions src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,17 +415,6 @@ public static ZipArchive ReadZipFile (string filename)
}

#if MSBUILD
internal static IEnumerable<ITaskItem> GetFrameworkAssembliesToTreatAsUserAssemblies (ITaskItem[] resolvedAssemblies)
{
var ret = new List<ITaskItem> ();
foreach (ITaskItem item in resolvedAssemblies) {
if (FrameworkAssembliesToTreatAsUserAssemblies.Contains (Path.GetFileName (item.ItemSpec)))
ret.Add (item);
}

return ret;
}

public static bool SaveMapFile (IBuildEngine4 engine, string mapFile, Dictionary<string, string> map)
{
engine?.RegisterTaskObjectAssemblyLocal (mapFile, map, RegisteredTaskObjectLifetime.Build);
Expand Down

0 comments on commit 6aa2522

Please sign in to comment.