From ee2a97dbf613a21fc39958e4c238d7135ecded3e Mon Sep 17 00:00:00 2001 From: Zongle Wang Date: Fri, 14 Jun 2024 06:07:39 -0400 Subject: [PATCH 1/2] Speed up CI - Enable KVM on Ubuntu. https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners - Use gradle/actions/setup-gradle to cache Gradle https://github.com/gradle/actions/tree/main/setup-gradle --- .github/workflows/AccessibilityCodelab.yaml | 15 ++----- .../AdvancedStateAndSideEffectsCodelab.yaml | 34 ++++++---------- .github/workflows/AnimationCodelab.yaml | 15 ++----- .github/workflows/BasicLayoutsCodelab.yaml | 15 ++----- .github/workflows/BasicStateCodelab.yaml | 15 ++----- .github/workflows/BasicsCodelab.yaml | 15 ++----- .github/workflows/MigrationCodelab.yaml | 36 +++++++---------- .github/workflows/NavigationCodelab.yaml | 13 ++---- .github/workflows/TestingCodelab.yaml | 13 ++---- .github/workflows/ThemingCodelab.yaml | 15 ++----- scripts/checksum.sh | 40 ------------------- 11 files changed, 57 insertions(+), 169 deletions(-) delete mode 100755 scripts/checksum.sh diff --git a/.github/workflows/AccessibilityCodelab.yaml b/.github/workflows/AccessibilityCodelab.yaml index d473adcac..6d708be32 100644 --- a/.github/workflows/AccessibilityCodelab.yaml +++ b/.github/workflows/AccessibilityCodelab.yaml @@ -7,9 +7,11 @@ on: - end paths: - 'AccessibilityCodelab/**' + - '.github/workflows/AccessibilityCodelab.yaml' pull_request: paths: - 'AccessibilityCodelab/**' + - '.github/workflows/AccessibilityCodelab.yaml' env: SAMPLE_PATH: AccessibilityCodelab @@ -24,7 +26,7 @@ jobs: uses: actions/checkout@v4 - name: Copy CI gradle.properties - run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties + run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - name: Set up JDK 17 uses: actions/setup-java@v4 @@ -32,16 +34,7 @@ jobs: distribution: 'zulu' java-version: 17 - - name: Generate cache key - run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt - - - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: gradle-${{ hashFiles('checksum.txt') }} + - uses: gradle/actions/setup-gradle@v3 - name: Build project working-directory: ${{ env.SAMPLE_PATH }} diff --git a/.github/workflows/AdvancedStateAndSideEffectsCodelab.yaml b/.github/workflows/AdvancedStateAndSideEffectsCodelab.yaml index d8d89ce64..685f71f73 100644 --- a/.github/workflows/AdvancedStateAndSideEffectsCodelab.yaml +++ b/.github/workflows/AdvancedStateAndSideEffectsCodelab.yaml @@ -6,9 +6,11 @@ on: - main paths: - 'AdvancedStateAndSideEffectsCodelab/**' + - '.github/workflows/AdvancedStateAndSideEffectsCodelab.yaml' pull_request: paths: - 'AdvancedStateAndSideEffectsCodelab/**' + - '.github/workflows/AdvancedStateAndSideEffectsCodelab.yaml' env: SAMPLE_PATH: AdvancedStateAndSideEffectsCodelab @@ -31,16 +33,7 @@ jobs: distribution: 'zulu' java-version: 17 - - name: Generate cache key - run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt - - - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: gradle-${{ hashFiles('checksum.txt') }} + - uses: gradle/actions/setup-gradle@v3 - name: Build project working-directory: ${{ env.SAMPLE_PATH }} @@ -61,13 +54,21 @@ jobs: test: needs: build - runs-on: macos-13 + runs-on: ubuntu-latest timeout-minutes: 30 strategy: matrix: api-level: [26, 29] steps: + # https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners + - name: Enable KVM group perms + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + ls /dev/kvm + - name: Checkout uses: actions/checkout@v4 @@ -80,16 +81,7 @@ jobs: distribution: 'zulu' java-version: 17 - - name: Generate cache key - run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt - - - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: gradle-${{ hashFiles('checksum.txt') }} + - uses: gradle/actions/setup-gradle@v3 - name: Run instrumentation tests uses: reactivecircus/android-emulator-runner@v2 diff --git a/.github/workflows/AnimationCodelab.yaml b/.github/workflows/AnimationCodelab.yaml index 8de6de50b..1b375a492 100644 --- a/.github/workflows/AnimationCodelab.yaml +++ b/.github/workflows/AnimationCodelab.yaml @@ -6,9 +6,11 @@ on: - main paths: - 'AnimationCodelab/**' + - '.github/workflows/AnimationCodelab.yaml' pull_request: paths: - 'AnimationCodelab/**' + - '.github/workflows/AnimationCodelab.yaml' env: SAMPLE_PATH: AnimationCodelab @@ -23,7 +25,7 @@ jobs: uses: actions/checkout@v4 - name: Copy CI gradle.properties - run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties + run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - name: Set up JDK 17 uses: actions/setup-java@v4 @@ -31,16 +33,7 @@ jobs: distribution: 'zulu' java-version: 17 - - name: Generate cache key - run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt - - - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: gradle-${{ hashFiles('checksum.txt') }} + - uses: gradle/actions/setup-gradle@v3 - name: Build project working-directory: ${{ env.SAMPLE_PATH }} diff --git a/.github/workflows/BasicLayoutsCodelab.yaml b/.github/workflows/BasicLayoutsCodelab.yaml index ae8476c44..e22a00b45 100644 --- a/.github/workflows/BasicLayoutsCodelab.yaml +++ b/.github/workflows/BasicLayoutsCodelab.yaml @@ -6,9 +6,11 @@ on: - main paths: - 'BasicLayoutsCodelab/**' + - '.github/workflows/BasicLayoutsCodelab.yaml' pull_request: paths: - 'BasicLayoutsCodelab/**' + - '.github/workflows/BasicLayoutsCodelab.yaml' env: SAMPLE_PATH: BasicLayoutsCodelab @@ -23,7 +25,7 @@ jobs: uses: actions/checkout@v4 - name: Copy CI gradle.properties - run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties + run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - name: Set up JDK 17 uses: actions/setup-java@v4 @@ -31,16 +33,7 @@ jobs: distribution: 'zulu' java-version: 17 - - name: Generate cache key - run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt - - - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: gradle-${{ hashFiles('checksum.txt') }} + - uses: gradle/actions/setup-gradle@v3 - name: Build project working-directory: ${{ env.SAMPLE_PATH }} diff --git a/.github/workflows/BasicStateCodelab.yaml b/.github/workflows/BasicStateCodelab.yaml index 5215c004d..472a25b64 100644 --- a/.github/workflows/BasicStateCodelab.yaml +++ b/.github/workflows/BasicStateCodelab.yaml @@ -6,9 +6,11 @@ on: - main paths: - 'BasicStateCodelab/**' + - '.github/workflows/BasicStateCodelab.yaml' pull_request: paths: - 'BasicStateCodelab/**' + - '.github/workflows/BasicStateCodelab.yaml' env: SAMPLE_PATH: BasicStateCodelab @@ -23,7 +25,7 @@ jobs: uses: actions/checkout@v4 - name: Copy CI gradle.properties - run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties + run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - name: Set up JDK 17 uses: actions/setup-java@v4 @@ -31,16 +33,7 @@ jobs: distribution: 'zulu' java-version: 17 - - name: Generate cache key - run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt - - - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: gradle-${{ hashFiles('checksum.txt') }} + - uses: gradle/actions/setup-gradle@v3 - name: Build project working-directory: ${{ env.SAMPLE_PATH }} diff --git a/.github/workflows/BasicsCodelab.yaml b/.github/workflows/BasicsCodelab.yaml index 5f56e7453..feafb5621 100644 --- a/.github/workflows/BasicsCodelab.yaml +++ b/.github/workflows/BasicsCodelab.yaml @@ -6,9 +6,11 @@ on: - main paths: - 'BasicsCodelab/**' + - '.github/workflows/BasicsCodelab.yaml' pull_request: paths: - 'BasicsCodelab/**' + - '.github/workflows/BasicsCodelab.yaml' env: SAMPLE_PATH: BasicsCodelab @@ -23,7 +25,7 @@ jobs: uses: actions/checkout@v4 - name: Copy CI gradle.properties - run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties + run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - name: Set up JDK 17 uses: actions/setup-java@v4 @@ -31,16 +33,7 @@ jobs: distribution: 'zulu' java-version: 17 - - name: Generate cache key - run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt - - - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: gradle-${{ hashFiles('checksum.txt') }} + - uses: gradle/actions/setup-gradle@v3 - name: Build project working-directory: ${{ env.SAMPLE_PATH }} diff --git a/.github/workflows/MigrationCodelab.yaml b/.github/workflows/MigrationCodelab.yaml index a8ed0f395..d9f73be36 100644 --- a/.github/workflows/MigrationCodelab.yaml +++ b/.github/workflows/MigrationCodelab.yaml @@ -6,9 +6,11 @@ on: - main paths: - 'MigrationCodelab/**' + - '.github/workflows/MigrationCodelab.yaml' pull_request: paths: - 'MigrationCodelab/**' + - '.github/workflows/MigrationCodelab.yaml' env: SAMPLE_PATH: MigrationCodelab @@ -23,7 +25,7 @@ jobs: uses: actions/checkout@v4 - name: Copy CI gradle.properties - run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties + run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - name: Set up JDK 17 uses: actions/setup-java@v4 @@ -31,16 +33,7 @@ jobs: distribution: 'zulu' java-version: 17 - - name: Generate cache key - run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt - - - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: gradle-${{ hashFiles('checksum.txt') }} + - uses: gradle/actions/setup-gradle@v3 - name: Build project working-directory: ${{ env.SAMPLE_PATH }} @@ -68,9 +61,17 @@ jobs: api-level: [26, 29] steps: + # https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners + - name: Enable KVM group perms + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + ls /dev/kvm + - name: Checkout uses: actions/checkout@v4 - + - name: Copy CI gradle.properties run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties @@ -80,16 +81,7 @@ jobs: distribution: 'zulu' java-version: 17 - - name: Generate cache key - run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt - - - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: gradle-${{ hashFiles('checksum.txt') }} + - uses: gradle/actions/setup-gradle@v3 - name: Run instrumentation tests uses: reactivecircus/android-emulator-runner@v2 diff --git a/.github/workflows/NavigationCodelab.yaml b/.github/workflows/NavigationCodelab.yaml index e28094bb1..30b53bb2b 100644 --- a/.github/workflows/NavigationCodelab.yaml +++ b/.github/workflows/NavigationCodelab.yaml @@ -7,9 +7,11 @@ on: - end paths: - 'NavigationCodelab/**' + - '.github/workflows/NavigationCodelab.yaml' pull_request: paths: - 'NavigationCodelab/**' + - '.github/workflows/NavigationCodelab.yaml' env: SAMPLE_PATH: NavigationCodelab @@ -32,16 +34,7 @@ jobs: distribution: 'zulu' java-version: 17 - - name: Generate cache key - run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt - - - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: gradle-${{ hashFiles('checksum.txt') }} + - uses: gradle/actions/setup-gradle@v3 - name: Build project working-directory: ${{ env.SAMPLE_PATH }} diff --git a/.github/workflows/TestingCodelab.yaml b/.github/workflows/TestingCodelab.yaml index 3b8871663..909c68d07 100644 --- a/.github/workflows/TestingCodelab.yaml +++ b/.github/workflows/TestingCodelab.yaml @@ -7,9 +7,11 @@ on: - end paths: - 'TestingCodelab/**' + - '.github/workflows/TestingCodelab.yaml' pull_request: paths: - 'TestingCodelab/**' + - '.github/workflows/TestingCodelab.yaml' env: SAMPLE_PATH: TestingCodelab @@ -32,16 +34,7 @@ jobs: distribution: 'zulu' java-version: 17 - - name: Generate cache key - run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt - - - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: gradle-${{ hashFiles('checksum.txt') }} + - uses: gradle/actions/setup-gradle@v3 - name: Build project working-directory: ${{ env.SAMPLE_PATH }} diff --git a/.github/workflows/ThemingCodelab.yaml b/.github/workflows/ThemingCodelab.yaml index d77f4034f..db316a75a 100644 --- a/.github/workflows/ThemingCodelab.yaml +++ b/.github/workflows/ThemingCodelab.yaml @@ -6,9 +6,11 @@ on: - main paths: - 'ThemingCodelab/**' + - '.github/workflows/ThemingCodelab.yaml' pull_request: paths: - 'ThemingCodelab/**' + - '.github/workflows/ThemingCodelab.yaml' env: SAMPLE_PATH: ThemingCodelab @@ -23,7 +25,7 @@ jobs: uses: actions/checkout@v4 - name: Copy CI gradle.properties - run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties + run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - name: Set up JDK 17 uses: actions/setup-java@v4 @@ -31,16 +33,7 @@ jobs: distribution: 'zulu' java-version: 17 - - name: Generate cache key - run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt - - - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches/modules-* - ~/.gradle/caches/jars-* - ~/.gradle/caches/build-cache-* - key: gradle-${{ hashFiles('checksum.txt') }} + - uses: gradle/actions/setup-gradle@v3 - name: Build project working-directory: ${{ env.SAMPLE_PATH }} diff --git a/scripts/checksum.sh b/scripts/checksum.sh deleted file mode 100755 index 3b617af70..000000000 --- a/scripts/checksum.sh +++ /dev/null @@ -1,40 +0,0 @@ -# -# Copyright 2019 Google, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -#!/bin/bash -SAMPLE=$1 -RESULT_FILE=$2 - -if [ -f $RESULT_FILE ]; then - rm $RESULT_FILE -fi -touch $RESULT_FILE - -checksum_file() { - echo $(openssl md5 $1 | awk '{print $2}') -} - -FILES=() -while read -r -d ''; do - FILES+=("$REPLY") -done < <(find $SAMPLE -type f \( -name "build.gradle*" -o -name "gradle-wrapper.properties" \) -print0) - -# Loop through files and append MD5 to result file -for FILE in ${FILES[@]}; do - echo $(checksum_file $FILE) >> $RESULT_FILE -done -# Now sort the file so that it is -sort $RESULT_FILE -o $RESULT_FILE \ No newline at end of file From e33e8b0652a471083b90b4d2c9bb15ce6fc4300e Mon Sep 17 00:00:00 2001 From: Zongle Wang Date: Fri, 14 Jun 2024 06:48:27 -0400 Subject: [PATCH 2/2] Enable caching flags and remove outdated --- AccessibilityCodelab/gradle.properties | 3 --- AdaptiveUiCodelab/gradle.properties | 17 ++++++++--------- .../gradle.properties | 5 +---- BasicLayoutsCodelab/gradle.properties | 18 +++++++----------- BasicStateCodelab/gradle.properties | 17 ++++++++--------- BasicsCodelab/gradle.properties | 14 +++++--------- MigrationCodelab/gradle.properties | 17 ++++++++++++----- NavigationCodelab/gradle.properties | 1 + PerformanceCodelab/gradle.properties | 14 ++++++-------- TestingCodelab/gradle.properties | 5 +---- ThemingCodelab/gradle.properties | 2 -- 11 files changed, 49 insertions(+), 64 deletions(-) diff --git a/AccessibilityCodelab/gradle.properties b/AccessibilityCodelab/gradle.properties index 961905d2a..be0e2c807 100644 --- a/AccessibilityCodelab/gradle.properties +++ b/AccessibilityCodelab/gradle.properties @@ -37,6 +37,3 @@ android.useAndroidX=true # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official - -# Enable R8 full mode. -android.enableR8.fullMode=true diff --git a/AdaptiveUiCodelab/gradle.properties b/AdaptiveUiCodelab/gradle.properties index 84d849c5b..cecb1ceb9 100644 --- a/AdaptiveUiCodelab/gradle.properties +++ b/AdaptiveUiCodelab/gradle.properties @@ -21,17 +21,16 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true + +# Turn on parallel compilation, caching and on-demand configuration +org.gradle.configureondemand=true +org.gradle.caching=true +org.gradle.parallel=true + # AndroidX package structure to make it clearer which packages are bundled with the -# Android operating system, and which are packaged with your app"s APK +# Android operating system, and which are packaged with your app's APK # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true + # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official -# Enables namespacing of each library's R class so that its R class includes only the -# resources declared in the library itself and none from the library's dependencies, -# thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true \ No newline at end of file diff --git a/AdvancedStateAndSideEffectsCodelab/gradle.properties b/AdvancedStateAndSideEffectsCodelab/gradle.properties index e2a50a753..d8582fb86 100644 --- a/AdvancedStateAndSideEffectsCodelab/gradle.properties +++ b/AdvancedStateAndSideEffectsCodelab/gradle.properties @@ -39,7 +39,4 @@ android.useAndroidX=true android.enableJetifier=true # Kotlin code style for this project: "official" or "obsolete": -kotlin.code.style=official - -# Enable R8 full mode. -android.enableR8.fullMode=false +kotlin.code.style=official \ No newline at end of file diff --git a/BasicLayoutsCodelab/gradle.properties b/BasicLayoutsCodelab/gradle.properties index 46a3404f7..9b4d6b4cc 100644 --- a/BasicLayoutsCodelab/gradle.properties +++ b/BasicLayoutsCodelab/gradle.properties @@ -11,19 +11,15 @@ # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true +# Turn on parallel compilation, caching and on-demand configuration +org.gradle.configureondemand=true +org.gradle.caching=true +org.gradle.parallel=true # AndroidX package structure to make it clearer which packages are bundled with the -# Android operating system, and which are packaged with your app"s APK +# Android operating system, and which are packaged with your app's APK # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true -# Kotlin code style for this project: "official" or "obsolete": -kotlin.code.style=official -# Enables namespacing of each library's R class so that its R class includes only the -# resources declared in the library itself and none from the library's dependencies, -# thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true \ No newline at end of file +# Kotlin code style for this project: "official" or "obsolete": +kotlin.code.style=official \ No newline at end of file diff --git a/BasicStateCodelab/gradle.properties b/BasicStateCodelab/gradle.properties index cd0519bb2..0bcff31c0 100644 --- a/BasicStateCodelab/gradle.properties +++ b/BasicStateCodelab/gradle.properties @@ -7,17 +7,16 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true + +# Turn on parallel compilation, caching and on-demand configuration +org.gradle.configureondemand=true +org.gradle.caching=true +org.gradle.parallel=true + # AndroidX package structure to make it clearer which packages are bundled with the -# Android operating system, and which are packaged with your app"s APK +# Android operating system, and which are packaged with your app's APK # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true + # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official -# Enables namespacing of each library's R class so that its R class includes only the -# resources declared in the library itself and none from the library's dependencies, -# thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true \ No newline at end of file diff --git a/BasicsCodelab/gradle.properties b/BasicsCodelab/gradle.properties index 5a794adbc..e397a1b5f 100644 --- a/BasicsCodelab/gradle.properties +++ b/BasicsCodelab/gradle.properties @@ -11,19 +11,15 @@ # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true +# Turn on parallel compilation, caching and on-demand configuration +org.gradle.configureondemand=true +org.gradle.caching=true +org.gradle.parallel=true # AndroidX package structure to make it clearer which packages are bundled with the # Android operating system, and which are packaged with your app's APK # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true + # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official - -# Enables namespacing of each library's R class so that its R class includes only the -# resources declared in the library itself and none from the library's dependencies, -# thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true \ No newline at end of file diff --git a/MigrationCodelab/gradle.properties b/MigrationCodelab/gradle.properties index 42979c479..c2a5d74b3 100644 --- a/MigrationCodelab/gradle.properties +++ b/MigrationCodelab/gradle.properties @@ -25,10 +25,17 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m + +# Turn on parallel compilation, caching and on-demand configuration +org.gradle.configureondemand=true +org.gradle.caching=true +org.gradle.parallel=true + +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true -org.gradle.jvmargs=-Xmx1536m -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true +# Kotlin code style for this project: "official" or "obsolete": +kotlin.code.style=official diff --git a/NavigationCodelab/gradle.properties b/NavigationCodelab/gradle.properties index 494737fda..33964ee87 100644 --- a/NavigationCodelab/gradle.properties +++ b/NavigationCodelab/gradle.properties @@ -25,6 +25,7 @@ # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx2048m +# Turn on parallel compilation, caching and on-demand configuration org.gradle.configureondemand=true org.gradle.caching=true org.gradle.parallel=true diff --git a/PerformanceCodelab/gradle.properties b/PerformanceCodelab/gradle.properties index 3c5031eb7..17e019b30 100644 --- a/PerformanceCodelab/gradle.properties +++ b/PerformanceCodelab/gradle.properties @@ -7,17 +7,15 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true +# Turn on parallel compilation, caching and on-demand configuration +org.gradle.configureondemand=true +org.gradle.caching=true +org.gradle.parallel=true + # AndroidX package structure to make it clearer which packages are bundled with the # Android operating system, and which are packaged with your app's APK # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true + # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official -# Enables namespacing of each library's R class so that its R class includes only the -# resources declared in the library itself and none from the library's dependencies, -# thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true \ No newline at end of file diff --git a/TestingCodelab/gradle.properties b/TestingCodelab/gradle.properties index c6bcaa96c..8a30b68db 100644 --- a/TestingCodelab/gradle.properties +++ b/TestingCodelab/gradle.properties @@ -36,7 +36,4 @@ org.gradle.parallel=true android.useAndroidX=true # Kotlin code style for this project: "official" or "obsolete": -kotlin.code.style=official - -# Enable R8 full mode. -android.enableR8.fullMode=true +kotlin.code.style=official \ No newline at end of file diff --git a/ThemingCodelab/gradle.properties b/ThemingCodelab/gradle.properties index 6ffd62461..4f37fdd9c 100644 --- a/ThemingCodelab/gradle.properties +++ b/ThemingCodelab/gradle.properties @@ -38,5 +38,3 @@ kotlin.code.style=official org.gradle.configureondemand=true org.gradle.caching=true org.gradle.parallel=true -# Enable R8 full mode. -android.enableR8.fullMode=true