@@ -29,31 +29,14 @@ public enum ProjectBuildType
2929 {
3030 Release ,
3131 Development ,
32- BleedingEdge
32+ BleedingEdge ,
33+ Starlight
3334 }
3435
35- public const string DoorstopVersion = "4.3.0" ;
36- public const string DotnetRuntimeVersion = "6.0.7" ;
37- public const string DobbyVersion = "1.0.5" ;
38-
39- public const string DotnetRuntimeZipUrl =
40- $ "https://github.com/BepInEx/dotnet-runtime/releases/download/{ DotnetRuntimeVersion } /mini-coreclr-Release.zip";
41-
4236 internal readonly DistributionTarget [ ] Distributions =
4337 {
44- new ( "Unity.Mono" , "win-x86" ) ,
45- new ( "Unity.Mono" , "win-x64" ) ,
46- new ( "Unity.Mono" , "linux-x86" ) ,
47- new ( "Unity.Mono" , "linux-x64" ) ,
48- new ( "Unity.Mono" , "macos-x64" ) ,
49- new ( "Unity.IL2CPP" , "win-x86" ) ,
50- new ( "Unity.IL2CPP" , "win-x64" ) ,
51- new ( "Unity.IL2CPP" , "linux-x64" ) ,
52- new ( "Unity.IL2CPP" , "macos-x64" ) ,
53- new ( "NET.Framework" , "win-x86" , "net40" ) ,
54- new ( "NET.Framework" , "win-x86" , "net452" ) ,
55- new ( "NET.CoreCLR" , "win-x64" , "netcoreapp3.1" ) ,
56- new ( "NET.CoreCLR" , "win-x64" , "net6.0" )
38+ new ( "Unity.IL2CPP" , "android-arm64" ) ,
39+ new ( "Unity.IL2CPP" , "android-arm" ) ,
5740 } ;
5841
5942
@@ -104,12 +87,6 @@ public BuildContext(ICakeContext ctx)
10487 ProjectBuildType . Release => "" ,
10588 var _ => $ "-{ VersionSuffix } +{ this . GitShortenSha ( RootDirectory , CurrentCommit ) } ",
10689 } ;
107-
108- public static string DoorstopZipUrl ( string arch ) =>
109- $ "https://github.com/NeighTools/UnityDoorstop/releases/download/v{ DoorstopVersion } /doorstop_{ arch } _release_{ DoorstopVersion } .zip";
110-
111- public static string DobbyZipUrl ( string arch ) =>
112- $ "https://github.com/BepInEx/Dobby/releases/download/v{ DobbyVersion } /dobby-{ arch } .zip";
11390}
11491
11592[ TaskName ( "Clean" ) ]
@@ -154,61 +131,8 @@ public override void Run(BuildContext ctx)
154131 }
155132}
156133
157- [ TaskName ( "DownloadDependencies" ) ]
158- public sealed class DownloadDependenciesTask : FrostingTask < BuildContext >
159- {
160- public override void Run ( BuildContext ctx )
161- {
162- ctx . Log . Information ( "Downloading dependencies" ) ;
163- ctx . CreateDirectory ( ctx . CacheDirectory ) ;
164-
165- var cache = new DependencyCache ( ctx , ctx . CacheDirectory . CombineWithFilePath ( "cache.json" ) ) ;
166-
167- cache . Refresh ( "NeighTools/UnityDoorstop" , BuildContext . DoorstopVersion , ( ) =>
168- {
169- ctx . Log . Information ( $ "Downloading Doorstop { BuildContext . DoorstopVersion } ") ;
170- var doorstopDir = ctx . CacheDirectory . Combine ( "doorstop" ) ;
171- ctx . CreateDirectory ( doorstopDir ) ;
172- ctx . CleanDirectory ( doorstopDir ) ;
173- var archs = new [ ] { "win" , "linux" , "macos" } ;
174- var versions = archs
175- . Select ( a => ( $ "Doorstop ({ a } )",
176- BuildContext . DoorstopZipUrl ( a ) ,
177- doorstopDir . Combine ( $ "doorstop_{ a } ") ) )
178- . ToArray ( ) ;
179- ctx . DownloadZipFiles ( $ "Doorstop { BuildContext . DoorstopVersion } ", versions ) ;
180- } ) ;
181-
182- cache . Refresh ( "BepInEx/Dobby" , BuildContext . DobbyVersion , ( ) =>
183- {
184- ctx . Log . Information ( $ "Downloading Dobby { BuildContext . DobbyVersion } ") ;
185- var dobbyDir = ctx . CacheDirectory . Combine ( "dobby" ) ;
186- ctx . CreateDirectory ( dobbyDir ) ;
187- ctx . CleanDirectory ( dobbyDir ) ;
188- var archs = new [ ] { "win" , "linux" , "macos" } ;
189- var versions = archs
190- . Select ( a => ( $ "Dobby ({ a } )", BuildContext . DobbyZipUrl ( a ) , dobbyDir . Combine ( $ "dobby_{ a } ") ) )
191- . ToArray ( ) ;
192- ctx . DownloadZipFiles ( $ "Dobby { BuildContext . DobbyVersion } ", versions ) ;
193- } ) ;
194-
195- cache . Refresh ( "BepInEx/dotnet_runtime" , BuildContext . DotnetRuntimeVersion , ( ) =>
196- {
197- ctx . Log . Information ( $ "Downloading dotnet runtime { BuildContext . DotnetRuntimeVersion } ") ;
198- var dotnetDir = ctx . CacheDirectory . Combine ( "dotnet" ) ;
199- ctx . CreateDirectory ( dotnetDir ) ;
200- ctx . CleanDirectory ( dotnetDir ) ;
201- ctx . DownloadZipFiles ( $ "dotnet-runtime { BuildContext . DotnetRuntimeVersion } ",
202- ( "dotnet runtime" , BuildContext . DotnetRuntimeZipUrl , dotnetDir ) ) ;
203- } ) ;
204-
205- cache . Save ( ) ;
206- }
207- }
208-
209134[ TaskName ( "MakeDist" ) ]
210135[ IsDependentOn ( typeof ( CompileTask ) ) ]
211- [ IsDependentOn ( typeof ( DownloadDependenciesTask ) ) ]
212136public sealed class MakeDistTask : FrostingTask < BuildContext >
213137{
214138 public override void Run ( BuildContext ctx )
@@ -250,49 +174,6 @@ public override void Run(BuildContext ctx)
250174
251175 foreach ( var filePath in ctx . GetFiles ( sourceDirectory . Combine ( "*.*" ) . FullPath ) )
252176 ctx . CopyFileToDirectory ( filePath , bepInExCoreDir ) ;
253-
254- if ( dist . Engine == "Unity" )
255- {
256- var doorstopPath =
257- ctx . CacheDirectory . Combine ( "doorstop" ) . Combine ( $ "doorstop_{ dist . Os } ") . Combine ( dist . Arch ) ;
258- foreach ( var filePath in ctx . GetFiles ( doorstopPath . Combine ( $ "*.{ dist . DllExtension } ") . FullPath ) )
259- ctx . CopyFileToDirectory ( filePath , targetDir ) ;
260- ctx . CopyFileToDirectory ( doorstopPath . CombineWithFilePath ( ".doorstop_version" ) , targetDir ) ;
261- var ( doorstopConfigFile , doorstopConfigDistName ) = dist . Os switch
262- {
263- "win" => ( $ "doorstop_config_{ dist . Runtime . ToLower ( ) } .ini",
264- "doorstop_config.ini" ) ,
265- "linux" or "macos" => ( $ "run_bepinex_{ dist . Runtime . ToLower ( ) } .sh",
266- "run_bepinex.sh" ) ,
267- var _ => throw new
268- NotSupportedException (
269- $ "Doorstop is not supported on { dist . Os } ")
270- } ;
271- ctx . CopyFile ( ctx . RootDirectory . Combine ( "Runtimes" ) . Combine ( "Unity" ) . Combine ( "Doorstop" ) . CombineWithFilePath ( doorstopConfigFile ) ,
272- targetDir . CombineWithFilePath ( doorstopConfigDistName ) ) ;
273-
274- if ( dist . Runtime == "IL2CPP" )
275- {
276- ctx . CopyFile ( ctx . CacheDirectory . Combine ( "dobby" ) . Combine ( $ "dobby_{ dist . Os } ") . CombineWithFilePath ( $ "{ dist . DllPrefix } dobby_{ dist . Arch } .{ dist . DllExtension } ") ,
277- bepInExCoreDir . CombineWithFilePath ( $ "{ dist . DllPrefix } dobby.{ dist . DllExtension } ") ) ;
278- ctx . CopyDirectory ( ctx . CacheDirectory . Combine ( "dotnet" ) . Combine ( dist . RuntimeIdentifier ) ,
279- targetDir . Combine ( "dotnet" ) ) ;
280- }
281- }
282- else if ( dist . Engine == "NET" )
283- {
284- if ( dist . Runtime == "Framework" )
285- {
286- ctx . DeleteFile ( bepInExCoreDir . CombineWithFilePath ( "BepInEx.NET.Framework.Launcher.exe.config" ) ) ;
287-
288- ctx . MoveFileToDirectory ( bepInExCoreDir . CombineWithFilePath ( "BepInEx.NET.Framework.Launcher.exe" ) , targetDir ) ;
289- }
290- else if ( dist . Runtime == "CoreCLR" )
291- {
292- foreach ( var filePath in ctx . GetFiles ( bepInExCoreDir . Combine ( "BepInEx.NET.CoreCLR.*" ) . FullPath ) )
293- ctx . MoveFileToDirectory ( filePath , targetDir ) ;
294- }
295- }
296177 }
297178 }
298179}
0 commit comments