167 lines
4.7 KiB
Groovy
167 lines
4.7 KiB
Groovy
plugins {
|
|
alias(catalog.plugins.lombok) apply false
|
|
alias(catalog.plugins.wildfly)
|
|
id 'java-library'
|
|
id 'war'
|
|
id 'maven-publish'
|
|
}
|
|
|
|
import net.woggioni.gradle.wildfly.Deploy2WildflyTask
|
|
|
|
allprojects {
|
|
|
|
pluginManager.withPlugin('java-library') {
|
|
apply plugin: 'net.woggioni.gradle.lombok'
|
|
|
|
lombok {
|
|
version = catalog.versions.lombok.get()
|
|
}
|
|
|
|
tasks.withType(JavaCompile) {
|
|
options.release = 21
|
|
}
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(21)
|
|
}
|
|
}
|
|
|
|
tasks.withType(Test) {
|
|
useJUnitPlatform()
|
|
}
|
|
}
|
|
|
|
group = 'net.woggioni'
|
|
version = getProperty('jpacrepo.version')
|
|
|
|
repositories {
|
|
maven {
|
|
url = 'https://woggioni.net/mvn/'
|
|
content {
|
|
includeGroup 'net.woggioni'
|
|
includeGroup 'com.lys'
|
|
}
|
|
}
|
|
mavenCentral()
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
deployableArchives {
|
|
attributes {
|
|
attribute(
|
|
LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE,
|
|
objects.named(LibraryElements.class, LibraryElements.JAR))
|
|
}
|
|
|
|
transitive = false
|
|
canBeConsumed = false
|
|
visible = false
|
|
canBeResolved = true
|
|
}
|
|
}
|
|
|
|
java {
|
|
modularity.inferModulePath = true
|
|
}
|
|
|
|
dependencies {
|
|
implementation project(':jpacrepo-impl')
|
|
|
|
implementation catalog.jwo
|
|
implementation catalog.slf4j.api
|
|
|
|
providedCompile catalog.jakarta.persistence.api
|
|
providedCompile catalog.jakarta.enterprise.cdi.api
|
|
providedCompile catalog.jakarta.servlet.api
|
|
providedCompile catalog.jakarta.ejb.api
|
|
providedCompile catalog.jakarta.ws.rs.api
|
|
providedCompile catalog.jakarta.xml.bind.api
|
|
providedCompile catalog.jakarta.enterprise.concurrent.api
|
|
|
|
implementation catalog.commons.compress
|
|
implementation catalog.jna
|
|
implementation catalog.liquibase.cdi.jakarta
|
|
|
|
testImplementation catalog.jackson.module.jakarta.xmlbind.annotations
|
|
testImplementation catalog.jboss.ejb.client
|
|
testImplementation catalog.weld.se.core
|
|
// testImplementation catalog.h2
|
|
testImplementation catalog.hibernate.core
|
|
testImplementation catalog.resteasy.client
|
|
testImplementation catalog.resteasy.jackson2.provider
|
|
testImplementation catalog.jackson.datatype.jsr310
|
|
|
|
|
|
testRuntimeOnly catalog.slf4j.simple
|
|
|
|
testImplementation catalog.junit.jupiter.api
|
|
testImplementation catalog.junit.jupiter.params
|
|
|
|
testRuntimeOnly catalog.jakartaee.api
|
|
testRuntimeOnly catalog.junit.jupiter.engine
|
|
testRuntimeOnly group: 'org.glassfish.main.extras', name: 'glassfish-embedded-all', version: '7.0.6'
|
|
|
|
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)
|
|
}
|
|
|
|
Provider<War> warTaskProvider = tasks.named('war', War) { War it ->
|
|
from staticDir
|
|
from nimCompileTaskProvider
|
|
archiveVersion = ''
|
|
}
|
|
|
|
tasks.named('deploy2Wildfly', Deploy2WildflyTask) { d2w ->
|
|
d2w.rpcPort = 9990
|
|
d2w.rpcUsername = 'woggioni'
|
|
// d2w.rpcUsername = 'admin'
|
|
d2w.rpcPassword = '123456'
|
|
}
|
|
|
|
|
|
File warPath = tasks.named("war", War).get().archiveFile.get().getAsFile()
|
|
tasks.named("test", Test) {
|
|
jvmArgs = [
|
|
'--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)
|
|
}
|
|
|
|
publishing {
|
|
repositories {
|
|
maven {
|
|
url = 'https://mvn.woggioni.net/'
|
|
}
|
|
}
|
|
publications {
|
|
maven(MavenPublication) {
|
|
from(components["web"])
|
|
}
|
|
}
|
|
}
|