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

Clean up gradle-profiler build set up #567

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ tasks.test {
.getOrElse(JavaVersion.current().majorVersion)
languageVersion.set(JavaLanguageVersion.of(javaVersion))
providers.gradleProperty("testJavaVendor").map {
when (it.lowercase()) {
when (it.lowercase(Locale.US)) {
"oracle" -> vendor.set(JvmVendorSpec.ORACLE)
"openjdk" -> vendor.set(JvmVendorSpec.ADOPTIUM)
}
Expand Down Expand Up @@ -144,7 +144,7 @@ val testReports = mapOf(
"testHtmlReportWithOps" to "example-with-build-operations",
"testHtmlReportRegression" to "example-regression"
)
testReports.forEach { taskName, fileName ->
testReports.forEach { (taskName, fileName) ->
tasks.register<ProcessResources>(taskName) {
val dataFile = file("src/test/resources/org/gradle/profiler/report/${fileName}.json")
inputs.file(dataFile)
Expand Down
7 changes: 6 additions & 1 deletion buildSrc/src/main/kotlin/profiler.java-library.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ repositories {

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
languageVersion.set(JavaLanguageVersion.of(17))
}
}

tasks.withType<AbstractCompile>().configureEach {
targetCompatibility = "8"
sourceCompatibility = "8"
}

tasks.withType<Test>().configureEach {
// Add OS as inputs since tests on different OS may behave differently https://github.com/gradle/gradle-private/issues/2831
// the version currently differs between our dev infrastructure, so we only track the name and the architecture
Expand Down
6 changes: 3 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ rootProject.children.forEach {
}

/**
* Intellij-gradle-plugin requires Java 11.
* Building gradle-profile requires JDK 17.
*/
fun checkIfCurrentJavaIsCompatible() {
if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) {
throw GradleException("This project should be run with Java 11 or later, but it was run with Java ${JavaVersion.current()}.")
if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
throw GradleException("This project should be build with JDK 17, but it was run with Java ${JavaVersion.current()}.")
}
}
11 changes: 0 additions & 11 deletions subprojects/build-operations/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,3 @@ plugins {
dependencies {
api(gradleApi())
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}

tasks.withType<AbstractCompile>().configureEach {
targetCompatibility = "8"
sourceCompatibility = "8"
}
6 changes: 0 additions & 6 deletions subprojects/studio-agent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ plugins {
id("profiler.embedded-library")
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}

dependencies {
implementation("org.ow2.asm:asm:9.2")
implementation(project(":client-protocol"))
Expand Down
7 changes: 6 additions & 1 deletion subprojects/studio-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ project.configurations

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(17))
}
}

tasks.withType<AbstractCompile>().configureEach {
targetCompatibility = "11"
sourceCompatibility = "11"
}

tasks.test {
useJUnitPlatform()
// Disable IntelliJ file system access check for tests: having this check enabled can fail
Expand Down
Loading