Skip to content

Commit 9800ffc

Browse files
authored
upgrade gradle to 7.5.1 (#131)
Signed-off-by: shalom <[email protected]>
1 parent 0f82859 commit 9800ffc

File tree

23 files changed

+140
-108
lines changed

23 files changed

+140
-108
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
7373
# Run tests
7474
- name: Run Tests
75-
run: ./gradlew test
75+
run: ./gradlew build
7676

7777
# Collect Tests Result of failed tests
7878
##todo: add other modules test reports

.github/workflows/gradle-ci-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
uses: gradle/[email protected]
3838
with:
3939
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
40-
arguments: buildPlugin runPluginVerifier --no-daemon
40+
arguments: build buildPlugin runPluginVerifier --no-daemon
4141

4242
- name: Prepare Plugin Artifact
4343
id: artifact

.github/workflows/gradle-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
# caches/**/riderRD-*/**
4242
# caches/**/ideaIC-*/**
4343
# caches/**/pycharmPC-*/**
44-
arguments: buildPlugin --no-daemon
44+
arguments: build buildPlugin --no-daemon
4545

4646
- name: Prepare Plugin Artifact
4747
id: artifact

.github/workflows/multi-java-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
uses: gradle/[email protected]
4343
with:
4444
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
45-
arguments: buildPlugin --no-daemon
45+
arguments: build buildPlugin --no-daemon
4646

4747

4848
# Collect Tests Result of failed tests

.github/workflows/multi-os-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
uses: gradle/[email protected]
4242
with:
4343
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
44-
arguments: buildPlugin --no-daemon
44+
arguments: build buildPlugin --no-daemon
4545

4646

4747
# Collect Tests Result of failed tests

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111

1212
# Prepare and publish the plugin to the Marketplace repository
1313
publish:
14+
# todo: if: "github.event.release.released"
1415
name: Publish Plugin
1516
runs-on: ubuntu-latest
1617
steps:

analytics-provider/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ testing {
2828
all {
2929
testTask.configure {
3030
setForkEvery(1L) //because MockWebServer is static
31+
32+
//this is only to silent the warning : see https://stackoverflow.com/questions/60915381/retrofit2-maven-project-illegal-reflective-access-warning
33+
//WARNING: Illegal reflective access by retrofit2.Platform (file:/home/shalom/.gradle/caches/modules-2/files-2.1/com.squareup.retrofit2/retrofit/2.9.0/d8fdfbd5da952141a665a403348b74538efc05ff/retrofit-2.9.0.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
34+
jvmArgs = listOf("--add-opens=java.base/java.lang.invoke=ALL-UNNAMED")
3135
}
3236
}
3337
}

build.gradle.kts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ tasks {
9393
wrapper {
9494
gradleVersion = properties("gradleVersion")
9595
distributionType = Wrapper.DistributionType.ALL
96-
distributionBase = Wrapper.PathBase.PROJECT
96+
distributionBase = Wrapper.PathBase.GRADLE_USER_HOME
97+
distributionPath = "wrapper/dists"
98+
archiveBase = Wrapper.PathBase.GRADLE_USER_HOME
99+
archivePath = "wrapper/dists"
97100
}
98101

99102
patchPluginXml {
@@ -153,12 +156,10 @@ tasks {
153156
//rider contributes to prepareSandbox, so it needs to run before runIde
154157
dependsOn("prepareSandbox")
155158
dependsOn(":rider:prepareSandboxForRider")
156-
maxHeapSize = "4g"
159+
maxHeapSize = "2g"
157160
// Rider's backend doesn't support dynamic plugins. It might be possible to work with auto-reload of the frontend
158161
// part of a plugin, but there are dangers about keeping plugins in sync
159162
autoReloadPlugins.set(false)
160-
//todo: workaround, it's a Gradle IntelliJ Plugin issue, it will be fixed in version 1.8.0 according to jetbrains developers.
161-
jvmArgs = listOf("--add-opens=java.desktop/sun.awt.X11=ALL-UNNAMED")
162163
}
163164

164165

buildSrc/build.gradle.kts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ repositories {
1212

1313
dependencies {
1414
//Note: gradle-intellij-plugin 1.5.3 has some bugs with runIde that does not detect changes in kotlin UI DSL
15-
implementation("org.jetbrains.intellij.plugins:gradle-intellij-plugin:1.7.0")
15+
implementation("org.jetbrains.intellij.plugins:gradle-intellij-plugin:1.8.0")
1616
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10")
1717
implementation("com.dorongold.plugins:task-tree:2.1.0")
1818
implementation("com.glovoapp.semantic-versioning:com.glovoapp.semantic-versioning.gradle.plugin:1.1.10")
@@ -29,13 +29,6 @@ kotlin {
2929
}
3030
}
3131

32-
/*
33-
todo: upgrade gradle to 7.5
34-
this warning can be ignored:
35-
'compileJava' task (current target is 11) and 'compileKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
36-
gradle issue:
37-
https://github.com/gradle/gradle/issues/18935
38-
*/
3932

4033
tasks {
4134

Lines changed: 7 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,18 @@
11
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
22
import org.gradle.api.tasks.testing.logging.TestLogEvent
33

4+
//this plugin is for projects that are pure java, meaning they don't have the
5+
//org.jetbrains.intellij plugin.
6+
//for example analytics-provider, model
7+
48
plugins {
59
id("digma-base")
610
`java-library`
711
}
812

913

1014
tasks {
11-
create("buildPlugin") {
12-
//a workaround: if the project is built by calling buildPlugin
13-
// then build is not called for projects that are not intellij plugin project.
14-
dependsOn(build)
15-
}
16-
17-
18-
withType<Test> {
19-
doFirst {
20-
logger.lifecycle("${project.name}:${name}: testing java with {}", javaLauncher.get().executablePath)
21-
}
22-
23-
addTestListener(object : TestListener {
24-
override fun beforeTest(testDescriptor: TestDescriptor) {}
25-
override fun afterTest(testDescriptor: TestDescriptor, result: TestResult) {}
26-
27-
override fun beforeSuite(suite: TestDescriptor) {
28-
if (suite.parent == null) { // root suite
29-
logger.lifecycle("Starting Test suite {}", suite)
30-
}
31-
}
32-
33-
override fun afterSuite(suite: TestDescriptor, result: TestResult) {
34-
if (suite.parent == null) { // root suite
35-
logger.lifecycle(
36-
"Test suite ${suite.name} completed:: ${result.resultType}, " +
37-
"success ${result.successfulTestCount}, " +
38-
"failed ${result.failedTestCount}, " +
39-
"skipped ${result.skippedTestCount}."
40-
)
41-
42-
}
43-
}
44-
})
45-
46-
47-
testLogging {
48-
lifecycle {
49-
events = mutableSetOf(TestLogEvent.FAILED)
50-
exceptionFormat = TestExceptionFormat.SHORT
51-
showExceptions = true
52-
showCauses = true
53-
showStackTraces = false
54-
showStandardStreams = false
55-
}
56-
debug {
57-
events = mutableSetOf(TestLogEvent.FAILED, TestLogEvent.PASSED, TestLogEvent.SKIPPED)
58-
exceptionFormat = TestExceptionFormat.FULL
59-
showExceptions = true
60-
showCauses = true
61-
showStackTraces = true
62-
showStandardStreams = true
63-
}
64-
info.events = debug.events
65-
info.exceptionFormat = debug.exceptionFormat
66-
67-
68-
}
69-
70-
addTestOutputListener { testDescriptor, outputEvent ->
71-
if (outputEvent.destination == TestOutputEvent.Destination.StdErr) {
72-
logger.error("Test: " + testDescriptor + ", error: " + outputEvent.message)
73-
}
74-
}
75-
}
15+
//a workaround: if the project is built by calling buildPlugin
16+
// then build is not called for projects that are not intellij plugin project.
17+
create("buildPlugin").dependsOn(build)
7618
}

0 commit comments

Comments
 (0)