Skip to content

Commit

Permalink
[CALCITE-6174] Replace deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
snuyanzin committed May 19, 2024
1 parent 928491a commit a77f56b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ node('ubuntu') {
withEnv(["Path+JDK=$JAVA_JDK_17/bin","JAVA_HOME=$JAVA_JDK_17"]) {
withCredentials([string(credentialsId: 'SONARCLOUD_TOKEN', variable: 'SONAR_TOKEN')]) {
if ( env.BRANCH_NAME.startsWith("PR-") ) {
sh './gradlew --no-parallel --no-daemon jacocoAggregateTestReport sonar -PenableJacoco -Dsonar.pullrequest.branch=${CHANGE_BRANCH} -Dsonar.pullrequest.base=${CHANGE_TARGET} -Dsonar.pullrequest.key=${CHANGE_ID} -Dsonar.login=${SONAR_TOKEN}'
sh './gradlew --no-parallel --no-daemon jacocoAggregateTestReport sonar -PenableJacoco -Porg.sonarqube.version=4.4.1.3373 -Dsonar.pullrequest.branch=${CHANGE_BRANCH} -Dsonar.pullrequest.base=${CHANGE_TARGET} -Dsonar.pullrequest.key=${CHANGE_ID} -Dsonar.login=${SONAR_TOKEN}'
} else {
sh './gradlew --no-parallel --no-daemon jacocoAggregateTestReport sonar -PenableJacoco -Dsonar.branch.name=${BRANCH_NAME} -Dsonar.login=${SONAR_TOKEN}'
sh './gradlew --no-parallel --no-daemon jacocoAggregateTestReport sonar -PenableJacoco -Porg.sonarqube.version=4.4.1.3373 -Dsonar.branch.name=${BRANCH_NAME} -Dsonar.login=${SONAR_TOKEN}'
}
}
}
Expand Down
11 changes: 7 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import com.github.vlsi.gradle.properties.dsl.props
import com.github.vlsi.gradle.release.RepositoryType
import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis
import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApisExtension
import java.util.Locale
import net.ltgt.gradle.errorprone.errorprone
import org.apache.calcite.buildtools.buildext.dsl.ParenthesisBalancer
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
Expand Down Expand Up @@ -234,7 +235,7 @@ dependencies {
}
if (enableJacoco) {
for (p in subprojects) {
if (!p.name.equals("bom")) {
if (p.name != "bom") {
jacocoAggregation(p)
}
}
Expand Down Expand Up @@ -504,7 +505,7 @@ allprojects {
}

plugins.withType<JavaPlugin> {
configure<JavaPluginConvention> {
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
Expand Down Expand Up @@ -957,9 +958,11 @@ allprojects {
asNode()
}
name.set(
(project.findProperty("artifact.name") as? String) ?: "Calcite ${project.name.capitalize()}"
(project.findProperty("artifact.name") as? String) ?: "Calcite ${project.name.replaceFirstChar {
if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }}"
)
description.set(project.description ?: "Calcite ${project.name.capitalize()}")
description.set(project.description ?: "Calcite ${project.name.replaceFirstChar {
if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }}")
inceptionYear.set("2012")
url.set("https://calcite.apache.org")
licenses {
Expand Down
8 changes: 6 additions & 2 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import com.github.vlsi.gradle.crlf.CrLfSpec
import com.github.vlsi.gradle.crlf.LineEndings
import com.github.vlsi.gradle.ide.dsl.settings
import com.github.vlsi.gradle.ide.dsl.taskTriggers
import java.util.Locale

plugins {
kotlin("jvm")
Expand Down Expand Up @@ -272,15 +273,18 @@ val integTestAll by tasks.registering() {
}

for (db in listOf("h2", "mysql", "oracle", "postgresql")) {
val task = tasks.register("integTest" + db.capitalize(), Test::class) {
val task = tasks.register("integTest" + db.replaceFirstChar { if (it.isLowerCase()) it.titlecase(
Locale.getDefault()) else it.toString() }, Test::class) {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Executes integration JDBC tests with $db database"
include("org/apache/calcite/test/JdbcAdapterTest.class")
include("org/apache/calcite/test/JdbcTest.class")
systemProperty("calcite.test.db", db)
// Include the jars from the custom configuration to the classpath
// otherwise the JDBC drivers for each DBMS will be missing
classpath = classpath + configurations.getAt("test" + db.capitalize())
classpath += configurations.getAt("test" + db.replaceFirstChar {
if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString()
})
}
integTestAll {
dependsOn(task)
Expand Down
4 changes: 2 additions & 2 deletions ubenchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ tasks.withType<JavaExec>().configureEach {
// At best jmh plugin should add the generated directories to the Gradle model, however,
// currently it builds the jar only :-/
// IntelliJ IDEA "execute main method" adds a JavaExec task, so we configure it
classpath(File(buildDir, "jmh-generated-classes"))
classpath(File(buildDir, "jmh-generated-resources"))
classpath(File(layout.buildDirectory.asFile.get(), "jmh-generated-classes"))
classpath(File(layout.buildDirectory.asFile.get(), "jmh-generated-resources"))
}
}

0 comments on commit a77f56b

Please sign in to comment.