-
Notifications
You must be signed in to change notification settings - Fork 411
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
Fix test runtime Java versions #2918
Merged
IgnatBeresnev
merged 17 commits into
Kotlin:master
from
aSemy:fix/test_runtime_java_version
Mar 16, 2023
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e021943
Fix test runtime Java versions
aSemy c322173
suppress PackageDirectoryMismatch in accessors util
aSemy fcd57d1
rename accessors file
aSemy d5ab847
fix Version typo
aSemy f27fa8c
default testLauncher to mainJavaVersion
aSemy 66eb243
use function references instead of lambdas
aSemy bf47fd9
Remove explicit type arguments
aSemy 379ab75
tidy up comment
aSemy ed31e35
Merge remote-tracking branch 'origin/master' into fix/test_runtime_ja…
aSemy 0dc471f
Update build-logic/src/main/kotlin/org/jetbrains/conventions/base.gra…
aSemy 8337737
Merge branch 'master' into fix/test_runtime_java_version
aSemy 62a38a1
tweak the 'kotlinx.coroutines requires Java 11' fix
aSemy 8f44842
set useJUnitPlatform() in base-java convention
aSemy a586e25
add JUnit engines for both JUnit 4 and 5
aSemy a7c81de
replace `useJUnitPlatform()` with `useJUnit()` - aligning and updatin…
aSemy 8f0ab24
use JUnit Platform & add necessary runtime dependencies
aSemy bb39de7
update TODO comment with more info
aSemy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
buildSrc/src/main/kotlin/org/jetbrains/DokkaBuildProperties.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package org.jetbrains | ||
|
||
import org.gradle.api.provider.Provider | ||
import org.gradle.api.provider.ProviderFactory | ||
import org.gradle.jvm.toolchain.JavaLanguageVersion | ||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion | ||
import javax.inject.Inject | ||
|
||
/** | ||
* Common build properties used to build Dokka subprojects. | ||
* | ||
* This is an extension created by the [org.jetbrains.conventions.Base_gradle] convention plugin. | ||
* | ||
* Default values are set in the root `gradle.properties`, and can be overridden via | ||
* [CLI args, system properties, and environment variables](https://docs.gradle.org/current/userguide/build_environment.html#sec:project_properties) | ||
*/ | ||
abstract class DokkaBuildProperties @Inject constructor( | ||
private val providers: ProviderFactory, | ||
) { | ||
|
||
/** | ||
* The main version of Java that should be used to build Dokka source code. | ||
* | ||
* Updating the Java target is a breaking change. | ||
*/ | ||
val mainJavaVersion: Provider<JavaLanguageVersion> = | ||
dokkaProperty("javaToolchain.mainCompiler") { JavaLanguageVersion.of(it) } | ||
aSemy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/** | ||
* The version of Java that should be used to run Dokka tests. | ||
* | ||
* This value is set in CI/CD environments to make sure that Dokka still works with different | ||
* versions of Java. | ||
*/ | ||
val testJavaLauncherVErsion: Provider<JavaLanguageVersion> = | ||
aSemy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
dokkaProperty("javaToolchain.testLauncher") { JavaLanguageVersion.of(it) } | ||
aSemy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/** | ||
* The Kotlin language level that Dokka artifacts are compiled to support. | ||
* | ||
* Updating the language level is a breaking change. | ||
*/ | ||
val kotlinLanguageLevel: Provider<KotlinVersion> = | ||
dokkaProperty("kotlinLanguageLevel") { KotlinVersion.fromVersion(it) } | ||
aSemy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
private fun <T : Any> dokkaProperty(name: String, convert: (String) -> T) = | ||
providers.gradleProperty("org.jetbrains.dokka.$name").map(convert) | ||
aSemy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
companion object { | ||
const val EXTENSION_NAME = "dokkaBuild" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
buildSrc/src/main/kotlin/org/jetbrains/conventions/base.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
buildSrc/src/main/kotlin/org/jetbrains/internal/accessors.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.gradle.kotlin.dsl | ||
|
||
import org.gradle.api.Project | ||
import org.jetbrains.DokkaBuildProperties | ||
|
||
/* | ||
* Utility functions for accessing Gradle extensions that are created by convention plugins. | ||
* | ||
* (Gradle can't generate the nice DSL accessors for the project that defines them) | ||
* | ||
* These functions should be marked `internal`, because they are not needed outside of the | ||
* convention plugins project. | ||
*/ | ||
|
||
/** | ||
* Retrieves the [dokkaBuild][org.jetbrains.DokkaBuildProperties] extension. | ||
*/ | ||
internal val Project.dokkaBuild: DokkaBuildProperties | ||
get() = extensions.getByType<DokkaBuildProperties>() | ||
|
||
/** | ||
* Configures the [dokkaBuild][org.jetbrains.DokkaBuildProperties] extension. | ||
*/ | ||
internal fun Project.dokkaBuild(configure: DokkaBuildProperties.() -> Unit) = | ||
extensions.configure<DokkaBuildProperties>(configure) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we can stick with Java 17 here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressing the fix to #2938.