From 20d9fe541ca0d50a595e15236d9452c0c087da96 Mon Sep 17 00:00:00 2001 From: H1Gdev Date: Tue, 4 Sep 2018 14:26:08 +0900 Subject: [PATCH] Android tutorials: Run 'android-tutorial-1' error on Android Studio If Run 'android-tutorial-1' on Android Studio then property 'compileReleaseJavaWithJavac' does not exist. So add property 'compileReleaseJavaWithJavac' check. Fix android-tutorial-1 - android-tutorial-5. https://bugzilla.gnome.org/show_bug.cgi?id=797070 and Replace indent from tab to space. --- .../tutorials/android/android-tutorial-1/build.gradle | 10 ++++++---- .../tutorials/android/android-tutorial-2/build.gradle | 10 ++++++---- .../tutorials/android/android-tutorial-3/build.gradle | 10 ++++++---- .../tutorials/android/android-tutorial-4/build.gradle | 10 ++++++---- .../tutorials/android/android-tutorial-5/build.gradle | 10 ++++++---- 5 files changed, 30 insertions(+), 20 deletions(-) diff --git a/examples/tutorials/android/android-tutorial-1/build.gradle b/examples/tutorials/android/android-tutorial-1/build.gradle index 32265afc19..33bac31fbb 100644 --- a/examples/tutorials/android/android-tutorial-1/build.gradle +++ b/examples/tutorials/android/android-tutorial-1/build.gradle @@ -39,10 +39,10 @@ android { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - sourceSets { + sourceSets { main { manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = ['src'] + java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] @@ -61,8 +61,10 @@ android { } afterEvaluate { - compileDebugJavaWithJavac.dependsOn 'externalNativeBuildDebug' - compileReleaseJavaWithJavac.dependsOn 'externalNativeBuildRelease' + if (project.hasProperty('compileDebugJavaWithJavac')) + project.compileDebugJavaWithJavac.dependsOn 'externalNativeBuildDebug' + if (project.hasProperty('compileReleaseJavaWithJavac')) + project.compileReleaseJavaWithJavac.dependsOn 'externalNativeBuildRelease' } dependencies { diff --git a/examples/tutorials/android/android-tutorial-2/build.gradle b/examples/tutorials/android/android-tutorial-2/build.gradle index 1cc6177ed0..0fff221ce9 100644 --- a/examples/tutorials/android/android-tutorial-2/build.gradle +++ b/examples/tutorials/android/android-tutorial-2/build.gradle @@ -39,10 +39,10 @@ android { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - sourceSets { + sourceSets { main { manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = ['src'] + java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] @@ -61,8 +61,10 @@ android { } afterEvaluate { - compileDebugJavaWithJavac.dependsOn 'externalNativeBuildDebug' - compileReleaseJavaWithJavac.dependsOn 'externalNativeBuildRelease' + if (project.hasProperty('compileDebugJavaWithJavac')) + project.compileDebugJavaWithJavac.dependsOn 'externalNativeBuildDebug' + if (project.hasProperty('compileReleaseJavaWithJavac')) + project.compileReleaseJavaWithJavac.dependsOn 'externalNativeBuildRelease' } dependencies { diff --git a/examples/tutorials/android/android-tutorial-3/build.gradle b/examples/tutorials/android/android-tutorial-3/build.gradle index d16848ab73..ea318bc053 100644 --- a/examples/tutorials/android/android-tutorial-3/build.gradle +++ b/examples/tutorials/android/android-tutorial-3/build.gradle @@ -39,10 +39,10 @@ android { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - sourceSets { + sourceSets { main { manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = ['src'] + java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] @@ -61,8 +61,10 @@ android { } afterEvaluate { - compileDebugJavaWithJavac.dependsOn 'externalNativeBuildDebug' - compileReleaseJavaWithJavac.dependsOn 'externalNativeBuildRelease' + if (project.hasProperty('compileDebugJavaWithJavac')) + project.compileDebugJavaWithJavac.dependsOn 'externalNativeBuildDebug' + if (project.hasProperty('compileReleaseJavaWithJavac')) + project.compileReleaseJavaWithJavac.dependsOn 'externalNativeBuildRelease' } dependencies { diff --git a/examples/tutorials/android/android-tutorial-4/build.gradle b/examples/tutorials/android/android-tutorial-4/build.gradle index 36a3e38189..d068277936 100644 --- a/examples/tutorials/android/android-tutorial-4/build.gradle +++ b/examples/tutorials/android/android-tutorial-4/build.gradle @@ -39,10 +39,10 @@ android { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - sourceSets { + sourceSets { main { manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = ['src'] + java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] @@ -61,8 +61,10 @@ android { } afterEvaluate { - compileDebugJavaWithJavac.dependsOn 'externalNativeBuildDebug' - compileReleaseJavaWithJavac.dependsOn 'externalNativeBuildRelease' + if (project.hasProperty('compileDebugJavaWithJavac')) + project.compileDebugJavaWithJavac.dependsOn 'externalNativeBuildDebug' + if (project.hasProperty('compileReleaseJavaWithJavac')) + project.compileReleaseJavaWithJavac.dependsOn 'externalNativeBuildRelease' } dependencies { diff --git a/examples/tutorials/android/android-tutorial-5/build.gradle b/examples/tutorials/android/android-tutorial-5/build.gradle index 136e2c3ccb..e18fb2f0b2 100644 --- a/examples/tutorials/android/android-tutorial-5/build.gradle +++ b/examples/tutorials/android/android-tutorial-5/build.gradle @@ -39,10 +39,10 @@ android { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - sourceSets { + sourceSets { main { manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = ['src'] + java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] @@ -61,8 +61,10 @@ android { } afterEvaluate { - compileDebugJavaWithJavac.dependsOn 'externalNativeBuildDebug' - compileReleaseJavaWithJavac.dependsOn 'externalNativeBuildRelease' + if (project.hasProperty('compileDebugJavaWithJavac')) + project.compileDebugJavaWithJavac.dependsOn 'externalNativeBuildDebug' + if (project.hasProperty('compileReleaseJavaWithJavac')) + project.compileReleaseJavaWithJavac.dependsOn 'externalNativeBuildRelease' } dependencies {