Skip to content

Commit eab465d

Browse files
committed
[MINOR] Tweak the build scripts for minor errors
1 parent 20718cf commit eab465d

File tree

1 file changed

+78
-55
lines changed

1 file changed

+78
-55
lines changed

build.gradle.kts

+78-55
Original file line numberDiff line numberDiff line change
@@ -82,28 +82,26 @@ project.extra["extraJvmArgs"] = if (extra["jdkVersion"] in listOf("8", "11")) {
8282
listOf(
8383
"-XX:+IgnoreUnrecognizedVMOptions",
8484
"--add-opens", "java.base/java.io=ALL-UNNAMED",
85+
"--add-opens", "java.base/java.lang=ALL-UNNAMED",
8586
"--add-opens", "java.base/java.lang.invoke=ALL-UNNAMED",
8687
"--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED",
87-
"--add-opens", "java.base/java.lang=ALL-UNNAMED",
8888
"--add-opens", "java.base/java.math=ALL-UNNAMED",
8989
"--add-opens", "java.base/java.net=ALL-UNNAMED",
9090
"--add-opens", "java.base/java.nio=ALL-UNNAMED",
9191
"--add-opens", "java.base/java.text=ALL-UNNAMED",
9292
"--add-opens", "java.base/java.time=ALL-UNNAMED",
9393
"--add-opens", "java.base/java.util.concurrent.atomic=ALL-UNNAMED",
9494
"--add-opens", "java.base/java.util.concurrent=ALL-UNNAMED",
95-
"--add-opens", "java.base/java.util.regex=ALL-UNNAMED",
9695
"--add-opens", "java.base/java.util=ALL-UNNAMED",
96+
"--add-opens", "java.base/java.util.regex=ALL-UNNAMED",
9797
"--add-opens", "java.base/jdk.internal.ref=ALL-UNNAMED",
9898
"--add-opens", "java.base/jdk.internal.reflect=ALL-UNNAMED",
9999
"--add-opens", "java.sql/java.sql=ALL-UNNAMED",
100-
"--add-opens", "java.base/sun.util.calendar=ALL-UNNAMED",
101100
"--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED",
102101
"--add-opens", "java.base/sun.nio.cs=ALL-UNNAMED",
103102
"--add-opens", "java.base/sun.security.action=ALL-UNNAMED",
104103
"--add-opens", "java.base/sun.util.calendar=ALL-UNNAMED",
105104
"--add-opens", "java.security.jgss/sun.security.krb5=ALL-UNNAMED",
106-
"--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED"
107105
)
108106
}
109107

@@ -333,8 +331,8 @@ subprojects {
333331
"JavaTimeDefaultTimeZone",
334332
"JdkObsolete",
335333
"LockNotBeforeTry",
336-
"MissingSummary",
337334
"MissingOverride",
335+
"MissingSummary",
338336
"MutableConstantField",
339337
"NonOverridingEquals",
340338
"ObjectEqualsForPrimitives",
@@ -360,7 +358,12 @@ subprojects {
360358
options.locale = "en_US"
361359

362360
val projectName = project.name
363-
if (projectName == "common" || projectName == "api" || projectName == "client-java" || projectName == "client-cli" || projectName == "filesystem-hadoop3") {
361+
if (projectName == "api" ||
362+
projectName == "client-java" ||
363+
projectName == "client-cli" ||
364+
projectName == "common" ||
365+
projectName == "filesystem-hadoop3"
366+
) {
364367
options {
365368
(this as CoreJavadocOptions).addStringOption("Xwerror", "-quiet")
366369
isFailOnError = true
@@ -408,10 +411,10 @@ subprojects {
408411
publishing {
409412
publications {
410413
create<MavenPublication>("MavenJava") {
411-
if (project.name == "web" ||
412-
project.name == "docs" ||
414+
if (project.name == "docs" ||
413415
project.name == "integration-test" ||
414-
project.name == "integration-test-common"
416+
project.name == "integration-test-common" ||
417+
project.name == "web"
415418
) {
416419
setArtifacts(emptyList<Any>())
417420
} else {
@@ -523,44 +526,44 @@ tasks.rat {
523526
val exclusions = mutableListOf(
524527
// Ignore files we track but do not need full headers
525528
"**/.github/**/*",
526-
"dev/docker/**/*.xml",
527-
"dev/docker/**/*.conf",
528-
"dev/docker/kerberos-hive/kadm5.acl",
529529
"**/*.log",
530530
"**/*.out",
531-
"**/trino-ci-testset",
532531
"**/licenses/*.txt",
533532
"**/licenses/*.md",
534-
"docs/**/*.md",
535-
"spark-connector/spark-common/src/test/resources/**",
536-
"web/web/.**",
537-
"web/web/next-env.d.ts",
538-
"web/web/dist/**/*",
539-
"web/web/node_modules/**/*",
540-
"web/web/src/lib/utils/axios/**/*",
541-
"web/web/src/lib/enums/httpEnum.js",
542-
"web/web/src/types/axios.d.ts",
543-
"web/web/yarn.lock",
544-
"web/web/package-lock.json",
545-
"web/web/pnpm-lock.yaml",
546-
"web/web/src/lib/icons/svg/**/*.svg",
547533
"**/LICENSE.*",
548534
"**/NOTICE.*",
549-
"DISCLAIMER_WIP.txt",
535+
"**/trino-ci-testset",
550536
"DISCLAIMER.txt",
537+
"DISCLAIMER_WIP.txt",
551538
"ROADMAP.md",
539+
"clients/cli/src/main/resources/*.txt",
552540
"clients/client-python/.pytest_cache/*",
553-
"clients/client-python/**/__pycache__",
554541
"clients/client-python/.venv/*",
542+
"clients/client-python/**/__pycache__",
555543
"clients/client-python/venv/*",
556544
"clients/client-python/apache_gravitino.egg-info/*",
545+
"clients/client-python/docs/build",
546+
"clients/client-python/docs/source/generated",
557547
"clients/client-python/gravitino/utils/http_client.py",
558548
"clients/client-python/tests/unittests/htmlcov/*",
559549
"clients/client-python/tests/integration/htmlcov/*",
560-
"clients/client-python/docs/build",
561-
"clients/client-python/docs/source/generated",
562-
"clients/cli/src/main/resources/*.txt",
563-
"clients/filesystem-fuse/Cargo.lock"
550+
"clients/filesystem-fuse/Cargo.lock",
551+
"dev/docker/**/*.xml",
552+
"dev/docker/**/*.conf",
553+
"dev/docker/kerberos-hive/kadm5.acl",
554+
"docs/**/*.md",
555+
"spark-connector/spark-common/src/test/resources/**",
556+
"web/web/.**",
557+
"web/web/dist/**/*",
558+
"web/web/next-env.d.ts",
559+
"web/web/node_modules/**/*",
560+
"web/web/package-lock.json",
561+
"web/web/pnpm-lock.yaml",
562+
"web/web/src/lib/enums/httpEnum.js",
563+
"web/web/src/lib/icons/svg/**/*.svg",
564+
"web/web/src/lib/utils/axios/**/*",
565+
"web/web/src/types/axios.d.ts",
566+
"web/web/yarn.lock"
564567
)
565568

566569
// Add .gitignore excludes to the Apache Rat exclusion list.
@@ -593,7 +596,14 @@ tasks {
593596
val outputDir = projectDir.dir("distribution")
594597

595598
val compileDistribution by registering {
596-
dependsOn(":web:web:build", "copySubprojectDependencies", "copyCatalogLibAndConfigs", ":authorizations:copyLibAndConfig", "copySubprojectLib", "iceberg:iceberg-rest-server:copyLibAndConfigs")
599+
dependsOn(
600+
"copyCatalogLibAndConfigs",
601+
"copySubprojectDependencies",
602+
"copySubprojectLib",
603+
":authorizations:copyLibAndConfig",
604+
":iceberg:iceberg-rest-server:copyLibAndConfigs",
605+
":web:web:build",
606+
)
597607

598608
group = "gravitino distribution"
599609
outputs.dir(projectDir.dir("distribution/package"))
@@ -641,7 +651,11 @@ tasks {
641651
doLast {
642652
copy {
643653
from(projectDir.dir("conf")) {
644-
include("${rootProject.name}-iceberg-rest-server.conf.template", "${rootProject.name}-env.sh.template", "log4j2.properties.template")
654+
include(
655+
"${rootProject.name}-iceberg-rest-server.conf.template",
656+
"${rootProject.name}-env.sh.template",
657+
"log4j2.properties.template"
658+
)
645659
into("${rootProject.name}-iceberg-rest-server/conf")
646660
}
647661
from(projectDir.dir("bin")) {
@@ -783,13 +797,20 @@ tasks {
783797

784798
register("copySubprojectDependencies", Copy::class) {
785799
subprojects.forEach() {
786-
if (!it.name.startsWith("catalog") &&
787-
!it.name.startsWith("authorization") &&
800+
if (!it.name.startsWith("authorization") &&
801+
!it.name.startsWith("catalog") &&
788802
!it.name.startsWith("cli") &&
789-
!it.name.startsWith("client") && !it.name.startsWith("filesystem") && !it.name.startsWith("spark") && !it.name.startsWith("iceberg") && it.name != "trino-connector" &&
790-
it.name != "integration-test" && it.name != "bundled-catalog" && !it.name.startsWith("flink") &&
791-
it.name != "integration-test" && it.name != "hive-metastore-common" && !it.name.startsWith("flink") &&
792-
it.parent?.name != "bundles" && it.name != "hadoop-common"
803+
!it.name.startsWith("client") &&
804+
!it.name.startsWith("filesystem") &&
805+
!it.name.startsWith("flink") &&
806+
!it.name.startsWith("iceberg") &&
807+
!it.name.startsWith("spark") &&
808+
it.name != "bundled-catalog" &&
809+
it.name != "hadoop-common" &&
810+
it.name != "hive-metastore-common" &&
811+
it.name != "integration-test" &&
812+
it.name != "trino-connector" &&
813+
it.parent?.name != "bundles"
793814
) {
794815
from(it.configurations.runtimeClasspath)
795816
into("distribution/package/libs")
@@ -799,18 +820,20 @@ tasks {
799820

800821
register("copySubprojectLib", Copy::class) {
801822
subprojects.forEach() {
802-
if (!it.name.startsWith("catalog") &&
803-
!it.name.startsWith("client") &&
823+
if (!it.name.startsWith("authorization") &&
824+
!it.name.startsWith("catalog") &&
804825
!it.name.startsWith("cli") &&
805-
!it.name.startsWith("authorization") &&
826+
!it.name.startsWith("client") &&
806827
!it.name.startsWith("filesystem") &&
807-
!it.name.startsWith("spark") &&
828+
!it.name.startsWith("flink") &&
808829
!it.name.startsWith("iceberg") &&
809830
!it.name.startsWith("integration-test") &&
810-
!it.name.startsWith("flink") &&
831+
!it.name.startsWith("spark") &&
811832
!it.name.startsWith("trino-connector") &&
812833
it.name != "hive-metastore-common" &&
813-
it.name != "docs" && it.name != "hadoop-common" && it.parent?.name != "bundles"
834+
it.name != "docs" &&
835+
it.name != "hadoop-common" &&
836+
it.parent?.name != "bundles"
814837
) {
815838
dependsOn("${it.name}:build")
816839
from("${it.name}/build/libs")
@@ -823,16 +846,16 @@ tasks {
823846

824847
register("copyCatalogLibAndConfigs", Copy::class) {
825848
dependsOn(
849+
":catalogs:catalog-hadoop:copyLibAndConfig",
826850
":catalogs:catalog-hive:copyLibAndConfig",
827-
":catalogs:catalog-lakehouse-iceberg:copyLibAndConfig",
828-
":catalogs:catalog-lakehouse-paimon:copyLibAndConfig",
829-
"catalogs:catalog-lakehouse-hudi:copyLibAndConfig",
830851
":catalogs:catalog-jdbc-doris:copyLibAndConfig",
831852
":catalogs:catalog-jdbc-mysql:copyLibAndConfig",
832853
":catalogs:catalog-jdbc-oceanbase:copyLibAndConfig",
833854
":catalogs:catalog-jdbc-postgresql:copyLibAndConfig",
834-
":catalogs:catalog-hadoop:copyLibAndConfig",
835855
":catalogs:catalog-kafka:copyLibAndConfig",
856+
":catalogs:catalog-lakehouse-hudi:copyLibAndConfig",
857+
":catalogs:catalog-lakehouse-iceberg:copyLibAndConfig",
858+
":catalogs:catalog-lakehouse-paimon:copyLibAndConfig",
836859
":catalogs:catalog-model:copyLibAndConfig"
837860
)
838861
}
@@ -940,7 +963,7 @@ fun checkMacDockerConnector() {
940963
project.extra["macDockerConnector"] = true
941964
}
942965
} catch (e: Exception) {
943-
println("checkContainerRunning command execution failed: ${e.message}")
966+
println("checkContainerRunning failed: ${e.message}")
944967
}
945968
}
946969

@@ -952,10 +975,10 @@ fun checkDockerStatus() {
952975
if (exitCode == 0) {
953976
project.extra["dockerRunning"] = true
954977
} else {
955-
println("checkDockerStatus command execution failed with exit code $exitCode")
978+
println("checkDockerStatus failed with exit code $exitCode")
956979
}
957980
} catch (e: IOException) {
958-
println("checkDockerStatus command execution failed: ${e.message}")
981+
println("checkDockerStatus failed: ${e.message}")
959982
}
960983
}
961984

@@ -972,10 +995,10 @@ fun checkOrbStackStatus() {
972995
println("Current docker context is: $currentContext")
973996
project.extra["isOrbStack"] = currentContext.lowercase().contains("orbstack")
974997
} else {
975-
println("checkOrbStackStatus Command execution failed with exit code $exitCode")
998+
println("checkOrbStackStatus failed with exit code $exitCode")
976999
}
9771000
} catch (e: IOException) {
978-
println("checkOrbStackStatus command execution failed: ${e.message}")
1001+
println("checkOrbStackStatus failed: ${e.message}")
9791002
}
9801003
}
9811004

0 commit comments

Comments
 (0)