@@ -32,27 +32,18 @@ public class Build : EditorWindow
32
32
public static void DoBuildAndroidLibraryDebug ( )
33
33
{
34
34
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" ) ) ;
38
35
}
39
36
40
37
[ MenuItem ( "Flutter/Export Android (Release) %&m" , false , 102 ) ]
41
38
public static void DoBuildAndroidLibraryRelease ( )
42
39
{
43
40
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" ) ) ;
47
41
}
48
42
49
43
[ MenuItem ( "Flutter/Export Android Plugin %&p" , false , 103 ) ]
50
44
public static void DoBuildAndroidPlugin ( )
51
45
{
52
46
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" ) ) ;
56
47
}
57
48
58
49
[ MenuItem ( "Flutter/Export IOS (Debug) %&i" , false , 201 ) ]
@@ -238,6 +229,9 @@ private static void DoBuildAndroid(String buildPath, bool isPlugin, bool isRelea
238
229
SetupAndroidProject ( ) ;
239
230
}
240
231
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
+
241
235
if ( isReleaseBuild ) {
242
236
Debug . Log ( $ "-- Android Release Build: SUCCESSFUL --") ;
243
237
} else
@@ -458,9 +452,9 @@ private static void BuildIOS(String path, bool isReleaseBuild)
458
452
459
453
460
454
//#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 )
462
456
{
463
- if ( Directory . Exists ( destinationPath ) )
457
+ if ( clearDestination && Directory . Exists ( destinationPath ) )
464
458
Directory . Delete ( destinationPath , true ) ;
465
459
466
460
Directory . CreateDirectory ( destinationPath ) ;
0 commit comments