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

Fix enum test, add toolchains and running on JDK 21 #3376

Merged
merged 1 commit into from
Dec 1, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests-thorough.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
javaVersion: [ 8, 11, 17 ]
javaVersion: [ 8, 11, 17, 21 ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand Down
4 changes: 4 additions & 0 deletions dokka-integration-tests/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ pluginManagement {
}
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

dependencyResolutionManagement {
repositories {
mavenCentral()
Expand Down
4 changes: 4 additions & 0 deletions dokka-runners/runner-cli/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ pluginManagement {
}
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

dependencyResolutionManagement {
repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ pluginManagement {
}
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

dependencyResolutionManagement {
repositories {
mavenCentral()
Expand Down
4 changes: 4 additions & 0 deletions dokka-runners/runner-maven-plugin/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ pluginManagement {
}
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

dependencyResolutionManagement {
repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,24 @@ class ObviousFunctionsTest {
assertNotNull(enum)
assertEquals("Enum", enum.name)

val javaVersion = when (val specVersion = System.getProperty("java.specification.version")) {
"1.8" -> 8
else -> specVersion.toInt()
}

// inherited from java enum
val jdkEnumInheritedFunctions = when {
// starting from JDK 18, 'finalize' is not available (finalization is deprecated in JDK 18)
javaVersion >= 18 -> setOf("clone", "getDeclaringClass", "describeConstable")
// starting from JDK 12, there is a new member in enum 'describeConstable'
javaVersion >= 12 -> setOf("clone", "getDeclaringClass", "describeConstable", "finalize")
else -> setOf("clone", "getDeclaringClass", "finalize")
}

assertObviousFunctions(
expectedObviousFunctions = emptySet(),
expectedNonObviousFunctions = setOf(
"compareTo", "equals", "hashCode", "toString",
// inherited from java enum
"clone", "finalize", "getDeclaringClass"
),
expectedNonObviousFunctions = setOf("compareTo", "equals", "hashCode", "toString") +
jdkEnumInheritedFunctions,
actualFunctions = enum.functions
)
}
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ dependencyResolutionManagement {

plugins {
`gradle-enterprise`
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

includeBuild("dokka-integration-tests")
Expand Down
Loading