Browse Source

Use net35 ref assemblies

ghorsington 3 years ago
parent
commit
fdb65d8a86

+ 3 - 0
BepInEx.Bootstrap/BepInEx.Bootstrap.csproj

@@ -12,5 +12,8 @@
     <ProjectReference Include="..\BepInEx.Core\BepInEx.Core.csproj" />
     <ProjectReference Include="..\BepInEx.Core\BepInEx.Core.csproj" />
     <ProjectReference Include="..\BepInEx.Unity\BepInEx.Unity.csproj" />
     <ProjectReference Include="..\BepInEx.Unity\BepInEx.Unity.csproj" />
   </ItemGroup>
   </ItemGroup>
+  <ItemGroup>
+    <PackageReference Include="jnm2.ReferenceAssemblies.net35" Version="1.0.1" PrivateAssets="All" />
+  </ItemGroup>
   <Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared" />
   <Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared" />
 </Project>
 </Project>

+ 1 - 1
BepInEx.Core/BepInEx.Core.csproj

@@ -1,7 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
   <PropertyGroup>
     <TargetFramework>net35</TargetFramework>
     <TargetFramework>net35</TargetFramework>
-    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
     <AssemblyTitle>BepInEx</AssemblyTitle>
     <AssemblyTitle>BepInEx</AssemblyTitle>
     <Product>BepInEx</Product>
     <Product>BepInEx</Product>
     <LangVersion>9</LangVersion>
     <LangVersion>9</LangVersion>
@@ -25,6 +24,7 @@
   </PropertyGroup>
   </PropertyGroup>
   <ItemGroup>
   <ItemGroup>
     <PackageReference Include="HarmonyX" Version="2.2.0" />
     <PackageReference Include="HarmonyX" Version="2.2.0" />
+    <PackageReference Include="jnm2.ReferenceAssemblies.net35" Version="1.0.1" PrivateAssets="All" />
     <PackageReference Include="Mono.Cecil" Version="0.10.4" />
     <PackageReference Include="Mono.Cecil" Version="0.10.4" />
     <PackageReference Include="MonoMod.Utils" Version="20.11.5.1" />
     <PackageReference Include="MonoMod.Utils" Version="20.11.5.1" />
     <PackageReference Include="SemanticVersioning" Version="1.3.0" />
     <PackageReference Include="SemanticVersioning" Version="1.3.0" />

+ 4 - 0
BepInEx.IL2CPP/BepInEx.IL2CPP.csproj

@@ -47,6 +47,10 @@
   <ItemGroup>
   <ItemGroup>
     <PackageReference Include="HarmonyX" Version="2.2.0" />
     <PackageReference Include="HarmonyX" Version="2.2.0" />
     <PackageReference Include="Iced" Version="1.6.0" />
     <PackageReference Include="Iced" Version="1.6.0" />
+    <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
     <PackageReference Include="MonoMod.RuntimeDetour" Version="20.11.5.1" />
     <PackageReference Include="MonoMod.RuntimeDetour" Version="20.11.5.1" />
   </ItemGroup>
   </ItemGroup>
   <Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared" />
   <Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared" />

+ 4 - 0
BepInEx.NetLauncher/BepInEx.NetLauncher.csproj

@@ -25,6 +25,10 @@
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <PackageReference Include="HarmonyX" Version="2.2.0" />
     <PackageReference Include="HarmonyX" Version="2.2.0" />
+    <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
   </ItemGroup>
   </ItemGroup>
   <Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared" />
   <Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared" />
 </Project>
 </Project>

+ 1 - 0
BepInEx.Patcher/BepInEx.Patcher.csproj

@@ -19,6 +19,7 @@
   <ItemGroup>
   <ItemGroup>
     <PackageReference Include="ILRepack" Version="2.0.16" />
     <PackageReference Include="ILRepack" Version="2.0.16" />
     <PackageReference Include="ILRepack.Lib.MSBuild.Task" Version="2.0.16.1" />
     <PackageReference Include="ILRepack.Lib.MSBuild.Task" Version="2.0.16.1" />
+    <PackageReference Include="jnm2.ReferenceAssemblies.net35" Version="1.0.1" PrivateAssets="All" />
     <PackageReference Include="Mono.Cecil" Version="0.10.4" />
     <PackageReference Include="Mono.Cecil" Version="0.10.4" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>

+ 1 - 0
BepInEx.Preloader.Core/BepInEx.Preloader.Core.csproj

@@ -18,6 +18,7 @@
     <ProjectReference Include="..\BepInEx.Core\BepInEx.Core.csproj" />
     <ProjectReference Include="..\BepInEx.Core\BepInEx.Core.csproj" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
+    <PackageReference Include="jnm2.ReferenceAssemblies.net35" Version="1.0.1" PrivateAssets="All" />
     <PackageReference Include="HarmonyX" Version="2.2.0" />
     <PackageReference Include="HarmonyX" Version="2.2.0" />
     <PackageReference Include="Mono.Cecil" Version="0.10.4" />
     <PackageReference Include="Mono.Cecil" Version="0.10.4" />
     <PackageReference Include="MonoMod.RuntimeDetour" Version="20.11.5.1" />
     <PackageReference Include="MonoMod.RuntimeDetour" Version="20.11.5.1" />

+ 1 - 0
BepInEx.Preloader.Unity/BepInEx.Preloader.Unity.csproj

@@ -20,6 +20,7 @@
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <PackageReference Include="HarmonyX" Version="2.2.0" />
     <PackageReference Include="HarmonyX" Version="2.2.0" />
+    <PackageReference Include="jnm2.ReferenceAssemblies.net35" Version="1.0.1" PrivateAssets="All" />
   </ItemGroup>
   </ItemGroup>
   <Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared" />
   <Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared" />
 </Project>
 </Project>

+ 1 - 0
BepInEx.Unity/BepInEx.Unity.csproj

@@ -27,6 +27,7 @@
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <PackageReference Include="HarmonyX" Version="2.2.0" />
     <PackageReference Include="HarmonyX" Version="2.2.0" />
+    <PackageReference Include="jnm2.ReferenceAssemblies.net35" Version="1.0.1" PrivateAssets="All" />
   </ItemGroup>
   </ItemGroup>
   <Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared" />
   <Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared" />
 </Project>
 </Project>

+ 4 - 0
BepInExTests/BepInExTests.csproj

@@ -23,6 +23,10 @@
   <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
   <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
   <ItemGroup>
   <ItemGroup>
     <PackageReference Include="Iced" Version="1.6.0" />
     <PackageReference Include="Iced" Version="1.6.0" />
+    <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
     <PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
     <PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
     <PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
     <PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />

+ 7 - 8
build.cake

@@ -55,14 +55,13 @@ Task("Build")
 
 
     buildVersion = FindRegexMatchGroupInFile(bepinExProperties + File("BepInEx.Shared.projitems"), @"\<Version\>([0-9]+\.[0-9]+\.[0-9]+)\<\/Version\>", 1, System.Text.RegularExpressions.RegexOptions.None).Value;
     buildVersion = FindRegexMatchGroupInFile(bepinExProperties + File("BepInEx.Shared.projitems"), @"\<Version\>([0-9]+\.[0-9]+\.[0-9]+)\<\/Version\>", 1, System.Text.RegularExpressions.RegexOptions.None).Value;
 
 
-    var buildSettings = new MSBuildSettings {
+    var buildSettings = new DotNetCoreBuildSettings {
         Configuration = "Release",
         Configuration = "Release",
-        Restore = true
     };
     };
 
 
     if (isBleedingEdge) 
     if (isBleedingEdge) 
     {
     {
-        buildSettings.Properties["BuildInfo"] = new[] {
+        buildSettings.MSBuildSettings.Properties["BuildInfo"] = new[] {
             TransformText("BLEEDING EDGE Build #<%buildNumber%> from <%shortCommit%> at <%branchName%>")
             TransformText("BLEEDING EDGE Build #<%buildNumber%> from <%shortCommit%> at <%branchName%>")
                 .WithToken("buildNumber", buildId)
                 .WithToken("buildNumber", buildId)
                 .WithToken("shortCommit", currentCommit)
                 .WithToken("shortCommit", currentCommit)
@@ -70,21 +69,21 @@ Task("Build")
                 .ToString()
                 .ToString()
         };
         };
 
 
-        buildSettings.Properties["AssemblyVersion"] = new[] { buildVersion + "." + buildId };
+        buildSettings.MSBuildSettings.Properties["AssemblyVersion"] = new[] { buildVersion + "." + buildId };
 
 
         buildVersion += "-be." + buildId;
         buildVersion += "-be." + buildId;
 
 
-        buildSettings.Properties["Version"] = new[] { buildVersion };
+        buildSettings.MSBuildSettings.Properties["Version"] = new[] { buildVersion };
     }
     }
 
 
     //buildSettings.Properties["TargetFrameworks"] = new []{ "net35" };
     //buildSettings.Properties["TargetFrameworks"] = new []{ "net35" };
-    MSBuild("./BepInEx.Unity/BepInEx.Unity.csproj", buildSettings);
+    DotNetCoreBuild("./BepInEx.Unity/BepInEx.Unity.csproj", buildSettings);
     
     
     //buildSettings.Properties["TargetFrameworks"] = new []{ "net452" };
     //buildSettings.Properties["TargetFrameworks"] = new []{ "net452" };
-    MSBuild("./BepInEx.NetLauncher/BepInEx.NetLauncher.csproj", buildSettings);
+    DotNetCoreBuild("./BepInEx.NetLauncher/BepInEx.NetLauncher.csproj", buildSettings);
     
     
     //buildSettings.Properties["TargetFrameworks"] = new []{ "net472" };
     //buildSettings.Properties["TargetFrameworks"] = new []{ "net472" };
-    MSBuild("./BepInEx.IL2CPP/BepInEx.IL2CPP.csproj", buildSettings);
+    DotNetCoreBuild("./BepInEx.IL2CPP/BepInEx.IL2CPP.csproj", buildSettings);
 });
 });
 
 
 const string DOORSTOP_VER_WIN = "3.1.0.0";
 const string DOORSTOP_VER_WIN = "3.1.0.0";