working version with new Kotlin frontend!!!

This commit is contained in:
2024-02-21 08:52:00 +08:00
parent d4306555df
commit b14862fc7d
20 changed files with 828 additions and 191 deletions

View File

@@ -60,6 +60,13 @@ configurations {
visible = false
canBeResolved = true
}
frontend {
transitive = false
canBeConsumed = false
visible = false
canBeResolved = true
}
}
java {
@@ -106,23 +113,12 @@ dependencies {
deployableArchives project
deployableArchives project(':jpacrepo-impl')
deployableArchives project(':jpacrepo-api')
}
File nimDir = project.file('nim')
File srcDir = new File(nimDir, 'src')
File staticDir = new File(nimDir, 'static')
Provider<Exec> nimCompileTaskProvider = tasks.register("compileNim", Exec) {
inputs.files(project.fileTree(srcDir), project.fileTree(staticDir))
File outputFile = new File(temporaryDir, "jpacrepo.js")
outputs.file(outputFile)
commandLine 'nim', 'js', '-d:release', "-o:$outputFile", 'src/jpacrepo.nim'
workingDir(nimDir)
frontend project(path: ':jpacrepo-frontend', configuration: 'tar')
}
Provider<War> warTaskProvider = tasks.named('war', War) { War it ->
from staticDir
from nimCompileTaskProvider
from(configurations.frontend)
archiveVersion = ''
}
@@ -140,14 +136,7 @@ tasks.named("test", Test) {
'--add-opens', 'java.naming/javax.naming.spi=ALL-UNNAMED',
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
'--add-opens', 'java.base/java.io=ALL-UNNAMED',
// '--add-opens', 'java.base/java.util=ALL-UNNAMED',
// '--add-opens', 'java.management/javax.management.openmbean=ALL-UNNAMED',
// '--add-opens', 'java.management/javax.management=ALL-UNNAMED',
]
// classpath = configurations.testRuntimeClasspath + sourceSets.test.output
// File warPath = tasks.named("war", War).get().archiveFile.get().getAsFile()
// classpath += warPath
// classpath += tasks.named("war", War).get().outputs.files
inputs.files(configurations.deployableArchives)
systemProperty('jpacrepo.jar.path', configurations.deployableArchives.asPath)
}