Skip to content

Commit 4bd420d

Browse files
committed
Feat(Build): move to AGP 8.1.1
1 parent fa7210e commit 4bd420d

30 files changed

+118
-105
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ buildscript {
88
}
99

1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:7.3.1'
11+
classpath 'com.android.tools.build:gradle:8.1.1'
1212
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0"
1313
classpath 'com.google.gms:google-services:4.4.2'
1414
}

example_java/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ android {
2121
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2222
}
2323
}
24-
25-
lintOptions {
26-
checkReleaseBuilds false
24+
lint {
2725
abortOnError false
26+
checkReleaseBuilds false
2827
}
28+
2929
}
3030

3131
dependencies {

example_java/src/androidTest/java/org/flyve/example_java/ExampleInstrumentedTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
import android.content.Context;
3030

31-
import androidx.test.InstrumentationRegistry;
32-
import androidx.test.runner.AndroidJUnit4;
31+
import androidx.test.platform.app.InstrumentationRegistry;
32+
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner;
3333

3434
import org.junit.Test;
3535
import org.junit.runner.RunWith;
@@ -41,12 +41,12 @@
4141
*
4242
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
4343
*/
44-
@RunWith(AndroidJUnit4.class)
44+
@RunWith(AndroidJUnit4ClassRunner.class)
4545
public class ExampleInstrumentedTest {
4646
@Test
4747
public void useAppContext() throws Exception {
4848
// Context of the app under test.
49-
Context appContext = InstrumentationRegistry.getTargetContext();
49+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
5050

5151
assertEquals("org.flyve.example_java", appContext.getPackageName());
5252
}

example_kotlin/build.gradle

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,18 @@ android {
2222
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2323
}
2424
}
25-
26-
lintOptions {
27-
checkReleaseBuilds false
25+
lint {
2826
abortOnError false
27+
checkReleaseBuilds false
28+
}
29+
30+
compileOptions {
31+
sourceCompatibility = JavaVersion.VERSION_17
32+
targetCompatibility = JavaVersion.VERSION_17
33+
}
34+
35+
kotlinOptions {
36+
jvmTarget = JavaVersion.VERSION_17
2937
}
3038

3139
}

example_kotlin/src/androidTest/java/org/flyve/example_kotlin/ExampleInstrumentedTest.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@
2525
*/
2626

2727
package org.flyve.example_kotlin
28-
import androidx.test.platform.app.InstrumentationRegistry
29-
import androidx.test.runner.AndroidJUnit4
30-
import org.junit.Assert.*
28+
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
29+
import org.junit.Assert.assertEquals
3130
import org.junit.Test
3231
import org.junit.runner.RunWith
3332

@@ -36,7 +35,7 @@ import org.junit.runner.RunWith
3635
*
3736
* See [testing documentation](http://d.android.com/tools/testing).
3837
*/
39-
@RunWith(AndroidJUnit4::class)
38+
@RunWith(AndroidJUnit4ClassRunner::class)
4039
class ExampleInstrumentedTest {
4140
@Test
4241
fun useAppContext() {

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
org.gradle.jvmargs=-Xmx4608m
22
android.useAndroidX=true
33
android.enableJetifier=true
4+
android.defaults.buildfeatures.buildconfig=true
5+
android.nonTransitiveRClass=false
6+
android.nonFinalResIds=false
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Mon Dec 02 16:44:40 CET 2024
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

inventory/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ android {
1717
}
1818
debug {
1919
minifyEnabled false
20-
testCoverageEnabled true
20+
enableUnitTestCoverage true
21+
enableAndroidTestCoverage true
2122
}
2223
}
2324

2425
buildFeatures {
2526
viewBinding true
2627
}
28+
namespace 'org.flyve.inventory'
2729
}
2830

2931
configurations {
@@ -37,8 +39,7 @@ dependencies {
3739
androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', {
3840
exclude group: 'com.android.support', module: 'support-annotations'
3941
})
40-
testImplementation 'junit:junit:4.12'
41-
testImplementation 'androidx.test:runner:1.3.0'
42+
testImplementation 'androidx.test:runner:1.6.2' // Or latest version
4243
testImplementation 'androidx.test:core:1.3.0'
4344

4445
implementation 'com.orhanobut:logger:2.2.0'

inventory/src/androidTest/java/org/flyve/inventory/BatteryTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@
2828

2929
import android.content.Context;
3030

31-
import androidx.test.InstrumentationRegistry;
32-
import androidx.test.runner.AndroidJUnit4;
31+
import androidx.test.platform.app.InstrumentationRegistry;
32+
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner;
3333

3434
import org.flyve.inventory.categories.Battery;
3535
import org.junit.Test;
3636
import org.junit.runner.RunWith;
3737

3838
import static org.junit.Assert.assertNotEquals;
3939

40-
@RunWith(AndroidJUnit4.class)
40+
@RunWith(AndroidJUnit4ClassRunner.class)
4141
public class BatteryTest {
4242

43-
Context appContext = InstrumentationRegistry.getTargetContext();
43+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
4444

4545
@Test
4646
public void getTechnology() {

inventory/src/androidTest/java/org/flyve/inventory/BiosTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@
2929
import android.content.Context;
3030

3131

32-
import androidx.test.InstrumentationRegistry;
33-
import androidx.test.runner.AndroidJUnit4;
32+
import androidx.test.platform.app.InstrumentationRegistry;
33+
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner;
3434

3535
import org.flyve.inventory.categories.Bios;
3636

3737
import org.junit.Test;
3838
import org.junit.runner.RunWith;
3939
import static org.junit.Assert.*;
4040

41-
@RunWith(AndroidJUnit4.class)
41+
@RunWith(AndroidJUnit4ClassRunner.class)
4242
public class BiosTest {
43-
private Context appContext = InstrumentationRegistry.getTargetContext();
43+
private Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();;
4444

4545
@Test
4646
public void getAssesTag() {

0 commit comments

Comments
 (0)