UnityExplorer/build.ps1

155 lines
8.6 KiB
PowerShell
Raw Permalink Normal View History

2022-04-27 18:13:17 +08:00
# ----------- MelonLoader IL2CPP (net6) -----------
2022-05-13 15:11:25 +08:00
dotnet build src/UnityExplorer.sln -c Release_ML_Cpp_net6
2022-04-12 00:36:12 +08:00
$Path = "Release\UnityExplorer.MelonLoader.IL2CPP.net6preview"
2022-04-27 18:13:17 +08:00
# ILRepack
2022-05-13 15:11:25 +08:00
lib/ILRepack.exe /target:library /lib:lib/net6 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/UnityExplorer.ML.IL2CPP.net6preview.dll $Path/UnityExplorer.ML.IL2CPP.net6preview.dll $Path/mcs.dll
2022-04-27 18:13:17 +08:00
# (cleanup and move files)
2022-05-13 15:11:25 +08:00
Remove-Item $Path/UnityExplorer.ML.IL2CPP.net6preview.deps.json
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
Remove-Item $Path/Iced.dll
Remove-Item $Path/UnhollowerBaseLib.dll
2022-04-11 22:29:02 +08:00
New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force
2022-05-13 15:11:25 +08:00
Move-Item -Path $Path/UnityExplorer.ML.IL2CPP.net6preview.dll -Destination $Path/Mods -Force
2022-04-11 22:29:02 +08:00
New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force
2022-06-23 04:03:58 +08:00
Move-Item -Path $Path/UniverseLib.IL2CPP.Unhollower.dll -Destination $Path/UserLibs -Force
2022-04-11 22:29:02 +08:00
# (create zip archive)
2022-05-13 15:11:25 +08:00
Remove-Item $Path/../UnityExplorer.MelonLoader.IL2CPP.net6preview.zip -ErrorAction SilentlyContinue
7z a $Path/../UnityExplorer.MelonLoader.IL2CPP.net6preview.zip .\$Path\*
2022-04-11 22:29:02 +08:00
2022-04-27 18:13:17 +08:00
# ----------- MelonLoader IL2CPP (net472) -----------
2022-05-13 15:11:25 +08:00
dotnet build src/UnityExplorer.sln -c Release_ML_Cpp_net472
$Path = "Release/UnityExplorer.MelonLoader.IL2CPP"
2022-04-27 18:13:17 +08:00
# ILRepack
2022-05-13 15:11:25 +08:00
lib/ILRepack.exe /target:library /lib:lib/net472 /lib:lib/net35 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/UnityExplorer.ML.IL2CPP.dll $Path/UnityExplorer.ML.IL2CPP.dll $Path/mcs.dll
2022-04-27 18:13:17 +08:00
# (cleanup and move files)
2022-05-13 15:11:25 +08:00
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
Remove-Item $Path/Iced.dll
Remove-Item $Path/UnhollowerBaseLib.dll
2022-04-11 22:29:02 +08:00
New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force
2022-05-13 15:11:25 +08:00
Move-Item -Path $Path/UnityExplorer.ML.IL2CPP.dll -Destination $Path/Mods -Force
2022-04-11 22:29:02 +08:00
New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force
2022-06-23 04:03:58 +08:00
Move-Item -Path $Path/UniverseLib.IL2CPP.Unhollower.dll -Destination $Path/UserLibs -Force
2022-04-11 22:29:02 +08:00
# (create zip archive)
2022-05-13 15:11:25 +08:00
Remove-Item $Path/../UnityExplorer.MelonLoader.IL2CPP.zip -ErrorAction SilentlyContinue
7z a $Path/../UnityExplorer.MelonLoader.IL2CPP.zip .\$Path\*
2022-04-11 22:29:02 +08:00
2022-04-27 18:13:17 +08:00
# ----------- MelonLoader Mono -----------
2022-05-13 15:11:25 +08:00
dotnet build src/UnityExplorer.sln -c Release_ML_Mono
$Path = "Release/UnityExplorer.MelonLoader.Mono"
2022-04-27 18:13:17 +08:00
# ILRepack
2022-05-13 15:11:25 +08:00
lib/ILRepack.exe /target:library /lib:lib/net35 /lib:$Path /internalize /out:$Path/UnityExplorer.ML.Mono.dll $Path/UnityExplorer.ML.Mono.dll $Path/mcs.dll
2022-04-27 18:13:17 +08:00
# (cleanup and move files)
2022-05-13 15:11:25 +08:00
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
2022-04-11 22:29:02 +08:00
New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force
2022-05-13 15:11:25 +08:00
Move-Item -Path $Path/UnityExplorer.ML.Mono.dll -Destination $Path/Mods -Force
2022-04-11 22:29:02 +08:00
New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force
2022-05-13 15:11:25 +08:00
Move-Item -Path $Path/UniverseLib.Mono.dll -Destination $Path/UserLibs -Force
2022-04-11 22:29:02 +08:00
# (create zip archive)
2022-05-13 15:11:25 +08:00
Remove-Item $Path/../UnityExplorer.MelonLoader.Mono.zip -ErrorAction SilentlyContinue
7z a $Path/../UnityExplorer.MelonLoader.Mono.zip .\$Path\*
2022-04-11 22:29:02 +08:00
2022-04-27 18:13:17 +08:00
# ----------- BepInEx IL2CPP -----------
2022-05-13 15:11:25 +08:00
dotnet build src/UnityExplorer.sln -c Release_BIE_Cpp
$Path = "Release/UnityExplorer.BepInEx.IL2CPP"
2022-04-27 18:13:17 +08:00
# ILRepack
2022-05-13 15:11:25 +08:00
lib/ILRepack.exe /target:library /lib:lib/net472 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/UnityExplorer.BIE.IL2CPP.dll $Path/UnityExplorer.BIE.IL2CPP.dll $Path/mcs.dll $Path/Tomlet.dll
2022-04-27 18:13:17 +08:00
# (cleanup and move files)
2022-05-13 15:11:25 +08:00
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
Remove-Item $Path/Iced.dll
Remove-Item $Path/UnhollowerBaseLib.dll
2022-04-11 22:29:02 +08:00
New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force
2022-05-13 15:11:25 +08:00
New-Item -Path "$Path" -Name "plugins/sinai-dev-UnityExplorer" -ItemType "directory" -Force
Move-Item -Path $Path/UnityExplorer.BIE.IL2CPP.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force
2022-06-23 04:03:58 +08:00
Move-Item -Path $Path/UniverseLib.IL2CPP.Unhollower.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force
2022-04-11 22:29:02 +08:00
# (create zip archive)
2022-05-13 15:11:25 +08:00
Remove-Item $Path/../UnityExplorer.BepInEx.IL2CPP.zip -ErrorAction SilentlyContinue
7z a $Path/../UnityExplorer.BepInEx.IL2CPP.zip .\$Path\*
2022-04-11 22:29:02 +08:00
2022-06-23 04:03:58 +08:00
# ----------- BepInEx IL2CPP CoreCLR -----------
dotnet build src/UnityExplorer.sln -c Release_BIE_CoreCLR
$Path = "Release/UnityExplorer.BepInEx.IL2CPP.CoreCLR"
# ILRepack
lib/ILRepack.exe /target:library /lib:lib/net472 /lib:lib/net6/ /lib:lib/interop/ /lib:$Path /internalize /out:$Path/UnityExplorer.BIE.IL2CPP.CoreCLR.dll $Path/UnityExplorer.BIE.IL2CPP.CoreCLR.dll $Path/mcs.dll $Path/Tomlet.dll
# (cleanup and move files)
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
Remove-Item $Path/Iced.dll
Remove-Item $Path/Il2CppInterop.Common.dll
Remove-Item $Path/Il2CppInterop.Runtime.dll
Remove-Item $Path/Microsoft.Extensions.Logging.Abstractions.dll
Remove-Item $Path/UnityExplorer.BIE.IL2CPP.CoreCLR.deps.json
New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force
New-Item -Path "$Path" -Name "plugins/sinai-dev-UnityExplorer" -ItemType "directory" -Force
Move-Item -Path $Path/UnityExplorer.BIE.IL2CPP.CoreCLR.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force
Move-Item -Path $Path/UniverseLib.IL2CPP.Interop.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force
# (create zip archive)
Remove-Item $Path/../UnityExplorer.BepInEx.IL2CPP.CoreCLR.zip -ErrorAction SilentlyContinue
7z a $Path/../UnityExplorer.BepInEx.IL2CPP.CoreCLR.zip .\$Path\*
2022-04-27 18:13:17 +08:00
# ----------- BepInEx 5 Mono -----------
2022-05-13 15:11:25 +08:00
dotnet build src/UnityExplorer.sln -c Release_BIE5_Mono
$Path = "Release/UnityExplorer.BepInEx5.Mono"
2022-04-27 18:13:17 +08:00
# ILRepack
2022-05-13 15:11:25 +08:00
lib/ILRepack.exe /target:library /lib:lib/net35 /lib:$Path /internalize /out:$Path/UnityExplorer.BIE5.Mono.dll $Path/UnityExplorer.BIE5.Mono.dll $Path/mcs.dll $Path/Tomlet.dll
2022-04-27 18:13:17 +08:00
# (cleanup and move files)
2022-05-13 15:11:25 +08:00
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
2022-04-11 22:29:02 +08:00
New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force
2022-05-13 15:11:25 +08:00
New-Item -Path "$Path" -Name "plugins/sinai-dev-UnityExplorer" -ItemType "directory" -Force
Move-Item -Path $Path/UnityExplorer.BIE5.Mono.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force
Move-Item -Path $Path/UniverseLib.Mono.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force
2022-04-11 22:29:02 +08:00
# (create zip archive)
2022-05-13 15:11:25 +08:00
Remove-Item $Path/../UnityExplorer.BepInEx5.Mono.zip -ErrorAction SilentlyContinue
7z a $Path/../UnityExplorer.BepInEx5.Mono.zip .\$Path\*
2022-04-11 22:29:02 +08:00
2022-04-27 18:13:17 +08:00
# ----------- BepInEx 6 Mono -----------
2022-05-13 15:11:25 +08:00
dotnet build src/UnityExplorer.sln -c Release_BIE6_Mono
$Path = "Release/UnityExplorer.BepInEx6.Mono"
2022-04-27 18:13:17 +08:00
# ILRepack
2022-05-13 15:11:25 +08:00
lib/ILRepack.exe /target:library /lib:lib/net35 /lib:$Path /internalize /out:$Path/UnityExplorer.BIE6.Mono.dll $Path/UnityExplorer.BIE6.Mono.dll $Path/mcs.dll $Path/Tomlet.dll
2022-04-27 18:13:17 +08:00
# (cleanup and move files)
2022-05-13 15:11:25 +08:00
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
2022-04-11 22:29:02 +08:00
New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force
2022-05-13 15:11:25 +08:00
New-Item -Path "$Path" -Name "plugins/sinai-dev-UnityExplorer" -ItemType "directory" -Force
Move-Item -Path $Path/UnityExplorer.BIE6.Mono.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force
Move-Item -Path $Path/UniverseLib.Mono.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force
2022-04-11 22:29:02 +08:00
# (create zip archive)
2022-05-13 15:11:25 +08:00
Remove-Item $Path/../UnityExplorer.BepInEx6.Mono.zip -ErrorAction SilentlyContinue
7z a $Path/../UnityExplorer.BepInEx6.Mono.zip .\$Path\*
2022-04-11 22:29:02 +08:00
2022-04-27 18:13:17 +08:00
# ----------- Standalone Mono -----------
2022-05-13 15:11:25 +08:00
dotnet build src/UnityExplorer.sln -c Release_STANDALONE_Mono
$Path = "Release/UnityExplorer.Standalone.Mono"
2022-04-27 18:13:17 +08:00
# ILRepack
2022-05-13 15:11:25 +08:00
lib/ILRepack.exe /target:library /lib:lib/net35 /lib:$Path /internalize /out:$Path/UnityExplorer.Standalone.Mono.dll $Path/UnityExplorer.Standalone.Mono.dll $Path/mcs.dll $Path/Tomlet.dll
2022-04-27 18:13:17 +08:00
# (cleanup and move files)
2022-05-13 15:11:25 +08:00
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
Remove-Item $Path/../UnityExplorer.Standalone.Mono.zip -ErrorAction SilentlyContinue
7z a $Path/../UnityExplorer.Standalone.Mono.zip .\$Path\*
2022-04-11 22:29:02 +08:00
2022-04-27 18:13:17 +08:00
# ----------- Standalone IL2CPP -----------
2022-05-13 15:11:25 +08:00
dotnet build src/UnityExplorer.sln -c Release_STANDALONE_Cpp
$Path = "Release/UnityExplorer.Standalone.IL2CPP"
2022-04-27 18:13:17 +08:00
# ILRepack
2022-05-13 15:11:25 +08:00
lib/ILRepack.exe /target:library /lib:lib/net472 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/UnityExplorer.Standalone.IL2CPP.dll $Path/UnityExplorer.Standalone.IL2CPP.dll $Path/mcs.dll $Path/Tomlet.dll
2022-04-27 18:13:17 +08:00
# (cleanup and move files)
2022-05-13 15:11:25 +08:00
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
Remove-Item $Path/Iced.dll
Remove-Item $Path/UnhollowerBaseLib.dll
Remove-Item $Path/../UnityExplorer.Standalone.IL2CPP.zip -ErrorAction SilentlyContinue
7z a $Path/../UnityExplorer.Standalone.IL2CPP.zip .\$Path\*
2022-04-11 22:29:02 +08:00
2022-04-27 18:13:17 +08:00
# ----------- Editor (mono) -----------
2022-05-13 15:11:25 +08:00
$Path1 = "Release/UnityExplorer.Standalone.Mono"
$Path2 = "UnityEditorPackage/Runtime"
Copy-Item $Path1/UnityExplorer.STANDALONE.Mono.dll -Destination $Path2
Copy-Item $Path1/UniverseLib.Mono.dll -Destination $Path2
Remove-Item Release/UnityExplorer.Editor.zip -ErrorAction SilentlyContinue
7z a Release/UnityExplorer.Editor.zip .\UnityEditorPackage\*