@@ -99,7 +99,9 @@ class AndroidBuild extends JavaBuild {
99
99
static public final String target_sdk = "25" ; // Nougat (7.1.1)
100
100
static public final String target_platform = "android-" + target_sdk ;
101
101
102
- // Versions of Wear and VR in use
102
+ // Versions of Support, AppCompatn, Wear and VR in use
103
+ static public final String support_version = "25.2.0" ;
104
+ static public final String appcompat_version = "25.2.0" ;
103
105
static public final String wear_version = "2.0.0" ;
104
106
static public final String gvr_sdk_version = "1.20.0" ;
105
107
@@ -305,60 +307,37 @@ public File createProject(boolean wear) throws IOException, SketchException {
305
307
}
306
308
}
307
309
} catch (InterruptedException e ) {}
308
-
309
- if (getAppComponent () == FRAGMENT ) {
310
- // Need to add appcompat as a library project (includes v4 support)
311
-
312
- ////////////////////////////////////////////////////////////////////////
313
- // first step: copy appcompat library project
314
-
315
- // TODO: the support-v7 library project should be copied from the Android
316
- // Support Repository, and not from the Support Library.
317
- File appCompatFolderSrc = new File (sdk .getSupportLibrary (), "v7/appcompat" );
318
- // Delete the project.properties files because Processing will regenerate
319
- // it when building the project
320
- File propFile = new File (appCompatFolderSrc , "project.properties" );
321
- propFile .delete ();
322
- File appCompatFolder = new File (libsFolder , "appcompat" );
323
- Util .copyDir (appCompatFolderSrc , appCompatFolder );
324
-
325
- ////////////////////////////////////////////////////////////////////////
326
- // second step: create library projects
327
- boolean appCompatRes = createLibraryProject ("appcompat" , targetID ,
328
- appCompatFolder .getAbsolutePath (), "android.support.v7.appcompat" );
329
-
330
- ////////////////////////////////////////////////////////////////////////
331
- // third step: reference library projects from main project
332
- if (appCompatRes ) {
333
- System .out .println ("Library project created succesfully in " + libsFolder .toString ());
334
- appCompatRes = referenceLibraryProject (targetID , tmpFolder .getAbsolutePath (), "libs/appcompat" );
335
- if (appCompatRes ) {
336
- System .out .println ("Library project referenced succesfully!" );
337
- // Finally, re-write the build files so they use org.eclipse.jdt.core.JDTCompilerAdapter
338
- // instead of com.sun.tools.javac.Main
339
- // TODO: use the build file generated by the android tools, and
340
- // add the custom section redefining the target
341
- File appCompatBuildFile = new File (appCompatFolder , "build.xml" );
342
- writeBuildXML (appCompatBuildFile , "appcompat" );
343
- }
344
- }
345
- } else {
346
- // Copy the v4 support package only, needed for the permission handling
347
- // in all other components
348
- File compatJarFile = new File (sdk .getSupportLibrary (), "v4/android-support-v4.jar" );
349
- Util .copyFile (compatJarFile , new File (libsFolder , "android-support-v4.jar" ));
350
- }
351
310
352
- // if (getAppComponent() == WATCHFACE) {
311
+ File wearAarFile , explodeDir ;
312
+
353
313
// The wear jar is needed even when the app is not a watch face, because on
354
314
// devices with android < 5 the dependencies of the PWatchFace* classes
355
315
// cannot be resolved.
356
316
// TODO: temporary hack until I find a better way to include the wearable aar
357
317
// package included in the SDK:
358
- File wearAarFile = new File (sdk .getWearableFolder (), wear_version + "/wearable-" + wear_version + ".aar" );
359
- File explodeDir = new File (tmpFolder , "aar" );
360
- AndroidMode .explodeAar (wearAarFile , explodeDir , new File (libsFolder , "wearable-" + wear_version + ".jar" ));
361
- // }
318
+ wearAarFile = new File (sdk .getWearableFolder (), wear_version + "/wearable-" + wear_version + ".aar" );
319
+ explodeDir = new File (tmpFolder , "aar" );
320
+ AndroidMode .explodeAar (wearAarFile , explodeDir , new File (libsFolder , "wearable-" + wear_version + ".jar" ));
321
+
322
+ // Copy support packages (compat, fragment, and annotations)
323
+ wearAarFile = new File (sdk .getSupportLibrary (), "/support-compat/" + support_version + "/support-compat-" + support_version + ".aar" );
324
+ explodeDir = new File (tmpFolder , "aar" );
325
+ AndroidMode .explodeAar (wearAarFile , explodeDir , new File (libsFolder , "support-compat-" + support_version + ".jar" ));
326
+
327
+ wearAarFile = new File (sdk .getSupportLibrary (), "/support-fragment/" + support_version + "/support-fragment-" + support_version + ".aar" );
328
+ explodeDir = new File (tmpFolder , "aar" );
329
+ AndroidMode .explodeAar (wearAarFile , explodeDir , new File (libsFolder , "support-fragment-" + support_version + ".jar" ));
330
+
331
+ wearAarFile = new File (sdk .getSupportLibrary (), "/support-annotations/" + support_version + "/support-annotations-" + support_version + ".aar" );
332
+ explodeDir = new File (tmpFolder , "aar" );
333
+ AndroidMode .explodeAar (wearAarFile , explodeDir , new File (libsFolder , "support-annotations-" + support_version + ".jar" ));
334
+
335
+ if (getAppComponent () == FRAGMENT ) {
336
+ // Copy support appcompat-v7 package
337
+ wearAarFile = new File (sdk .getSupportLibrary (), "/appcompat-v7/" + support_version + "/appcompat-v7-" + appcompat_version + ".aar" );
338
+ explodeDir = new File (tmpFolder , "aar" );
339
+ AndroidMode .explodeAar (wearAarFile , explodeDir , new File (libsFolder , "appcompat-v7-" + appcompat_version + ".jar" ));
340
+ }
362
341
363
342
// Copy any imported libraries (their libs and assets),
364
343
// and anything in the code folder contents to the project.
0 commit comments