31
31
import processing .app .Preferences ;
32
32
import processing .app .Sketch ;
33
33
import processing .app .SketchException ;
34
+ import processing .app .Util ;
34
35
import processing .app .exec .ProcessHelper ;
35
36
import processing .app .exec .ProcessResult ;
36
37
import processing .core .PApplet ;
@@ -178,7 +179,7 @@ public File createProject() throws IOException, SketchException {
178
179
179
180
// InputStream input = PApplet.createInput(getCoreZipLocation());
180
181
// PApplet.saveStream(new File(libsFolder, "processing-core.jar"), input);
181
- Base .copyFile (coreZipFile , new File (libsFolder , "processing-core.jar" ));
182
+ Util .copyFile (coreZipFile , new File (libsFolder , "processing-core.jar" ));
182
183
183
184
// Copy any imported libraries (their libs and assets),
184
185
// and anything in the code folder contents to the project.
@@ -188,14 +189,14 @@ public File createProject() throws IOException, SketchException {
188
189
// Copy the data folder (if one exists) to the project's 'assets' folder
189
190
final File sketchDataFolder = sketch .getDataFolder ();
190
191
if (sketchDataFolder .exists ()) {
191
- Base .copyDir (sketchDataFolder , assetsFolder );
192
+ Util .copyDir (sketchDataFolder , assetsFolder );
192
193
}
193
194
194
195
// Do the same for the 'res' folder.
195
196
// http://code.google.com/p/processing/issues/detail?id=767
196
197
final File sketchResFolder = new File (sketch .getFolder (), "res" );
197
198
if (sketchResFolder .exists ()) {
198
- Base .copyDir (sketchResFolder , resFolder );
199
+ Util .copyDir (sketchResFolder , resFolder );
199
200
}
200
201
}
201
202
return tmpFolder ;
@@ -282,7 +283,7 @@ public File exportProject() throws IOException, SketchException {
282
283
File projectFolder = createProject ();
283
284
if (projectFolder != null ) {
284
285
File exportFolder = createExportFolder ();
285
- Base .copyDir (projectFolder , exportFolder );
286
+ Util .copyDir (projectFolder , exportFolder );
286
287
return exportFolder ;
287
288
}
288
289
return null ;
@@ -296,7 +297,7 @@ public File exportPackage(String keyStorePassword) throws Exception {
296
297
if (signedPackage == null ) return null ;
297
298
298
299
File exportFolder = createExportFolder ();
299
- Base .copyDir (projectFolder , exportFolder );
300
+ Util .copyDir (projectFolder , exportFolder );
300
301
return new File (exportFolder , "/bin/" );
301
302
}
302
303
@@ -789,22 +790,22 @@ private void writeRes(File resFolder,
789
790
try {
790
791
// if no icons are in the sketch folder, then copy all the defaults
791
792
if (buildIcon36 .getParentFile ().mkdirs ()) {
792
- Base .copyFile (mode .getContentFile ("icons/" + ICON_36 ), buildIcon36 );
793
+ Util .copyFile (mode .getContentFile ("icons/" + ICON_36 ), buildIcon36 );
793
794
} else {
794
795
System .err .println ("Could not create \" drawable-ldpi\" folder." );
795
796
}
796
797
if (buildIcon48 .getParentFile ().mkdirs ()) {
797
- Base .copyFile (mode .getContentFile ("icons/" + ICON_48 ), buildIcon48 );
798
+ Util .copyFile (mode .getContentFile ("icons/" + ICON_48 ), buildIcon48 );
798
799
} else {
799
800
System .err .println ("Could not create \" drawable\" folder." );
800
801
}
801
802
if (buildIcon72 .getParentFile ().mkdirs ()) {
802
- Base .copyFile (mode .getContentFile ("icons/" + ICON_72 ), buildIcon72 );
803
+ Util .copyFile (mode .getContentFile ("icons/" + ICON_72 ), buildIcon72 );
803
804
} else {
804
805
System .err .println ("Could not create \" drawable-hdpi\" folder." );
805
806
}
806
807
if (buildIcon96 .getParentFile ().mkdirs ()) {
807
- Base .copyFile (mode .getContentFile ("icons/" + ICON_96 ), buildIcon96 );
808
+ Util .copyFile (mode .getContentFile ("icons/" + ICON_96 ), buildIcon96 );
808
809
} else {
809
810
System .err .println ("Could not create \" drawable-xhdpi\" folder." );
810
811
}
@@ -817,22 +818,22 @@ private void writeRes(File resFolder,
817
818
try {
818
819
if (localIcon36 .exists ()) {
819
820
if (new File (resFolder , "drawable-ldpi" ).mkdirs ()) {
820
- Base .copyFile (localIcon36 , buildIcon36 );
821
+ Util .copyFile (localIcon36 , buildIcon36 );
821
822
}
822
823
}
823
824
if (localIcon48 .exists ()) {
824
825
if (new File (resFolder , "drawable" ).mkdirs ()) {
825
- Base .copyFile (localIcon48 , buildIcon48 );
826
+ Util .copyFile (localIcon48 , buildIcon48 );
826
827
}
827
828
}
828
829
if (localIcon72 .exists ()) {
829
830
if (new File (resFolder , "drawable-hdpi" ).mkdirs ()) {
830
- Base .copyFile (localIcon72 , buildIcon72 );
831
+ Util .copyFile (localIcon72 , buildIcon72 );
831
832
}
832
833
}
833
834
if (localIcon96 .exists ()) {
834
835
if (new File (resFolder , "drawable-xhdpi" ).mkdirs ()) {
835
- Base .copyFile (localIcon96 , buildIcon96 );
836
+ Util .copyFile (localIcon96 , buildIcon96 );
836
837
}
837
838
}
838
839
} catch (IOException e ) {
@@ -903,24 +904,24 @@ private void copyLibraries(final File libsFolder,
903
904
if (exportName .equals ("armeabi" ) ||
904
905
exportName .equals ("armeabi-v7a" ) ||
905
906
exportName .equals ("x86" )) {
906
- Base .copyDir (exportFile , new File (libsFolder , exportName ));
907
+ Util .copyDir (exportFile , new File (libsFolder , exportName ));
907
908
} else {
908
909
// Copy any other directory to the assets folder
909
- Base .copyDir (exportFile , new File (assetsFolder , exportName ));
910
+ Util .copyDir (exportFile , new File (assetsFolder , exportName ));
910
911
}
911
912
} else if (exportName .toLowerCase ().endsWith (".zip" )) {
912
913
// As of r4 of the Android SDK, it looks like .zip files
913
914
// are ignored in the libs folder, so rename to .jar
914
915
System .err .println (".zip files are not allowed in Android libraries." );
915
916
System .err .println ("Please rename " + exportFile .getName () + " to be a .jar file." );
916
917
String jarName = exportName .substring (0 , exportName .length () - 4 ) + ".jar" ;
917
- Base .copyFile (exportFile , new File (libsFolder , jarName ));
918
+ Util .copyFile (exportFile , new File (libsFolder , jarName ));
918
919
919
920
} else if (exportName .toLowerCase ().endsWith (".jar" )) {
920
- Base .copyFile (exportFile , new File (libsFolder , exportName ));
921
+ Util .copyFile (exportFile , new File (libsFolder , exportName ));
921
922
922
923
} else {
923
- Base .copyFile (exportFile , new File (assetsFolder , exportName ));
924
+ Util .copyFile (exportFile , new File (assetsFolder , exportName ));
924
925
}
925
926
}
926
927
}
@@ -983,7 +984,7 @@ private void copyCodeFolder(final File libsFolder) throws IOException {
983
984
final String lcname = name .toLowerCase ();
984
985
if (lcname .endsWith (".jar" ) || lcname .endsWith (".zip" )) {
985
986
String jarName = name .substring (0 , name .length () - 4 ) + ".jar" ;
986
- Base .copyFile (item , new File (libsFolder , jarName ));
987
+ Util .copyFile (item , new File (libsFolder , jarName ));
987
988
}
988
989
}
989
990
}
0 commit comments