Skip to content

Commit

Permalink
Set up IL2CPP builds and releases; Trim release version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed Nov 27, 2023
1 parent 65ce9fb commit cf53689
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>

<OutputPath>..\bin\IL2CPP\</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<GenerateDocumentationFile>True</GenerateDocumentationFile>

<DebugType>embedded</DebugType>
</PropertyGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<Delete Files="$(OutputPath)\RuntimeUnityEditor.Bepin6.IL2CPP.deps.json" />
<Delete Files="$(OutputPath)\mcs.pdb" />
</Target>

<ItemGroup>
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.664" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@

namespace RuntimeUnityEditor.Bepin6.IL2CPP
{

/// <summary>
/// This is a loader plugin for BepInEx6 (IL2CPP version).
/// When referencing RuntimeUnityEditor from other code it's recommended to not reference this assembly and instead reference RuntimeUnityEditorCore directly.
/// If you need your code to run after RUE is initialized, add a <code>[BepInDependency(RuntimeUnityEditorCore.GUID)]</code> attribute to your plugin.
/// You can see if RuntimeUnityEditor has finished loading with <code>RuntimeUnityEditorCore.IsInitialized()</code>.
/// </summary>
[Obsolete("It's recommended to reference RuntimeUnityEditorCore directly")]
[BepInPlugin(RuntimeUnityEditorCore.GUID, "Runtime Unity Editor", RuntimeUnityEditorCore.Version)]
public class RuntimeUnityEditorPluginIL2CPP : BasePlugin
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,19 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RootNamespace>RuntimeUnityEditor.Core</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<OutputPath>..\bin\IL2CPP\</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<GenerateDocumentationFile>True</GenerateDocumentationFile>

<DebugType>embedded</DebugType>
</PropertyGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<Delete Files="$(OutputPath)\RuntimeUnityEditor.Core.IL2CPP.deps.json" />
<Delete Files="$(OutputPath)\mcs.pdb" />
</Target>

<ItemGroup>
<None Remove="ILRepack.targets" />
<None Remove="packages.config" />
Expand Down Expand Up @@ -41,6 +52,7 @@
<ItemGroup>
<Reference Include="Unity.InputSystem">
<HintPath>..\Libs\IL2CPP_net6\Unity.InputSystem.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>

Expand Down
15 changes: 14 additions & 1 deletion release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,31 @@ else {
$out = $dir + "out\"
$copy = $dir + "copy\"
$BIEdir = $dir + "BepInEx\"
$IL2CPPdir = $dir + "IL2CPP\"
$Coredir = $dir + "Core\"
$UMMdir = $dir + "UMM\"

$ver = (Get-Item ($Coredir + "\RuntimeUnityEditor.Core.dll")).VersionInfo.FileVersion.ToString()
$ver = (Get-Item ($Coredir + "\RuntimeUnityEditor.Core.dll")).VersionInfo.FileVersion.ToString() -replace "([\d+\.]+?\d+)[\.0]*$", '${1}'

New-Item -ItemType Directory -Force -Path ($out)

# BepInEx 5
Remove-Item -Force -Path ($copy) -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path ($copy)
Copy-Item -Path ($BIEdir) -Destination ($copy) -Recurse -Force
Copy-Item -Path ($Coredir+"*") -Destination ($copy + "BepInEx\plugins\RuntimeUnityEditor") -Recurse -Force
Compress-Archive -Path ($copy + "BepInEx") -Force -CompressionLevel "Optimal" -DestinationPath ($out + "RuntimeUnityEditor_BepInEx5_v" + $ver + ".zip")

# BepInEx 6 IL2CPP
Remove-Item -Force -Path ($copy) -Recurse -ErrorAction SilentlyContinue
$copyDeep = $copy + "BepInEx\plugins\RuntimeUnityEditor"
New-Item -ItemType Directory -Force -Path ($copyDeep)
Copy-Item -Path ($IL2CPPdir + "*") -Destination ($copyDeep) -Recurse -Force
Copy-Item -Path ($dir + "\..\README.md") -Destination ($copyDeep) -Recurse -Force
Copy-Item -Path ($dir + "\..\LICENSE") -Destination ($copyDeep) -Recurse -Force
Compress-Archive -Path ($copy + "BepInEx") -Force -CompressionLevel "Optimal" -DestinationPath ($out + "RuntimeUnityEditor_BepInEx6.IL2CPP_v" + $ver + ".zip")

# UMM
Remove-Item -Force -Path ($copy) -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path ($copy)
Copy-Item -Path ($UMMdir+"*") -Destination ($copy) -Recurse -Force
Expand All @@ -30,4 +42,5 @@ $info.Version = $ver
$info | ConvertTo-Json | Set-Content ($copy+"Info.json")
Compress-Archive -Path ($copy+"*") -Force -CompressionLevel "Optimal" -DestinationPath ($out + "RuntimeUnityEditor_UMM_v" + $ver + ".zip")


Remove-Item -Force -Path ($copy) -Recurse -ErrorAction SilentlyContinue

0 comments on commit cf53689

Please sign in to comment.