Skip to content

Commit 36a7532

Browse files
markushiromtsn
andauthored
Bump Gradle, AGP and Kotlin versions (#3936)
* Bump Gradle, AGP and Kotlin versions * Fix Changelog * Spotless * Add a comment about NDK-AGP compatibility * Remove redundant manifest * Remove redundant extension * Revert toLowerCase -> lowercase * Centralize java-library config and mention javadoc/soruces to module files * Fix publications for new locations * Remove matrix.language from codeql * Try m1 runners * wip * Revert to ubuntu on some workflows * Revert to ubuntu and enable config cache * Changelog and more config cache * Remove gradle-wrapper-validation job as its part of setup-gradle now --------- Co-authored-by: Roman Zavarnitsyn <rom4ek93@gmail.com>
1 parent ba51699 commit 36a7532

File tree

101 files changed

+367
-611
lines changed

Some content is hidden

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

101 files changed

+367
-611
lines changed

.github/workflows/agp-matrix.yml

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
env:
2525
VERSION_AGP: ${{ matrix.agp }}
2626
APPLY_SENTRY_INTEGRATIONS: ${{ matrix.integrations }}
27+
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
2728

2829
steps:
2930
- name: Checkout Repo
@@ -41,6 +42,7 @@ jobs:
4142
uses: gradle/actions/setup-gradle@8790d96bb8fdd8ae7edfb2eada090c650b257f27 # pin@v3
4243
with:
4344
gradle-home-cache-cleanup: true
45+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
4446

4547
- name: Setup KVM
4648
shell: bash

.github/workflows/build.yml

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414
name: Build Job ubuntu-latest - Java 17
1515
runs-on: ubuntu-latest
1616

17+
env:
18+
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
19+
1720
steps:
1821
- name: Checkout Repo
1922
uses: actions/checkout@v4
@@ -30,6 +33,7 @@ jobs:
3033
uses: gradle/actions/setup-gradle@8790d96bb8fdd8ae7edfb2eada090c650b257f27 # pin@v3
3134
with:
3235
gradle-home-cache-cleanup: true
36+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
3337

3438
- name: Run Tests with coverage and Lint
3539
run: make preMerge

.github/workflows/codeql-analysis.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
name: Analyze
1919
runs-on: ubuntu-latest
2020

21-
strategy:
22-
fail-fast: false
21+
env:
22+
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
2323

2424
steps:
2525
- name: Checkout Repo
@@ -37,6 +37,7 @@ jobs:
3737
uses: gradle/actions/setup-gradle@8790d96bb8fdd8ae7edfb2eada090c650b257f27 # pin@v3
3838
with:
3939
gradle-home-cache-cleanup: true
40+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
4041

4142
- name: Initialize CodeQL
4243
uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a # pin@v2

.github/workflows/gradle-wrapper-validation.yml

-16
This file was deleted.

.github/workflows/integration-tests-benchmarks.yml

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
# we copy the secret to the env variable in order to access it in the workflow
2424
env:
2525
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
26+
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
2627

2728
steps:
2829
- name: Git checkout
@@ -40,6 +41,7 @@ jobs:
4041
uses: gradle/actions/setup-gradle@8790d96bb8fdd8ae7edfb2eada090c650b257f27 # pin@v3
4142
with:
4243
gradle-home-cache-cleanup: true
44+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
4345

4446
# Clean, build and release a test apk, but only if we will run the benchmark
4547
- name: Make assembleBenchmarks
@@ -72,6 +74,7 @@ jobs:
7274
# we copy the secret to the env variable in order to access it in the workflow
7375
env:
7476
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
77+
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
7578

7679
steps:
7780
- name: Git checkout
@@ -89,6 +92,7 @@ jobs:
8992
uses: gradle/actions/setup-gradle@8790d96bb8fdd8ae7edfb2eada090c650b257f27 # pin@v3
9093
with:
9194
gradle-home-cache-cleanup: true
95+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
9296

9397
- uses: actions/cache@v4
9498
id: app-plain-cache

.github/workflows/integration-tests-ui-critical.yml

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ jobs:
2121
build:
2222
name: Build
2323
runs-on: ubuntu-latest
24+
25+
env:
26+
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
27+
2428
steps:
2529
- name: Checkout code
2630
uses: actions/checkout@v4
@@ -35,6 +39,7 @@ jobs:
3539
uses: gradle/actions/setup-gradle@8790d96bb8fdd8ae7edfb2eada090c650b257f27 # pin@v3
3640
with:
3741
gradle-home-cache-cleanup: true
42+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
3843

3944
- name: Build debug APK
4045
run: make assembleUiTestCriticalRelease

.github/workflows/integration-tests-ui.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
env:
1919
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
2020
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
21+
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
2122

2223
steps:
2324
- name: Git checkout
@@ -35,6 +36,7 @@ jobs:
3536
uses: gradle/actions/setup-gradle@8790d96bb8fdd8ae7edfb2eada090c650b257f27 # pin@v3
3637
with:
3738
gradle-home-cache-cleanup: true
39+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
3840

3941
# Clean, build and release a test apk, but only if we will run the benchmark
4042
- name: Make assembleUiTests

.github/workflows/system-tests-backend.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ jobs:
9191
9292
- name: Build server jar
9393
run: |
94-
./gradlew :sentry-samples:${{ matrix.sample }}:bootJar
94+
./gradlew :sentry-samples:${{ matrix.sample }}:bootJar --no-configuration-cache
9595
9696
- name: Build agent jar
9797
run: |
98-
./gradlew :sentry-opentelemetry:sentry-opentelemetry-agent:assemble
98+
./gradlew :sentry-opentelemetry:sentry-opentelemetry-agent:assemble --no-configuration-cache
9999
100100
- name: Start server and run integration test for sentry-cli commands
101101
run: |

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22

33
## Unreleased
44

5+
### Breaking Changes
6+
7+
- The Kotlin Language version is now set to 1.6 ([#3936](https://github.com/getsentry/sentry-java/pull/3936))
8+
59
### Fixes
610

711
- Do not log if `OtelContextScopesStorage` cannot be found ([#4127](https://github.com/getsentry/sentry-java/pull/4127))
812
- Previously `java.lang.ClassNotFoundException: io.sentry.opentelemetry.OtelContextScopesStorage` was shown in the log if the class could not be found.
913
- This is just a lookup the SDK performs to configure itself. The SDK also works without OpenTelemetry.
14+
- Mention javadoc and sources for published artifacts in Gradle `.module` metadata ([#3936](https://github.com/getsentry/sentry-java/pull/3936))
1015

1116
### Dependencies
1217

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ publish: clean dryRelease
88

99
# deep clean
1010
clean:
11-
./gradlew clean
11+
./gradlew clean --no-configuration-cache
1212
rm -rf distributions
1313

1414
# build and run tests
@@ -20,7 +20,7 @@ javadocs:
2020

2121
# do a dry release (like a local deploy)
2222
dryRelease:
23-
./gradlew aggregateJavadocs distZip --no-build-cache
23+
./gradlew aggregateJavadocs distZip --no-build-cache --no-configuration-cache
2424

2525
# check for dependencies update
2626
update:

build.gradle.kts

+63-56
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import com.diffplug.spotless.LineEnding
2+
import com.vanniktech.maven.publish.JavaLibrary
3+
import com.vanniktech.maven.publish.JavadocJar
24
import com.vanniktech.maven.publish.MavenPublishBaseExtension
3-
import com.vanniktech.maven.publish.MavenPublishPlugin
4-
import com.vanniktech.maven.publish.MavenPublishPluginExtension
55
import groovy.util.Node
66
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
77
import kotlinx.kover.gradle.plugin.dsl.KoverReportExtension
@@ -17,6 +17,7 @@ plugins {
1717
id(Config.QualityPlugins.binaryCompatibilityValidator) version Config.QualityPlugins.binaryCompatibilityValidatorVersion
1818
id(Config.QualityPlugins.jacocoAndroid) version Config.QualityPlugins.jacocoAndroidVersion apply false
1919
id(Config.QualityPlugins.kover) version Config.QualityPlugins.koverVersion apply false
20+
id(Config.BuildPlugins.gradleMavenPublishPlugin) version Config.BuildPlugins.gradleMavenPublishPluginVersion apply false
2021
}
2122

2223
buildscript {
@@ -26,7 +27,6 @@ buildscript {
2627
dependencies {
2728
classpath(Config.BuildPlugins.androidGradle)
2829
classpath(kotlin(Config.BuildPlugins.kotlinGradlePlugin, version = Config.kotlinVersion))
29-
classpath(Config.BuildPlugins.gradleMavenPublishPlugin)
3030
// dokka is required by gradle-maven-publish-plugin.
3131
classpath(Config.BuildPlugins.dokkaPlugin)
3232
classpath(Config.QualityPlugins.errorpronePlugin)
@@ -95,7 +95,7 @@ allprojects {
9595
TestLogEvent.PASSED,
9696
TestLogEvent.FAILED
9797
)
98-
maxParallelForks = Runtime.getRuntime().availableProcessors() / 4
98+
maxParallelForks = 1
9999

100100
// Cap JVM args per test
101101
minHeapSize = "256m"
@@ -140,7 +140,7 @@ subprojects {
140140
androidReports("release") {
141141
xml {
142142
// Change the report file name so the Codecov Github action can find it
143-
setReportFile(file("$buildDir/reports/kover/report.xml"))
143+
setReportFile(project.layout.buildDirectory.file("reports/kover/report.xml").get().asFile)
144144
}
145145
}
146146
}
@@ -157,6 +157,7 @@ subprojects {
157157

158158
if (!this.name.contains("sample") && !this.name.contains("integration-tests") && this.name != "sentry-test-support" && this.name != "sentry-compose-helper") {
159159
apply<DistributionPlugin>()
160+
apply<com.vanniktech.maven.publish.MavenPublishPlugin>()
160161

161162
val sep = File.separator
162163

@@ -179,22 +180,30 @@ subprojects {
179180
tasks.named("distZip").configure {
180181
this.dependsOn("publishToMavenLocal")
181182
this.doLast {
182-
val distributionFilePath =
183-
"${this.project.buildDir}${sep}distributions${sep}${this.project.name}-${this.project.version}.zip"
184-
val file = File(distributionFilePath)
185-
if (!file.exists()) throw IllegalStateException("Distribution file: $distributionFilePath does not exist")
186-
if (file.length() == 0L) throw IllegalStateException("Distribution file: $distributionFilePath is empty")
183+
val file = this.project.layout.buildDirectory.file("distributions${sep}${this.project.name}-${this.project.version}.zip").get().asFile
184+
if (!file.exists()) throw IllegalStateException("Distribution file: ${file.absolutePath} does not exist")
185+
if (file.length() == 0L) throw IllegalStateException("Distribution file: ${file.absolutePath} is empty")
187186
}
188187
}
189188

190-
afterEvaluate {
191-
apply<MavenPublishPlugin>()
189+
plugins.withId("java-library") {
190+
configure<MavenPublishBaseExtension> {
191+
// we have to disable javadoc publication in maven-publish plugin as it's not
192+
// including it in the .module file https://github.com/vanniktech/gradle-maven-publish-plugin/issues/861
193+
// and do it ourselves
194+
configure(JavaLibrary(JavadocJar.None(), sourcesJar = true))
195+
}
196+
197+
configure<JavaPluginExtension> {
198+
withJavadocJar()
192199

193-
configure<MavenPublishPluginExtension> {
194-
// signing is done when uploading files to MC
195-
// via gpg:sign-and-deploy-file (release.kts)
196-
releaseSigningEnabled = false
200+
sourceCompatibility = JavaVersion.VERSION_1_8
201+
targetCompatibility = JavaVersion.VERSION_1_8
197202
}
203+
}
204+
205+
afterEvaluate {
206+
apply<MavenPublishPlugin>()
198207

199208
@Suppress("UnstableApiUsage")
200209
configure<MavenPublishBaseExtension> {
@@ -206,7 +215,7 @@ subprojects {
206215
repositories {
207216
maven {
208217
name = "unityMaven"
209-
url = file("${rootProject.buildDir}/unityMaven").toURI()
218+
url = rootProject.layout.buildDirectory.file("unityMaven").get().asFile.toURI()
210219
}
211220
}
212221
}
@@ -241,48 +250,46 @@ spotless {
241250
}
242251
}
243252

244-
gradle.projectsEvaluated {
245-
tasks.create("aggregateJavadocs", Javadoc::class.java) {
246-
setDestinationDir(file("$buildDir/docs/javadoc"))
247-
title = "${project.name} $version API"
248-
val opts = options as StandardJavadocDocletOptions
249-
opts.quiet()
250-
opts.encoding = "UTF-8"
251-
opts.memberLevel = JavadocMemberLevel.PROTECTED
252-
opts.stylesheetFile(file("$projectDir/docs/stylesheet.css"))
253-
opts.links = listOf(
254-
"https://docs.oracle.com/javase/8/docs/api/",
255-
"https://docs.spring.io/spring-framework/docs/current/javadoc-api/",
256-
"https://docs.spring.io/spring-boot/docs/current/api/"
257-
)
258-
subprojects
259-
.filter { !it.name.contains("sample") && !it.name.contains("integration-tests") }
260-
.forEach { proj ->
261-
proj.tasks.withType<Javadoc>().forEach { javadocTask ->
262-
source += javadocTask.source
263-
classpath += javadocTask.classpath
264-
excludes += javadocTask.excludes
265-
includes += javadocTask.includes
266-
}
253+
tasks.register("aggregateJavadocs", Javadoc::class.java) {
254+
setDestinationDir(project.layout.buildDirectory.file("docs/javadoc").get().asFile)
255+
title = "${project.name} $version API"
256+
val opts = options as StandardJavadocDocletOptions
257+
opts.quiet()
258+
opts.encoding = "UTF-8"
259+
opts.memberLevel = JavadocMemberLevel.PROTECTED
260+
opts.stylesheetFile(file("$projectDir/docs/stylesheet.css"))
261+
opts.links = listOf(
262+
"https://docs.oracle.com/javase/8/docs/api/",
263+
"https://docs.spring.io/spring-framework/docs/current/javadoc-api/",
264+
"https://docs.spring.io/spring-boot/docs/current/api/"
265+
)
266+
subprojects
267+
.filter { !it.name.contains("sample") && !it.name.contains("integration-tests") }
268+
.forEach { proj ->
269+
proj.tasks.withType<Javadoc>().forEach { javadocTask ->
270+
source += javadocTask.source
271+
classpath += javadocTask.classpath
272+
excludes += javadocTask.excludes
273+
includes += javadocTask.includes
267274
}
268-
}
275+
}
276+
}
269277

270-
tasks.create("buildForCodeQL") {
271-
subprojects
272-
.filter {
273-
!it.displayName.contains("sample") &&
274-
!it.displayName.contains("integration-tests") &&
275-
!it.displayName.contains("bom") &&
276-
it.name != "sentry-opentelemetry"
277-
}
278-
.forEach { proj ->
279-
if (proj.plugins.hasPlugin("com.android.library")) {
280-
this.dependsOn(proj.tasks.findByName("compileReleaseUnitTestSources"))
281-
} else {
282-
this.dependsOn(proj.tasks.findByName("testClasses"))
283-
}
278+
tasks.register("buildForCodeQL") {
279+
subprojects
280+
.filter {
281+
!it.displayName.contains("sample") &&
282+
!it.displayName.contains("integration-tests") &&
283+
!it.displayName.contains("bom") &&
284+
it.name != "sentry-opentelemetry"
285+
}
286+
.forEach { proj ->
287+
if (proj.plugins.hasPlugin("com.android.library")) {
288+
this.dependsOn(proj.tasks.findByName("compileReleaseUnitTestSources"))
289+
} else {
290+
this.dependsOn(proj.tasks.findByName("testClasses"))
284291
}
285-
}
292+
}
286293
}
287294

288295
// Workaround for https://youtrack.jetbrains.com/issue/IDEA-316081/Gradle-8-toolchain-error-Toolchain-from-executable-property-does-not-match-toolchain-from-javaLauncher-property-when-different

0 commit comments

Comments
 (0)