Skip to content

Commit

Permalink
fixed mutually exclusive flags
Browse files Browse the repository at this point in the history
  • Loading branch information
dorav committed Nov 21, 2023
1 parent 878cfd6 commit ba89cf5
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/main/kotlin/HibernateProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -193,27 +193,28 @@ abstract class SchemaTask : JavaExec() {

@TaskAction
override fun exec() {
val scannedClasspath = this.scannedClasspath.asFileTree
.filter { f ->
packages.isEmpty() || packages.any { packageName ->
f.toPath().parent.endsWith(packageName)
}
}
.map { it.toPath().parent.toUri() }
.toSet()
val args = mutableListOf<String>()
if (scannedClasspath.isNotEmpty()) {
args += listOf("--packages", scannedClasspath.map {
it.toString().toBase64()
}.joinToString(","))
}
if (classes.isNotEmpty()) {
args += listOf("--classes", classes.joinToString(","))
}
if (registryBuilderClass.isNotEmpty()) {
args += listOf("--registry-builder", registryBuilderClass)
}
if (metadataBuilderClass.isNotEmpty()) {
if (classes.isNotEmpty()) {
args += listOf("--classes", classes.joinToString(","))
}
val scannedClasspath = this.scannedClasspath.asFileTree
.filter { f ->
packages.isEmpty() || packages.any { packageName ->
f.toPath().parent.endsWith(packageName)
}
}
.map { it.toPath().parent.toUri() }
.toSet()
if (scannedClasspath.isNotEmpty()) {
args += listOf("--packages", scannedClasspath.map {
it.toString().toBase64()
}.joinToString(","))
}
} else {
args += listOf("--metadata-builder", metadataBuilderClass)
}
if (propertiesFile.isNotEmpty()) {
Expand Down

0 comments on commit ba89cf5

Please sign in to comment.