Skip to content

Commit

Permalink
Merge pull request #284 from wealthfront/agp-811
Browse files Browse the repository at this point in the history
Use Android Gradle plugin v8.1.1, Kotlin 1.8.21, Java 17
  • Loading branch information
cmathew authored Sep 22, 2023
2 parents 3c0fade + 6dc74d2 commit 5f4b40f
Show file tree
Hide file tree
Showing 28 changed files with 178 additions and 193 deletions.
8 changes: 4 additions & 4 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.6.20'
id 'org.jetbrains.kotlin.jvm' version '1.8.21'
}

repositories {
Expand All @@ -9,17 +9,17 @@ repositories {
}

dependencies {
implementation 'com.android.tools.build:gradle:7.4.2'
implementation 'com.android.tools.build:gradle:8.1.1'
}

compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_17
}
}

compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_17
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ object Plugins {
const val detekt = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion"
}

object Dependencies {
object Libs {

const val appCompat = "androidx.appcompat:appcompat:$supportLibVersion"
const val constraintLayout = "androidx.constraintlayout:constraintlayout:$constraintLayoutVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ object Versions {
const val minSdkVersion = 18
const val targetSdkVersion = 30

const val kotlinVersion = "1.6.20"
const val kotlinVersion = "1.8.21"
const val kotlinterVersion = "3.9.0"
const val detektVersion = "1.19.0"
const val supportLibVersion = "1.3.1"
Expand Down
2 changes: 1 addition & 1 deletion gradle/gradle-mvn-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ afterEvaluate { project ->
project.getPlugins().hasPlugin('com.android.library')) {

task androidSourcesJar(type: Jar) {
classifier = 'sources'
archiveClassifier = 'sources'
from android.sourceSets.main.java.source
}
}
Expand Down
6 changes: 2 additions & 4 deletions gradle/static-analysis.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ detekt {
tasks.findByName("check")?.dependsOn("detekt")
}

tasks.withType(Test) {
reports {
html.setEnabled(true)
}
tasks.withType(TestReport).configureEach {
enabled = true
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Aug 08 12:17:13 PDT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
11 changes: 6 additions & 5 deletions internal-test-support/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
}

compileOptions {
setSourceCompatibility(JavaVersion.VERSION_1_8)
setTargetCompatibility(JavaVersion.VERSION_1_8)
setSourceCompatibility(JavaVersion.VERSION_17)
setTargetCompatibility(JavaVersion.VERSION_17)
}

buildFeatures {
Expand All @@ -25,17 +25,18 @@ android {
minifyEnabled false
}
}
namespace 'com.wealthfront.magellan.internal.test'
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions.allWarningsAsErrors = true
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = JavaVersion.VERSION_17
}

dependencies {
implementation project(':magellan-library')
implementation project(':magellan-legacy')

implementation Dependencies.inject
implementation Dependencies.appCompat
implementation Libs.inject
implementation Libs.appCompat
}
2 changes: 1 addition & 1 deletion internal-test-support/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest package="com.wealthfront.magellan.internal.test"
<manifest
xmlns:android="http://schemas.android.com/apk/res/android">

<application>
Expand Down
25 changes: 13 additions & 12 deletions magellan-legacy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,40 @@ android {
}

compileOptions {
setSourceCompatibility(JavaVersion.VERSION_1_8)
setTargetCompatibility(JavaVersion.VERSION_1_8)
setSourceCompatibility(JavaVersion.VERSION_17)
setTargetCompatibility(JavaVersion.VERSION_17)
}

buildTypes {
release {
minifyEnabled false
}
}
namespace 'com.wealthfront.magellan.legacy'
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
if (!name.contains("UnitTest")) {
kotlinOptions.freeCompilerArgs = ['-Xexplicit-api=strict', '-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi']
}
kotlinOptions.allWarningsAsErrors = true
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = JavaVersion.VERSION_17
}

dependencies {
implementation project(':magellan-library')

implementation Dependencies.appCompat
implementation Dependencies.inject
implementation Dependencies.coroutines
implementation Dependencies.coroutinesAndroid
implementation Libs.appCompat
implementation Libs.inject
implementation Libs.coroutines
implementation Libs.coroutinesAndroid

testImplementation project(':internal-test-support')
testImplementation Dependencies.testCore
testImplementation Dependencies.junit
testImplementation Dependencies.truth
testImplementation Dependencies.mockito
testImplementation Dependencies.robolectric
testImplementation Libs.testCore
testImplementation Libs.junit
testImplementation Libs.truth
testImplementation Libs.mockito
testImplementation Libs.robolectric
}

apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
4 changes: 1 addition & 3 deletions magellan-legacy/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<manifest
package="com.wealthfront.magellan.legacy"
>
<manifest>

<application/>

Expand Down
37 changes: 19 additions & 18 deletions magellan-library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {
}

compileOptions {
setSourceCompatibility(JavaVersion.VERSION_1_8)
setTargetCompatibility(JavaVersion.VERSION_1_8)
setSourceCompatibility(JavaVersion.VERSION_17)
setTargetCompatibility(JavaVersion.VERSION_17)
}

testOptions {
Expand All @@ -36,6 +36,7 @@ android {
minifyEnabled false
}
}
namespace 'com.wealthfront.magellan'
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
Expand All @@ -45,27 +46,27 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions.freeCompilerArgs = ['-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi,kotlinx.coroutines.InternalCoroutinesApi']
}
kotlinOptions.allWarningsAsErrors = true
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = JavaVersion.VERSION_17
}

dependencies {
implementation Dependencies.appCompat
implementation Dependencies.lifecycle
implementation Dependencies.inject
implementation Dependencies.coroutines
implementation Dependencies.coroutinesAndroid
implementation Libs.appCompat
implementation Libs.lifecycle
implementation Libs.inject
implementation Libs.coroutines
implementation Libs.coroutinesAndroid

testImplementation project(':internal-test-support')
testImplementation Dependencies.testCore
testImplementation Dependencies.testCoreKtx
testImplementation Dependencies.junit
testImplementation Dependencies.extJunitKtx
testImplementation Dependencies.truth
testImplementation Dependencies.mockito
testImplementation Dependencies.mockK
testImplementation Dependencies.archTesting
testImplementation Dependencies.robolectric
testImplementation Dependencies.coroutinesTest
testImplementation Libs.testCore
testImplementation Libs.testCoreKtx
testImplementation Libs.junit
testImplementation Libs.extJunitKtx
testImplementation Libs.truth
testImplementation Libs.mockito
testImplementation Libs.mockK
testImplementation Libs.archTesting
testImplementation Libs.robolectric
testImplementation Libs.coroutinesTest

// Bug in AGP: Follow this issue - https://issuetracker.google.com/issues/141840950
// lintPublish project(':magellan-lint')
Expand Down
4 changes: 1 addition & 3 deletions magellan-library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<manifest
package="com.wealthfront.magellan"
>
<manifest>

<application/>

Expand Down
20 changes: 10 additions & 10 deletions magellan-lint/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ apply plugin: "kotlin"
apply plugin: 'com.android.lint'

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

lintOptions {
Expand All @@ -16,15 +16,15 @@ lintOptions {
}

dependencies {
compileOnly Dependencies.lintApi
compileOnly Dependencies.lintChecks
compileOnly Libs.lintApi
compileOnly Libs.lintChecks

testImplementation Dependencies.junit
testImplementation Dependencies.truth
testImplementation Dependencies.lint
testImplementation Dependencies.lintTests
testImplementation Dependencies.testUtils
testImplementation(Dependencies.truth) {
testImplementation Libs.junit
testImplementation Libs.truth
testImplementation Libs.lint
testImplementation Libs.lintTests
testImplementation Libs.testUtils
testImplementation(Libs.truth) {
exclude group: 'com.google.guava', module: 'guava'
}
}
Expand Down
17 changes: 9 additions & 8 deletions magellan-rx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,36 @@ android {
}

compileOptions {
setSourceCompatibility(JavaVersion.VERSION_1_8)
setTargetCompatibility(JavaVersion.VERSION_1_8)
setSourceCompatibility(JavaVersion.VERSION_17)
setTargetCompatibility(JavaVersion.VERSION_17)
}

buildTypes {
release {
minifyEnabled false
}
}
namespace 'com.wealthfront.magellan.rx'
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
if (!name.contains("UnitTest")) {
kotlinOptions.freeCompilerArgs = ['-Xexplicit-api=strict']
}
kotlinOptions.allWarningsAsErrors = true
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = JavaVersion.VERSION_17
}

dependencies {
implementation project(':magellan-legacy')
implementation project(':magellan-library')

implementation Dependencies.rxjava
implementation Dependencies.inject
implementation Libs.rxjava
implementation Libs.inject

testImplementation Dependencies.junit
testImplementation Dependencies.truth
testImplementation Dependencies.mockito
testImplementation Libs.junit
testImplementation Libs.truth
testImplementation Libs.mockito
}

apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
4 changes: 1 addition & 3 deletions magellan-rx/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<manifest
package="com.wealthfront.magellan.rx"
>
<manifest>

<application/>

Expand Down
17 changes: 9 additions & 8 deletions magellan-rx2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,36 @@ android {
}

compileOptions {
setSourceCompatibility(JavaVersion.VERSION_1_8)
setTargetCompatibility(JavaVersion.VERSION_1_8)
setSourceCompatibility(JavaVersion.VERSION_17)
setTargetCompatibility(JavaVersion.VERSION_17)
}

buildTypes {
release {
minifyEnabled false
}
}
namespace 'com.wealthfront.magellan.rx2'
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
if (!name.contains("UnitTest")) {
kotlinOptions.freeCompilerArgs = ['-Xexplicit-api=strict']
}
kotlinOptions.allWarningsAsErrors = true
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = JavaVersion.VERSION_17
}

dependencies {
implementation project(':magellan-legacy')
implementation project(':magellan-library')

implementation Dependencies.rxjava2
implementation Dependencies.inject
implementation Libs.rxjava2
implementation Libs.inject

testImplementation Dependencies.junit
testImplementation Dependencies.truth
testImplementation Dependencies.mockito
testImplementation Libs.junit
testImplementation Libs.truth
testImplementation Libs.mockito
}

apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
4 changes: 1 addition & 3 deletions magellan-rx2/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<manifest
package="com.wealthfront.magellan.rx2"
>
<manifest>

<application/>

Expand Down
Loading

0 comments on commit 5f4b40f

Please sign in to comment.