Skip to content

Commit

Permalink
Upgrade gradle to v8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
alancai98 committed Apr 22, 2024
1 parent d3961ac commit a4b4ac0
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 27 deletions.
5 changes: 4 additions & 1 deletion buildSrc/src/main/kotlin/partiql.conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ java {

tasks.test {
useJUnitPlatform() // Enable JUnit5
jvmArgs.addAll(listOf("-Duser.language=en", "-Duser.country=US"))
jvmArgs(
"-Duser.language=en",
"-Duser.country=US"
)
maxHeapSize = "4g"
testLogging {
events.add(TestLogEvent.FAILED)
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/partiql.versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ object Versions {

// Testing
const val assertj = "3.11.0"
const val jacoco = "0.8.8"
const val jacoco = "0.8.11"
const val junit5 = "5.9.3"
const val junit5PlatformLauncher = "1.9.3"
const val junit4 = "4.12"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 0 additions & 6 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,6 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
14 changes: 6 additions & 8 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%"=="" @echo off
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,15 +75,13 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
17 changes: 15 additions & 2 deletions partiql-parser/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,21 @@ tasks.compileKotlin {
dependsOn(tasks.generateGrammarSource)
}

tasks.findByName("sourcesJar")?.apply {
dependsOn(tasks.generateGrammarSource)
tasks.compileTestKotlin {
dependsOn(tasks.withType<AntlrTask>())
}

tasks.withType<Jar>().configureEach {
// ensure "generateGrammarSource" is called before "sourcesJar".
dependsOn(tasks.withType<AntlrTask>())
}

tasks.withType<org.jetbrains.dokka.gradle.DokkaTask>().configureEach {
dependsOn(tasks.withType<AntlrTask>())
}

tasks.runKtlintCheckOverTestSourceSet {
dependsOn(tasks.withType<AntlrTask>())
}

tasks.processResources {
Expand Down
45 changes: 37 additions & 8 deletions partiql-planner/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,48 @@ tasks.register<Copy>("copyUtils") {
//
// !! IMPORTANT !! — only run manually, as this will overwrite the existing ir/Nodes.kt.
//
tasks.register<Copy>("copyNodes") {
includeEmptyDirs = false
dependsOn("codegen")
filter { it.replace(Regex("public (?!(override|(fun visit)))"), "internal ") }
from("$buildDir/tmp")
include("**/Nodes.kt")
into("src/main/kotlin")
}
// tasks.register<Copy>("copyNodes") {
// includeEmptyDirs = false
// dependsOn("codegen")
// filter { it.replace(Regex("public (?!(override|(fun visit)))"), "internal ") }
// from("$buildDir/tmp")
// include("**/Nodes.kt")
// into("src/main/kotlin")
// }

tasks.register("generate") {
dependsOn("codegen", "copyUtils")
}

tasks.compileKotlin {
dependsOn("generate")
dependsOn(tasks.withType<Copy>())
}

tasks.filte

tasks.withType<org.jlleitschuh.gradle.ktlint.tasks.KtLintFormatTask>().configureEach {
dependsOn(tasks.withType<Copy>())
}

tasks.withType<org.jlleitschuh.gradle.ktlint.tasks.KtLintCheckTask>().configureEach {
dependsOn(tasks.withType<Copy>())
}

tasks.withType<Jar>().configureEach {
dependsOn(tasks.withType<Copy>())
}

tasks.detekt {
dependsOn(tasks.withType<Copy>())
}

tasks.withType<org.jetbrains.dokka.gradle.DokkaTask>().configureEach {
dependsOn(tasks.withType<Copy>())
}

configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
filter {
exclude { it.file.path.contains("Nodes.kt") }
}
}

0 comments on commit a4b4ac0

Please sign in to comment.