Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AGP to 7.3.0, java to 11, kotlin to 1.6.10 #378

Merged
merged 7 commits into from Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 6 additions & 9 deletions .github/workflows/test-publish-dry-run.yaml
Expand Up @@ -26,25 +26,22 @@ jobs:
- agp: "7.1.3"
gradle: "7.3.3"
java: "11"
- agp: "7.1.3"
- agp: "7.2.1"
gradle: "7.4"
java: "11"
- agp: "7.1.3"
gradle: "7.5"
java: "11"
- agp: "7.2.1"
gradle: "7.3.3"
gradle: "7.5"
java: "11"
- agp: "7.2.1"
- agp: "7.3.0"
gradle: "7.4"
java: "11"
- agp: "7.2.1"
- agp: "7.3.0"
gradle: "7.5"
java: "11"
- agp: "7.3.0-beta05"
- agp: "7.4.0-beta01"
gradle: "7.5"
java: "11"
- agp: "7.4.0-alpha03"
- agp: "8.0.0-alpha01"
gradle: "7.5"
java: "11"

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,7 @@

### Features

- Bump AGP to v7.3.0 ([#378](https://github.com/getsentry/sentry-android-gradle-plugin/pull/378))
- Bump CLI from v2.5.2 to v2.6.0 ([#379](https://github.com/getsentry/sentry-android-gradle-plugin/pull/379))
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#260)
- [diff](https://github.com/getsentry/sentry-cli/compare/2.5.2...2.6.0)
Expand Down
17 changes: 12 additions & 5 deletions buildSrc/src/main/java/Dependencies.kt
@@ -1,17 +1,24 @@
import org.gradle.util.VersionNumber

object BuildPluginsVersion {
val AGP = System.getenv("VERSION_AGP") ?: "7.2.1"
const val DOKKA = "1.5.31"
const val KOTLIN = "1.5.31"
const val KOTLIN_LANG_VERSION = "1.5"
val AGP = System.getenv("VERSION_AGP") ?: "7.3.0"
const val DOKKA = "1.6.10"
const val KOTLIN = "1.6.10"
const val AAR_2_JAR = "0.6"
const val KTLINT = "10.2.1"
// do not upgrade to 0.18.0, it does not generate the pom-default.xml and module.json under
// build/publications/maven
const val MAVEN_PUBLISH = "0.17.0"
const val PROGUARD = "7.1.0"

// proguard does not support AGP 8 yet
fun isProguardApplicable(): Boolean = VersionNumber.parse(AGP).major < 8
}

object LibsVersion {
const val SDK_VERSION = 33
const val MIN_SDK_VERSION = 21

const val JUNIT = "4.13.2"
const val ASM = "7.0" // compatibility matrix -> https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/instrumentation/InstrumentationContext#apiversion
const val SQLITE = "2.1.0"
Expand Down Expand Up @@ -55,7 +62,7 @@ object Samples {
}

object Room {
private const val version = "2.3.0"
private const val version = "2.4.3"
const val runtime = "androidx.room:room-runtime:${version}"
const val ktx = "androidx.room:room-ktx:${version}"
const val compiler = "androidx.room:room-compiler:${version}"
Expand Down
7 changes: 4 additions & 3 deletions examples/android-gradle-kts/build.gradle.kts
Expand Up @@ -4,10 +4,10 @@ plugins {
}

android {
compileSdk = 30
compileSdk = LibsVersion.SDK_VERSION
defaultConfig {
minSdk = 21
targetSdk = 30
minSdk = LibsVersion.MIN_SDK_VERSION
targetSdk = LibsVersion.SDK_VERSION
versionCode = 1
versionName = "1.0"
}
Expand All @@ -17,6 +17,7 @@ android {
proguardFiles.add(getDefaultProguardFile("proguard-android-optimize.txt"))
}
}
namespace = "com.example.sampleapp"
}

sentry {
Expand Down
3 changes: 1 addition & 2 deletions examples/android-gradle-kts/src/main/AndroidManifest.xml
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sampleapp">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<activity android:name=".MainActivity"/>
</application>
Expand Down
7 changes: 4 additions & 3 deletions examples/android-gradle/build.gradle
Expand Up @@ -14,10 +14,10 @@ apply plugin: 'com.android.application'
apply plugin: 'io.sentry.android.gradle'

android {
compileSdkVersion = 30
compileSdk = LibsVersion.SDK_VERSION
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
minSdk LibsVersion.MIN_SDK_VERSION
targetSdk LibsVersion.SDK_VERSION
versionCode = 1
versionName = "1.0"
}
Expand All @@ -28,6 +28,7 @@ android {
'proguard-android-optimize.txt')
}
}
namespace 'com.example.sampleapp'
}

sentry {
Expand Down
11 changes: 2 additions & 9 deletions examples/android-gradle/src/main/AndroidManifest.xml
@@ -1,12 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sampleapp">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="io.sentry.dsn" android:value="https://examplePublicKey@o0.ingest.sentry.io/0" />
<activity android:name=".MainActivity"/>
</application>
</manifest>
27 changes: 16 additions & 11 deletions examples/android-guardsquare-proguard/build.gradle
Expand Up @@ -13,13 +13,15 @@ buildscript {

apply plugin: 'com.android.application'
apply plugin: 'io.sentry.android.gradle'
apply plugin: 'com.guardsquare.proguard'
if (BuildPluginsVersion.INSTANCE.isProguardApplicable()) {
apply plugin: 'com.guardsquare.proguard'
}

android {
compileSdkVersion = 30
compileSdk = LibsVersion.SDK_VERSION
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
minSdk LibsVersion.MIN_SDK_VERSION
targetSdk LibsVersion.SDK_VERSION
versionCode = 1
versionName = "1.0"
}
Expand All @@ -29,15 +31,18 @@ android {
minifyEnabled false
}
}
namespace 'com.example.sampleapp'
}

proguard {
configurations {
release {
defaultConfiguration "proguard-android-optimize.txt"
configuration "proguard-project.txt"
}
}
if (BuildPluginsVersion.INSTANCE.isProguardApplicable()) {
proguard {
configurations {
release {
defaultConfiguration "proguard-android-optimize.txt"
configuration "proguard-project.txt"
}
}
}
}

sentry {
Expand Down
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sampleapp">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<activity android:name=".MainActivity"/>
</application>
Expand Down
7 changes: 4 additions & 3 deletions examples/android-instrumentation-sample/build.gradle.kts
Expand Up @@ -14,10 +14,10 @@ plugins {
// }

android {
compileSdk = 30
compileSdk = LibsVersion.SDK_VERSION
defaultConfig {
minSdk = 21
targetSdk = 30
minSdk = LibsVersion.MIN_SDK_VERSION
targetSdk = LibsVersion.SDK_VERSION
versionCode = 1
versionName = "1.0"
}
Expand All @@ -41,6 +41,7 @@ android {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
namespace = "io.sentry.samples.instrumentation"
}

// useful, when we want to modify room-generated classes, and then compile them into .class files
Expand Down
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.sentry.samples.instrumentation">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application android:name=".SampleApp">
<activity
android:name=".ui.MainActivity"
android:theme="@style/Theme.AppCompat.NoActionBar">
android:theme="@style/Theme.AppCompat.NoActionBar"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
7 changes: 4 additions & 3 deletions examples/android-ndk/build.gradle
Expand Up @@ -13,10 +13,10 @@ buildscript {
apply plugin: 'com.android.application'

android {
compileSdkVersion = 30
compileSdk = LibsVersion.SDK_VERSION
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
minSdkVersion LibsVersion.MIN_SDK_VERSION
targetSdk LibsVersion.SDK_VERSION
versionCode = 1
versionName = "1.0"
}
Expand All @@ -30,6 +30,7 @@ android {
path "jni/Android.mk"
}
}
namespace 'com.example.sampleapp'
}

if (System.getenv("AUTO_UPLOAD")) {
Expand Down
3 changes: 1 addition & 2 deletions examples/android-ndk/src/main/AndroidManifest.xml
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sampleapp">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<activity android:name=".MainActivity"/>
</application>
Expand Down
7 changes: 4 additions & 3 deletions examples/android-room-lib/build.gradle.kts
Expand Up @@ -4,15 +4,16 @@ plugins {
}

android {
compileSdk = 30
compileSdk = LibsVersion.SDK_VERSION
defaultConfig {
minSdk = 21
targetSdk = 30
minSdk = LibsVersion.MIN_SDK_VERSION
targetSdk = LibsVersion.SDK_VERSION
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
namespace = "io.sentry.android.instrumentation.lib"
}

dependencies {
Expand Down
2 changes: 0 additions & 2 deletions examples/android-room-lib/src/main/AndroidManifest.xml

This file was deleted.

17 changes: 9 additions & 8 deletions plugin-build/build.gradle.kts
Expand Up @@ -62,27 +62,28 @@ dependencies {
}

configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
romtsn marked this conversation as resolved.
Show resolved Hide resolved
}
}

// We need to compile Groovy first and let Kotlin depend on it.
// See https://docs.gradle.org/6.1-rc-1/release-notes.html#compilation-order
tasks.withType<GroovyCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
classpath = sourceSets["main"].compileClasspath
}

tasks.withType<KotlinCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
classpath += files(sourceSets["main"].groovy.classesDirectory)

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
jvmTarget = JavaVersion.VERSION_11.toString()
freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn", "-Xjvm-default=enable")
languageVersion = "1.3"
languageVersion = "1.4"
}
}

Expand Down
Expand Up @@ -94,18 +94,15 @@ abstract class BaseSentryPluginTest(
// The supported Gradle version can be found here:
// https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
// The pair is [AGP Version, Gradle Version]
arrayOf("7.0.4", "7.0.2"),
arrayOf("7.0.4", "7.1.1"),
arrayOf("7.0.4", "7.2"),
arrayOf("7.1.3", "7.2"),
arrayOf("7.1.3", "7.3.3"),
arrayOf("7.1.3", "7.4"),
arrayOf("7.1.3", "7.5"),
arrayOf("7.2.1", "7.3.3"),
arrayOf("7.2.1", "7.4"),
arrayOf("7.2.1", "7.5"),
arrayOf("7.3.0-beta05", "7.5"),
arrayOf("7.4.0-alpha03", "7.5")
arrayOf("7.3.0", "7.4"),
arrayOf("7.3.0", "7.5"),
romtsn marked this conversation as resolved.
Show resolved Hide resolved
arrayOf("7.4.0-beta01", "7.5"),
arrayOf("8.0.0-alpha01", "7.5")
)

internal fun GradleRunner.appendArguments(vararg arguments: String) =
Expand Down