47 lines
1.4 KiB
Groovy
47 lines
1.4 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
id "net.woggioni.gradle.envelope"
|
|
}
|
|
|
|
import net.woggioni.gradle.envelope.EnvelopeJarTask
|
|
|
|
dependencies {
|
|
|
|
implementation project(':jpacrepo-api')
|
|
implementation group: 'org.slf4j', name: 'slf4j-api'
|
|
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl'
|
|
|
|
runtimeOnly group: 'org.jboss', name: 'jboss-ejb-client'
|
|
|
|
}
|
|
|
|
java {
|
|
modularity.inferModulePath = true
|
|
}
|
|
|
|
tasks.named(JavaPlugin.COMPILE_JAVA_TASK_NAME, JavaCompile) { JavaCompile j ->
|
|
options.javaModuleMainClass = 'net.woggioni.jpacrepo.client.Main'
|
|
// options.compilerArgs += [
|
|
// '--add-reads', 'javax.ejb=ALL-UNNAMED'
|
|
// ]
|
|
}
|
|
|
|
Provider<EnvelopeJarTask> envelopeJarTaskProvider = tasks.named('envelopeJar', EnvelopeJarTask.class) {
|
|
mainClass = 'net.woggioni.jpacrepo.client.Main'
|
|
}
|
|
|
|
tasks.register('run', JavaExec) { JavaExec t ->
|
|
classpath(project.sourceSets.main.output.dirs)
|
|
classpath(project.sourceSets.main.runtimeClasspath)
|
|
mainModule = 'net.woggioni.jpacrepo.client'
|
|
mainClass = 'net.woggioni.jpacrepo.client.Main'
|
|
// String modulePath = project.sourceSets.main.runtimeClasspath.files.stream()
|
|
// .map(File::toString)
|
|
// .collect(Collectors.joining(System.getProperty('path.separator')))
|
|
|
|
// jvmArgs = [
|
|
// '--add-reads', 'net.woggioni.jpacrepo.client=ALL-UNNAMED',
|
|
// '--module-path', modulePath
|
|
// ]
|
|
modularity.inferModulePath = true
|
|
} |