Skip to content

Commit 9f0a924

Browse files
jkuestersugat009
authored andcommitted
feat(#332): support Android 14 (#349)
1 parent 96e55d9 commit 9f0a924

File tree

53 files changed

+233
-251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+233
-251
lines changed

.github/workflows/build.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ jobs:
3131
with:
3232
submodules: true
3333

34-
- name: Set up Java 11
34+
- name: Set up Java 17
3535
uses: actions/setup-java@v2
3636
with:
3737
distribution: 'adopt'
38-
java-version: '11'
38+
java-version: '17'
3939

4040
- name: Test Bash Keystores scripts
4141
run: make test-bash-keystore
@@ -85,11 +85,11 @@ jobs:
8585
with:
8686
submodules: true
8787

88-
- name: Set up Java 11
88+
- name: Set up Java 17
8989
uses: actions/setup-java@v2
9090
with:
9191
distribution: 'adopt'
92-
java-version: '11'
92+
java-version: '17'
9393

9494
- name: Enable KVM
9595
run: |
@@ -112,13 +112,13 @@ jobs:
112112
path: |
113113
~/.android/avd/*
114114
~/.android/adb*
115-
key: avd-33-default
115+
key: avd-34-default
116116

117117
- name: Create AVD and generate snapshot for caching
118118
if: steps.avd-cache.outputs.cache-hit != 'true'
119119
uses: reactivecircus/android-emulator-runner@v2
120120
with:
121-
api-level: 33
121+
api-level: 34
122122
arch: x86_64
123123
target: default
124124
force-avd-creation: false
@@ -132,7 +132,7 @@ jobs:
132132
- name: Run test-ui on unbranded
133133
uses: reactivecircus/android-emulator-runner@v2
134134
with:
135-
api-level: 33
135+
api-level: 34
136136
arch: x86_64
137137
target: default
138138
force-avd-creation: false
@@ -142,7 +142,7 @@ jobs:
142142
- name: Run test-ui on gamma
143143
uses: reactivecircus/android-emulator-runner@v2
144144
with:
145-
api-level: 33
145+
api-level: 34
146146
arch: x86_64
147147
target: default
148148
force-avd-creation: false

.github/workflows/publish.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
- name: Set release version
2323
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
2424

25-
- name: Set up Java 11
25+
- name: Set up Java 17
2626
uses: actions/setup-java@v2
2727
with:
2828
distribution: 'adopt'
29-
java-version: '11'
29+
java-version: '17'
3030

3131
- name: Set up Ruby
3232
uses: ruby/setup-ruby@v1

build.gradle

+35-26
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import com.github.spotbugs.snom.Confidence
2+
import com.github.spotbugs.snom.Effort
3+
14
buildscript {
25
repositories {
36
mavenCentral()
@@ -6,8 +9,8 @@ buildscript {
69
google()
710
}
811
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.1.3'
10-
classpath 'com.github.spotbugs.snom:spotbugs-gradle-plugin:5.0.5'
12+
classpath 'com.android.tools.build:gradle:8.3.0'
13+
classpath 'com.github.spotbugs.snom:spotbugs-gradle-plugin:6.0.8'
1114
}
1215
}
1316

@@ -31,6 +34,7 @@ task checkstyle(type: Checkstyle) {
3134
source 'src'
3235
classpath = files()
3336
ignoreFailures = false
37+
exclude 'test/bash/bats/**'
3438
}
3539

3640
task pmd(type: Pmd) {
@@ -40,19 +44,19 @@ task pmd(type: Pmd) {
4044
source 'src'
4145
exclude '**/**.png'
4246
exclude '**/**.mp3'
43-
exclude '**/**.bats'
47+
exclude 'test/bash/bats/**'
4448
dependencies {
45-
pmd 'net.sourceforge.pmd:pmd-java:6.44.0'
46-
pmd 'net.sourceforge.pmd:pmd-xml:6.44.0'
49+
pmd 'net.sourceforge.pmd:pmd-java:6.55.0'
50+
pmd 'net.sourceforge.pmd:pmd-xml:6.55.0'
4751
}
4852
}
4953

5054
spotbugs {
5155
ignoreFailures = false
5256
showStackTraces = true
5357
showProgress = true
54-
effort = 'default'
55-
reportLevel = 'default'
58+
effort = Effort.valueOf('DEFAULT')
59+
reportLevel = Confidence.valueOf('DEFAULT')
5660
maxHeapSize = '1g'
5761
omitVisitors = [
5862
'FindReturnRef' // This app exchanges data with external applications, we assume is safe.
@@ -95,16 +99,16 @@ def getVersionName = {
9599
}
96100

97101
android {
98-
compileSdkVersion 33
99-
buildToolsVersion '30.0.3'
102+
compileSdk 34
100103
packagingOptions {
101-
exclude 'META-INF/LICENSE'
102-
exclude 'META-INF/NOTICE'
104+
resources {
105+
excludes += ['META-INF/LICENSE', 'META-INF/NOTICE']
106+
}
103107
}
104108

105109
defaultConfig {
106110
//noinspection OldTargetApi
107-
targetSdkVersion 33
111+
targetSdkVersion 34
108112
minSdkVersion 21 // Android 5.0
109113
versionCode getVersionCode()
110114
versionName getVersionName()
@@ -125,8 +129,8 @@ android {
125129
}
126130

127131
compileOptions {
128-
sourceCompatibility JavaVersion.VERSION_11
129-
targetCompatibility JavaVersion.VERSION_11
132+
sourceCompatibility JavaVersion.VERSION_17
133+
targetCompatibility JavaVersion.VERSION_17
130134
// Flag to enable support for the new language APIs
131135
coreLibraryDesugaringEnabled true
132136
}
@@ -164,7 +168,11 @@ android {
164168
}
165169
}
166170

167-
lintOptions {
171+
buildFeatures {
172+
buildConfig true
173+
}
174+
175+
lint {
168176
lintConfig = new File('config/lint.xml')
169177

170178
disable 'UnusedResources' // linter can't handle static imports, so just skip this test
@@ -179,7 +187,6 @@ android {
179187
abortOnError true
180188
htmlReport false
181189
textReport true
182-
textOutput 'stdout'
183190
}
184191
}
185192

@@ -191,6 +198,7 @@ android {
191198

192199
flavorDimensions 'brand'
193200

201+
namespace 'org.medicmobile.webapp.mobile'
194202
productFlavors {
195203
unbranded {
196204
// we will not create project-specific src directories
@@ -425,18 +433,19 @@ android {
425433

426434
dependencies {
427435
implementation fileTree(dir: 'libs', include: ['*.jar'])
428-
implementation 'androidx.core:core:1.7.0'
429-
implementation 'androidx.activity:activity:1.4.0'
430-
implementation 'androidx.fragment:fragment:1.4.1'
431-
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.5.3'
432-
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
436+
implementation platform('org.jetbrains.kotlin:kotlin-bom:1.9.23')
437+
implementation 'androidx.core:core:1.12.0'
438+
implementation 'androidx.activity:activity:1.8.2'
439+
implementation 'androidx.fragment:fragment:1.6.2'
440+
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.8.3'
441+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
433442
testImplementation 'junit:junit:4.13.2'
434-
testImplementation 'org.mockito:mockito-inline:4.0.0'
443+
testImplementation 'org.mockito:mockito-inline:5.2.0'
435444
testImplementation 'com.google.android:android-test:4.1.1.4'
436-
testImplementation 'org.robolectric:robolectric:4.7'
437-
testImplementation 'androidx.test.espresso:espresso-core:3.5.0-alpha05'
438-
testImplementation 'androidx.test.espresso:espresso-intents:3.5.0-alpha05'
439-
testImplementation 'androidx.test.ext:junit:1.1.3'
445+
testImplementation 'org.robolectric:robolectric:4.11.1'
446+
testImplementation 'androidx.test.espresso:espresso-core:3.5.1'
447+
testImplementation 'androidx.test.espresso:espresso-intents:3.5.1'
448+
testImplementation 'androidx.test.ext:junit:1.1.5'
440449
androidTestImplementation 'androidx.test.espresso:espresso-web:3.5.1'
441450
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
442451
androidTestImplementation 'androidx.test:runner:1.5.2'

coverage.gradle

+5-9
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,13 @@ tasks.withType(Test) {
77

88
project.afterEvaluate {
99
def variantName = 'unbrandedDebug'
10-
def testType = "${variantName.capitalize()}UnitTest"
11-
def testTaskName = "test${testType}"
10+
def testType = "${variantName}UnitTest"
11+
def testTaskName = "test${testType.capitalize()}"
1212

13-
tasks.create(name: "make${testType}CoverageReport", type: JacocoReport, dependsOn: testTaskName) {
13+
tasks.create(name: "make${testType.capitalize()}CoverageReport", type: JacocoReport, dependsOn: testTaskName) {
1414
group = 'Reporting'
1515
description = "Generate Jacoco coverage report for the ${variantName} build."
1616

17-
reports {
18-
html.enabled(true)
19-
}
20-
2117
def excludes = [
2218
'**/R.class',
2319
'**/R$*.class',
@@ -38,10 +34,10 @@ project.afterEvaluate {
3834
]
3935

4036
classDirectories.from = files(fileTree(
41-
dir: "${project.buildDir}/intermediates/javac/${variantName}/classes",
37+
dir: layout.buildDirectory.dir("intermediates/javac/${variantName}/compile${variantName.capitalize()}JavaWithJavac/classes"),
4238
excludes: excludes
4339
))
4440
sourceDirectories.from = file("${project.projectDir}/src/main/java")
45-
executionData.from = file("${project.buildDir}/outputs/unit_test_code_coverage/${testType}/${testTaskName}.exec")
41+
executionData.from = layout.buildDirectory.file("outputs/unit_test_code_coverage/${testType}/${testTaskName}.exec")
4642
}
4743
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/bracuganda/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="org.medicmobile.webapp.mobile">
3+
xmlns:tools="http://schemas.android.com/tools">
54

65
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />
76

+1-2
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-
xmlns:tools="http://schemas.android.com/tools"
4-
package="org.medicmobile.webapp.mobile">
3+
xmlns:tools="http://schemas.android.com/tools">
54
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
65
</manifest>
+1-2
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-
xmlns:tools="http://schemas.android.com/tools"
4-
package="org.medicmobile.webapp.mobile">
3+
xmlns:tools="http://schemas.android.com/tools">
54
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
65
</manifest>

src/chis_ne/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="org.medicmobile.webapp.mobile">
3+
xmlns:tools="http://schemas.android.com/tools">
54

65
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />
76

src/cht_rci/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="org.medicmobile.webapp.mobile">
3+
xmlns:tools="http://schemas.android.com/tools">
54

65
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />
76

src/cht_rci_test/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="org.medicmobile.webapp.mobile">
3+
xmlns:tools="http://schemas.android.com/tools">
54

65
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />
76

src/cmmb_kenya/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="org.medicmobile.webapp.mobile">
3+
xmlns:tools="http://schemas.android.com/tools">
54

65
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />
76
</manifest>

src/hope_through_health/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="org.medicmobile.webapp.mobile">
3+
xmlns:tools="http://schemas.android.com/tools">
54

65
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />
76

src/icm_ph_chc/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="org.medicmobile.webapp.mobile">
3+
xmlns:tools="http://schemas.android.com/tools">
54

65
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />
76

src/itech_aurum/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="org.medicmobile.webapp.mobile">
3+
xmlns:tools="http://schemas.android.com/tools">
54

65
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />
76
</manifest>

src/itech_malawi/AndroidManifest.xml

+1-2
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-
xmlns:tools="http://schemas.android.com/tools"
4-
package="org.medicmobile.webapp.mobile">
3+
xmlns:tools="http://schemas.android.com/tools">
54
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
65
</manifest>

0 commit comments

Comments
 (0)