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

Make version compatibility tasks workable #1517

Merged
merged 3 commits into from
Jan 25, 2023
Merged

Conversation

Goooler
Copy link
Member

@Goooler Goooler commented Jan 24, 2023

Comment on lines +45 to +48
tasks.named("check").configure {
dependsOn(tasks.named("testCompatibilityAdapters"))
dependsOn(tasks.named("testCompatibility"))
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +122 to +137
tasks.withType(Test).configureEach {
def jdkVersion = JavaVersion.current().majorVersion.toInteger()
def args = []
if (jdkVersion >= 16) {
// https://docs.gradle.org/7.5/userguide/upgrading_version_7.html#removes_implicit_add_opens_for_test_workers
args += [
"--add-opens=java.base/java.lang=ALL-UNNAMED",
"--add-opens=java.base/java.util=ALL-UNNAMED",
]
}
if (jdkVersion >= 18) {
// https://openjdk.org/jeps/411
args += "-Djava.security.manager=allow"
}
jvmArgs(args)
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run ./gradlew :lib:testCompatKtLint0Dot48Dot0

> Task :lib:testCompatKtLint0Dot48Dot0 FAILED

com.diffplug.spotless.glue.ktlint.compat.KtLintCompat0Dot48Dot0AdapterTest

  Test testEditorConfigCanDisable(Path) PASSED
  Test testDefaults(Path) FAILED

  java.lang.ExceptionInInitializerError
      at com.diffplug.spotless.glue.ktlint.compat.KtLintCompat0Dot48Dot0AdapterTest.testDefaults(KtLintCompat0Dot48Dot0AdapterTest.java:43)
  Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private transient java.lang.Object java.lang.Throwable.backtrace accessible: module java.base does not "opens java.lang" to unnamed module @689349f1
      at com.diffplug.spotless.glue.ktlint.compat.KtLintCompat0Dot48Dot0AdapterTest.testDefaults(KtLintCompat0Dot48Dot0AdapterTest.java:43)


FAILURE: Executed 2 tests in 1s (1 failed)

@Goooler Goooler changed the title Make compatibility tasks workable Make version compatibility tasks workable Jan 24, 2023
@nedtwigg nedtwigg merged commit 33f4abe into diffplug:main Jan 25, 2023
@Goooler Goooler deleted the main branch January 25, 2023 00:58
@Goooler Goooler mentioned this pull request Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants