@@ -50,8 +50,10 @@ public enum ProjectBuildType
5050 new ( "Unity.IL2CPP" , "win-x64" ) ,
5151 new ( "Unity.IL2CPP" , "linux-x64" ) ,
5252 new ( "Unity.IL2CPP" , "macos-x64" ) ,
53- new ( "NET.Framework" , "win-x64" ) ,
54- new ( "NET.CoreCLR" , "win-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" )
5557 } ;
5658
5759
@@ -241,8 +243,12 @@ public override void Run(BuildContext ctx)
241243 ctx . CreateDirectory ( bepInExDir . Combine ( "patchers" ) ) ;
242244
243245 File . WriteAllText ( targetDir . CombineWithFilePath ( "changelog.txt" ) . FullPath , changelog ) ;
244- foreach ( var filePath in ctx . GetFiles ( ctx . OutputDirectory . Combine ( dist . DistributionIdentifier )
245- . Combine ( "*.*" ) . FullPath ) )
246+
247+ var sourceDirectory = ctx . OutputDirectory . Combine ( dist . DistributionIdentifier ) ;
248+ if ( dist . FrameworkTarget != null )
249+ sourceDirectory = sourceDirectory . Combine ( dist . FrameworkTarget ) ;
250+
251+ foreach ( var filePath in ctx . GetFiles ( sourceDirectory . Combine ( "*.*" ) . FullPath ) )
246252 ctx . CopyFileToDirectory ( filePath , bepInExCoreDir ) ;
247253
248254 if ( dist . Engine == "Unity" )
@@ -269,21 +275,24 @@ public override void Run(BuildContext ctx)
269275 {
270276 ctx . CopyFile ( ctx . CacheDirectory . Combine ( "dobby" ) . Combine ( $ "dobby_{ dist . Os } ") . CombineWithFilePath ( $ "{ dist . DllPrefix } dobby_{ dist . Arch } .{ dist . DllExtension } ") ,
271277 bepInExCoreDir . CombineWithFilePath ( $ "{ dist . DllPrefix } dobby.{ dist . DllExtension } ") ) ;
272- ctx . CopyDirectory ( ctx . CacheDirectory . Combine ( "dotnet" ) . Combine ( dist . RuntimeIndentifier ) ,
278+ ctx . CopyDirectory ( ctx . CacheDirectory . Combine ( "dotnet" ) . Combine ( dist . RuntimeIdentifier ) ,
273279 targetDir . Combine ( "dotnet" ) ) ;
274280 }
275281 }
276-
277- if ( dist . DistributionIdentifier == "NET.Framework" )
282+ else if ( dist . Engine == "NET" )
278283 {
279- ctx . DeleteFile ( bepInExCoreDir . CombineWithFilePath ( "BepInEx.NET.Framework.Launcher.exe.config" ) ) ;
280- foreach ( var filePath in ctx . GetFiles ( bepInExCoreDir . Combine ( "BepInEx.NET.*" ) . FullPath ) )
281- ctx . MoveFileToDirectory ( filePath , targetDir ) ;
282- }
284+ if ( dist . Runtime == "Framework" )
285+ {
286+ ctx . DeleteFile ( bepInExCoreDir . CombineWithFilePath ( "BepInEx.NET.Framework.Launcher.exe.config" ) ) ;
283287
284- if ( dist . DistributionIdentifier == "NET.CoreCLR" )
285- foreach ( var filePath in ctx . GetFiles ( bepInExCoreDir . Combine ( "BepInEx.NET.CoreCLR.*" ) . FullPath ) )
286- ctx . MoveFileToDirectory ( filePath , targetDir ) ;
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+ }
287296 }
288297 }
289298}
@@ -347,7 +356,7 @@ public override void Run(BuildContext ctx)
347356 {
348357 [ "file" ] = $ "BepInEx-{ d . Target } -{ ctx . BuildPackageVersion } .zip",
349358 [ "description" ] =
350- $ "BepInEx { d . Engine } ({ d . Runtime } ) for { d . ClearOsName } ({ d . Arch } ) games"
359+ $ "BepInEx { d . Engine } ({ d . Runtime } { ( d . FrameworkTarget == null ? "" : " " + d . FrameworkTarget ) } ) for { d . ClearOsName } ({ d . Arch } ) games"
351360 } ) . ToArray ( )
352361 } ) ;
353362 }
0 commit comments