Skip to content

Commit

Permalink
build: update agp/gradle to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalwrench committed Feb 14, 2024
1 parent 4cc732f commit 422647f
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ buildscript {
}

dependencies {
classpath("com.android.tools.build:gradle:${Versions.agp}")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}")
classpath("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${Versions.detekt}")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:${Versions.dokka}")
classpath("org.jetbrains.dokka:android-documentation-plugin:${Versions.dokka}")
Expand All @@ -20,6 +18,8 @@ buildscript {

plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
id("com.android.library") apply false
id("org.jetbrains.kotlin.android") apply false
}

group = "io.embrace"
Expand Down
13 changes: 11 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`java-gradle-plugin`
`kotlin-dsl`
Expand All @@ -21,14 +23,21 @@ dependencies {
compileOnly(gradleApi())

// NOTE: when updating any of these keep in sync with buildSrc/src/main/kotlin/io/embrace/gradle/Versions.kt
implementation("com.android.tools.build:gradle:7.4.2")
implementation("com.android.tools.build:gradle:8.2.2")
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21")
implementation("org.jetbrains.kotlinx:binary-compatibility-validator:0.14.0")
}

// ensure the Kotlin + Java compilers both use the same language level.
project.tasks.withType(JavaCompile::class.java) {
project.tasks.withType(JavaCompile::class.java).configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
}

// ensure the Kotlin + Java compilers both use the same language level.
project.tasks.withType(KotlinCompile::class.java).configureEach {
kotlinOptions {
jvmTarget = "1.8"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class InternalEmbracePlugin : Plugin<Project> {
}

private fun configureKotlinOptions(project: Project) {
project.tasks.withType(KotlinCompile::class.java).all {
project.tasks.withType(KotlinCompile::class.java).configureEach {
kotlinOptions {
apiVersion = "1.4"
languageVersion = "1.4"
Expand All @@ -179,12 +179,13 @@ class InternalEmbracePlugin : Plugin<Project> {
// FIXME: targeting Kotlin 1.4 emits a warning that I can't find a way to suppress.
// Disabling this check for now.
allWarningsAsErrors = false

}
}
}

private fun configureJavaOptions(project: Project) {
project.tasks.withType(JavaCompile::class.java).all {
project.tasks.withType(JavaCompile::class.java).configureEach {
val args = listOf("-Xlint:unchecked", "-Xlint:deprecation")
options.compilerArgs.addAll(args)
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/io/embrace/gradle/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object Versions {

// NOTE: when updating keep this in sync with the version in buildSrc/build.gradle.kts
@JvmField
val agp = "7.4.2"
val agp = "8.2.2"

@JvmField
val lint = "30.1.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.embrace.android.embracesdk

import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.net.ConnectivityManager
Expand Down Expand Up @@ -86,6 +87,7 @@ internal class EmbraceNetworkConnectivityServiceTest {
/**
* Asserts that a network connectivity broadcast receiver can be registered/unregistered
*/
@SuppressLint("UnspecifiedRegisterReceiverFlag")
@Test
@Throws(InterruptedException::class)
fun `test connectivity broadcast receiver can register and unregister`() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.embrace.android.embracesdk

import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.os.PowerManager
Expand Down Expand Up @@ -150,6 +151,7 @@ internal class EmbracePowerSaveModeServiceTest {
assertThrows(Exception::class.java) { service.onReceive(context, intent) }
}

@SuppressLint("UnspecifiedRegisterReceiverFlag")
@Test
@Throws(InterruptedException::class)
fun `test receiver can be registered and unregistered`() {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-7.6.3-bin.zip
distributionUrl=https\:https://services.gradle.org/distributions/gradle-8.6-bin.zip

0 comments on commit 422647f

Please sign in to comment.