@TaskAction void generate() throws IOException, ProcessException, LoggedErrorException, InterruptedException { // always empty output dir. File outDir = getResOutputDir(); emptyFolder(outDir); File apk = getApkFile(); // copy the file into the destination, by sanitizing the name first. File rawDir = new File(outDir, FD_RES_RAW); rawDir.mkdirs(); File to = new File(rawDir, ANDROID_WEAR_MICRO_APK + DOT_ANDROID_PACKAGE); Files.copy(apk, to); // now create the matching XML and the manifest entry. AndroidBuilder builder = getBuilder(); builder.generateApkData(apk, outDir, getMainPkgName(), ANDROID_WEAR_MICRO_APK); AndroidBuilder.generateApkDataEntryInManifest(getMinSdkVersion(), getTargetSdkVersion(), getManifestFile()); }
@TaskAction void generate() throws IOException, ProcessException, LoggedErrorException, InterruptedException { AndroidBuilder builder = getBuilder(); // always empty output dir. File outDir = getResOutputDir(); FileUtils.cleanOutputDir(outDir); File apk = getApkFile(); if (apk != null) { // copy the file into the destination, by sanitizing the name first. File rawDir = new File(outDir, FD_RES_RAW); FileUtils.mkdirs(rawDir); File to = new File(rawDir, ANDROID_WEAR_MICRO_APK + DOT_ANDROID_PACKAGE); Files.copy(apk, to); builder.generateApkData(apk, outDir, getMainPkgName(), ANDROID_WEAR_MICRO_APK); } else { builder.generateUnbundledWearApkData(outDir, getMainPkgName()); } AndroidBuilder.generateApkDataEntryInManifest(getMinSdkVersion(), getTargetSdkVersion(), getManifestFile()); }