Skip to content

Commit 94ad21b

Browse files
chore(deps): SDK-1989 - [Android] Update Android Gradle Plugin to 8 (#1068)
Updating Android Gradle Plugin to major 8. Now requires Java 17 for building.
1 parent d48e40e commit 94ad21b

File tree

11 files changed

+51
-37
lines changed

11 files changed

+51
-37
lines changed

.github/workflows/appium-automation.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ env:
77
SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
88
BROWSERSTACK_USER: ${{ secrets.BROWSER_STACK_USER }}
99
BROWSERSTACK_KEY: ${{ secrets.BROWSER_STACK_KEY }}
10+
JAVA_DISTRIBUTION: 'corretto'
11+
JAVA_VERSION: '17'
12+
JAVA_VERSION_AUTOMATION: '11'
1013
jobs:
1114
appium-automation-tests:
1215
name: appium-automation-tests
@@ -23,12 +26,12 @@ jobs:
2326
path: qa
2427
repository: BranchMetrics/qentelli-saas-sdk-testing-automation
2528
token: ${{ secrets.BRANCHLET_ACCESS_TOKEN_PUBLIC }}
26-
# repo's gradle is configured to run on java 11
27-
- name: Setup java 11 for gradle
29+
# repo's gradle is configured to run on java 17
30+
- name: Setup java for gradle
2831
uses: actions/setup-java@v3
2932
with:
30-
distribution: 'temurin'
31-
java-version: '11'
33+
distribution: ${{ env.JAVA_DISTRIBUTION }}
34+
java-version: ${{ env.JAVA_VERSION }}
3235
# to reduce complexity, testbed app uses sdk as a project reference
3336
- name: Build testbed app
3437
run: |
@@ -40,6 +43,12 @@ jobs:
4043
parsed=$(echo $response | jq ".app_url")
4144
echo "::add-mask::$parsed"
4245
echo "APP_URL=$parsed" >> "$GITHUB_ENV"
46+
# automation is compatible with java 11
47+
- name: Setup java for automation
48+
uses: actions/setup-java@v3
49+
with:
50+
distribution: ${{ env.JAVA_DISTRIBUTION }}
51+
java-version: ${{ env.JAVA_VERSION_AUTOMATION }}
4352
- name: Execute automation
4453
run: |
4554
cd qa

.github/workflows/unit-and-instrumented-tests-action.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,21 @@ on: [push]
33
env:
44
API_MIN: 21
55
API_CURRENT: 33
6+
JAVA_DISTRIBUTION: 'corretto'
7+
JAVA_VERSION: '17'
68
jobs:
79
unit-test-api-level-min:
810
name: unit-test-api-level-$API_MIN
911
runs-on: macos-latest
1012
steps:
1113
- name: Checkout
1214
uses: actions/checkout@v3
13-
# repo's gradle is configured to run on java 11
14-
- name: Setup java 11 for gradle
15+
# repo's gradle is configured to run on java 17
16+
- name: Setup java 17 for gradle
1517
uses: actions/setup-java@v3
1618
with:
17-
distribution: 'temurin'
18-
java-version: '11'
19+
distribution: ${{ env.JAVA_DISTRIBUTION }}
20+
java-version: ${{ env.JAVA_VERSION }}
1921
- name: Run unit tests
2022
run: |
2123
./gradlew :Branch-SDK:testDebugUnitTest
@@ -45,12 +47,12 @@ jobs:
4547
nohup $ANDROID_HOME/tools/emulator -avd test -no-audio -no-boot-anim -camera-back none -camera-front none -qemu -m 2048 2>&1 &
4648
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do echo "waiting..."; sleep 1; done; input keyevent 82'
4749
echo "Emulator has finished booting"
48-
# repo's gradle is configured to run on java 11
49-
- name: Setup java 11 for gradle
50+
# repo's gradle is configured to run on java 17
51+
- name: Setup java 17 for gradle
5052
uses: actions/setup-java@v3
5153
with:
52-
distribution: 'temurin'
53-
java-version: '11'
54+
distribution: ${{ env.JAVA_DISTRIBUTION }}
55+
java-version: ${{ env.JAVA_VERSION }}
5456
# gradlew will automatically connect to booted emulator
5557
- name: Run instrumented tests
5658
run: |
@@ -68,12 +70,12 @@ jobs:
6870
steps:
6971
- name: Checkout
7072
uses: actions/checkout@v3
71-
# repo's gradle is configured to run on java 11
72-
- name: Setup java 11 for gradle
73+
# repo's gradle is configured to run on java 17
74+
- name: Setup java 17 for gradle
7375
uses: actions/setup-java@v3
7476
with:
75-
distribution: 'temurin'
76-
java-version: '11'
77+
distribution: ${{ env.JAVA_DISTRIBUTION }}
78+
java-version: ${{ env.JAVA_VERSION }}
7779
- name: Run unit tests
7880
run: |
7981
./gradlew :Branch-SDK:testDebugUnitTest
@@ -103,12 +105,12 @@ jobs:
103105
nohup $ANDROID_HOME/tools/emulator -avd test -no-audio -no-boot-anim -camera-back none -camera-front none -qemu -m 2048 2>&1 &
104106
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do echo "waiting..."; sleep 1; done; input keyevent 82'
105107
echo "Emulator has finished booting"
106-
# repo's gradle is configured to run on java 11
107-
- name: Setup java 11 for gradle
108+
# repo's gradle is configured to run on java 17
109+
- name: Setup java 17 for gradle
108110
uses: actions/setup-java@v3
109111
with:
110-
distribution: 'temurin'
111-
java-version: '11'
112+
distribution: ${{ env.JAVA_DISTRIBUTION }}
113+
java-version: ${{ env.JAVA_VERSION }}
112114
# gradlew will automatically connect to booted emulator
113115
- name: Run instrumented tests
114116
run: |

Branch-SDK-Automation-TestBed/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ android {
2525
sourceCompatibility JavaVersion.VERSION_1_8
2626
targetCompatibility JavaVersion.VERSION_1_8
2727
}
28+
namespace 'io.branch.saas.sdk.testbed'
2829
}
2930

3031
dependencies {

Branch-SDK-Automation-TestBed/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="io.branch.saas.sdk.testbed">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<uses-permission android:name="android.permission.INTERNET" />
65
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

Branch-SDK-TestBed/build.gradle.kts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ dependencies {
1515
}
1616
implementation("com.android.billingclient:billing:5.1.0")
1717

18-
androidTestImplementation("androidx.test.ext:junit:1.1.3")
19-
androidTestImplementation("androidx.test:runner:1.4.0")
20-
androidTestImplementation("androidx.test:rules:1.4.0")
21-
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
18+
androidTestImplementation("androidx.test.ext:junit:1.1.5")
19+
androidTestImplementation("androidx.test:runner:1.5.2")
20+
androidTestImplementation("androidx.test:rules:1.5.0")
21+
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
2222
}
2323

2424
android {
@@ -74,4 +74,5 @@ android {
7474
signingConfig = signingConfigs.findByName("release")
7575
}
7676
}
77+
namespace = "io.branch.branchandroidtestbed"
7778
}

Branch-SDK-TestBed/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="io.branch.branchandroidtestbed"
43
android:versionCode="1"
54
android:versionName="1.0" >
65

Branch-SDK/build.gradle.kts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,17 @@ android {
6161
abortOnError = false
6262
}
6363

64+
buildFeatures {
65+
buildConfig = true
66+
}
67+
6468
buildTypes {
6569
fun String.wrapInQuotes(): String {
6670
return "\"$this\""
6771
}
6872

6973
debug {
70-
isTestCoverageEnabled = true
74+
enableUnitTestCoverage = true
7175
buildConfigField("long", "VERSION_CODE", VERSION_CODE)
7276
buildConfigField("String", "VERSION_NAME", VERSION_NAME.wrapInQuotes())
7377
}
@@ -80,6 +84,7 @@ android {
8084
kotlinOptions {
8185
jvmTarget = "1.8"
8286
}
87+
namespace = "io.branch.referral"
8388

8489
publishing {
8590
singleVariant("release") {

Branch-SDK/src/androidTest/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="io.branch.referral.test">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<uses-permission android:name="android.permission.INTERNET" />
65
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="io.branch.referral"
43
android:versionCode="1"
54
android:versionName="1.0" >
65
</manifest>

build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import org.gradle.api.tasks.testing.logging.*
22

33
plugins {
4-
id("com.android.library") version "7.2.2" apply false
5-
id("com.android.application") version "7.2.2" apply false
6-
kotlin("android") version "1.6.20" apply false
4+
id("com.android.library") version "8.0.2" apply false
5+
id("com.android.application") version "8.0.2" apply false
6+
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
77
}
88

99
val VERSION_NAME: String by project

0 commit comments

Comments
 (0)