@@ -32,27 +32,18 @@ public class Build : EditorWindow
3232 public static void DoBuildAndroidLibraryDebug ( )
3333 {
3434 DoBuildAndroid ( Path . Combine ( APKPath , "unityLibrary" ) , false , false ) ;
35-
36- // Copy over resources from the launcher module that are used by the library
37- Copy ( Path . Combine ( APKPath + "/launcher/src/main/res" ) , Path . Combine ( AndroidExportPath , "src/main/res" ) ) ;
3835 }
3936
4037 [ MenuItem ( "Flutter/Export Android (Release) %&m" , false , 102 ) ]
4138 public static void DoBuildAndroidLibraryRelease ( )
4239 {
4340 DoBuildAndroid ( Path . Combine ( APKPath , "unityLibrary" ) , false , true ) ;
44-
45- // Copy over resources from the launcher module that are used by the library
46- Copy ( Path . Combine ( APKPath + "/launcher/src/main/res" ) , Path . Combine ( AndroidExportPath , "src/main/res" ) ) ;
4741 }
4842
4943 [ MenuItem ( "Flutter/Export Android Plugin %&p" , false , 103 ) ]
5044 public static void DoBuildAndroidPlugin ( )
5145 {
5246 DoBuildAndroid ( Path . Combine ( APKPath , "unityLibrary" ) , true , true ) ;
53-
54- // Copy over resources from the launcher module that are used by the library
55- Copy ( Path . Combine ( APKPath + "/launcher/src/main/res" ) , Path . Combine ( AndroidExportPath , "src/main/res" ) ) ;
5647 }
5748
5849 [ MenuItem ( "Flutter/Export IOS (Debug) %&i" , false , 201 ) ]
@@ -238,6 +229,9 @@ private static void DoBuildAndroid(String buildPath, bool isPlugin, bool isRelea
238229 SetupAndroidProject ( ) ;
239230 }
240231
232+ // Copy over resources from the launcher module that are used by the library, Avoid deleting the existing src/main/res contents.
233+ Copy ( Path . Combine ( APKPath + "/launcher/src/main/res" ) , Path . Combine ( AndroidExportPath , "src/main/res" ) , false ) ;
234+
241235 if ( isReleaseBuild ) {
242236 Debug . Log ( $ "-- Android Release Build: SUCCESSFUL --") ;
243237 } else
@@ -458,9 +452,9 @@ private static void BuildIOS(String path, bool isReleaseBuild)
458452
459453
460454 //#region Other Member Methods
461- private static void Copy ( string source , string destinationPath )
455+ private static void Copy ( string source , string destinationPath , bool clearDestination = true )
462456 {
463- if ( Directory . Exists ( destinationPath ) )
457+ if ( clearDestination && Directory . Exists ( destinationPath ) )
464458 Directory . Delete ( destinationPath , true ) ;
465459
466460 Directory . CreateDirectory ( destinationPath ) ;
0 commit comments