dimas-b commented on code in PR #1287: URL: https://github.com/apache/polaris/pull/1287#discussion_r2023639832
########## extension/persistence/relational-jdbc/build.gradle.kts: ########## @@ -0,0 +1,74 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +fun isValidDep(dep: String): Boolean { + val depRegex = "^[\\w.]+:[\\w\\-.]+:[\\w\\-.]+$".toRegex() + return dep.matches(depRegex) +} + +plugins { + id("polaris-server") + alias(libs.plugins.quarkus) + alias(libs.plugins.jandex) +} + +dependencies { + implementation(project(":polaris-core")) + implementation("org.apache.commons:commons-dbcp2:2.9.0") + + val relationJdbcDeps: String? = project.findProperty("relationalJdbcDeps") as String? + relationJdbcDeps?.let { + val dependenciesList = it.split(",") + dependenciesList.forEach { dep -> + val trimmedDep = dep.trim() + if (isValidDep(trimmedDep)) { + implementation(trimmedDep) + } else { + throw GradleException("Invalid dependency format: $trimmedDep") + } + } + } + + implementation(platform(libs.quarkus.bom)) + implementation("io.quarkus:quarkus-core") Review Comment: Could you clarify why Quarkus Core needs to be included here? (without code it's not easy to deduce :) ) ########## quarkus/server/build.gradle.kts: ########## @@ -51,6 +51,10 @@ dependencies { runtimeOnly(project(":polaris-eclipselink")) } + if (project.hasProperty("relationalJdbcDeps")) { + runtimeOnly(project(":polaris-relational-jdbc")) Review Comment: I'm opposed to conditional dependencies. We should either solidly include it, or not include at all and rely on downstream projects to bundle Postgres Persistence in their builds. I personally think we should _should_ include this dependency unconditionally. ########## extension/persistence/relational-jdbc/build.gradle.kts: ########## @@ -0,0 +1,74 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +fun isValidDep(dep: String): Boolean { + val depRegex = "^[\\w.]+:[\\w\\-.]+:[\\w\\-.]+$".toRegex() + return dep.matches(depRegex) +} + +plugins { + id("polaris-server") + alias(libs.plugins.quarkus) + alias(libs.plugins.jandex) +} + +dependencies { + implementation(project(":polaris-core")) + implementation("org.apache.commons:commons-dbcp2:2.9.0") + + val relationJdbcDeps: String? = project.findProperty("relationalJdbcDeps") as String? + relationJdbcDeps?.let { + val dependenciesList = it.split(",") + dependenciesList.forEach { dep -> + val trimmedDep = dep.trim() + if (isValidDep(trimmedDep)) { + implementation(trimmedDep) Review Comment: repeating here: I'm opposed to conditional dependencies. How do you envision this to be used? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org