31
31
import processing .app .Library ;
32
32
import processing .app .Messages ;
33
33
import processing .app .Platform ;
34
+ import processing .app .Preferences ;
34
35
import processing .app .Sketch ;
35
36
import processing .app .SketchException ;
36
37
import processing .app .Util ;
@@ -94,7 +95,6 @@ class AndroidBuild extends JavaBuild {
94
95
static public final String wear_version = "2.0.0" ;
95
96
static public final String gvr_sdk_version = "1.10.0" ;
96
97
97
-
98
98
private boolean runOnEmulator = false ;
99
99
private int appComponent = FRAGMENT ;
100
100
private boolean rewriteManifest = false ;
@@ -751,6 +751,12 @@ public File exportProject() throws IOException, SketchException {
751
751
// this will set debuggable to true in the .xml file
752
752
target = "debug" ;
753
753
754
+ String buildSystem = Preferences .get ("android.build.system" );
755
+ if (buildSystem == null ) {
756
+ buildSystem = "gradle" ;
757
+ Preferences .set ("android.build.system" , buildSystem );
758
+ }
759
+
754
760
if (appComponent == WATCHFACE ) {
755
761
// We are building a watchface not to run on the emulator. We need the
756
762
// handheld app:
@@ -761,15 +767,24 @@ public File exportProject() throws IOException, SketchException {
761
767
File projectFolder = createHandheldProject (wearFolder , null );
762
768
if (projectFolder != null ) {
763
769
File exportFolder = createExportFolder ();
764
- Util .copyDir (projectFolder , exportFolder );
770
+ if (buildSystem .equals ("gradle" )) {
771
+ createGradleProject (projectFolder , exportFolder );
772
+ } else { // ant
773
+ Util .copyDir (projectFolder , exportFolder );
774
+ }
765
775
return exportFolder ;
766
776
}
767
777
return null ;
768
778
} else {
769
779
File projectFolder = createProject (false );
770
780
if (projectFolder != null ) {
771
781
File exportFolder = createExportFolder ();
772
- Util .copyDir (projectFolder , exportFolder );
782
+ if (buildSystem .equals ("gradle" )) {
783
+ createGradleProject (projectFolder , exportFolder );
784
+ } else { // ant
785
+ Util .copyDir (
786
+ projectFolder , exportFolder );
787
+ }
773
788
return exportFolder ;
774
789
}
775
790
return null ;
@@ -1496,6 +1511,11 @@ public void cleanup() {
1496
1511
}
1497
1512
1498
1513
1514
+ protected void createGradleProject (File projectFolder , File exportFolder ) {
1515
+
1516
+ }
1517
+
1518
+
1499
1519
// Some leftovers from earlier versions of the mode, probably should remove at some point...
1500
1520
/*
1501
1521
// SDK tools 17 have a problem where 'dex' won't pick up the libs folder
0 commit comments