Files
muwire/webui/build.gradle

77 lines
2.1 KiB
Groovy
Raw Normal View History

2019-11-29 16:40:02 +00:00
configurations {
warArtifact
jarArtifact
2019-11-29 16:40:02 +00:00
}
apply plugin : 'war'
dependencies {
providedCompile(project(':core')) {
transitive = false
}
2019-11-29 16:49:44 +00:00
compile fileTree("../i2pjars") { include '*.jar' }
2019-11-29 16:40:02 +00:00
}
war {
2019-12-04 11:27:08 +00:00
from 'src/main/css'
2019-12-04 19:15:07 +00:00
from ('src/main/images', {
into "images"
})
from ('src/main/js', {
into "js"
})
2019-11-29 16:40:02 +00:00
webInf {
from "$buildDir/compiledJsps"
into "classes"
}
excludes = new HashSet(['**/*.jsp', '**/*.jsi'])
2019-11-29 16:40:02 +00:00
webXml = file("$buildDir/tmp_jsp/web.xml")
}
task precompileJsp {
doLast {
ant.taskdef (name : 'jasper',
classname: 'org.apache.jasper.JspC',
classpath: configurations.compile.asPath)
def generated = new File("$buildDir/tmp_jsp")
generated.mkdirs()
ant.jasper(package: 'com.muwire.webui',
2019-11-30 08:28:22 +00:00
classPath : sourceSets.main.runtimeClasspath.asPath,
2019-11-29 16:40:02 +00:00
uriroot: webAppDir,
outputDir: "$buildDir/tmp_jsp",
compilerSourceVM: "1.8",
compilerTargetVM: "1.8",
webXmlFragment: "$buildDir/tmp_jsp/web.xml.jasper")
2019-11-29 16:40:02 +00:00
def output = new File("$buildDir/compiledJsps")
output.mkdirs()
ant.javac(srcDir: 'build/tmp_jsp',
2019-11-30 08:28:22 +00:00
classPath : sourceSets.main.runtimeClasspath.asPath,
2019-12-04 19:37:58 +00:00
debug : true,
2019-12-07 12:18:01 +00:00
includeAntRuntime : false,
deprecation : "on",
2019-11-30 08:28:22 +00:00
destDir:file("$buildDir/compiledJsps"))
2019-11-29 16:40:02 +00:00
}
}
task generateWebXML {
doLast {
def template = new File("$projectDir/templates/web.xml.template")
def templateText = template.text
def jasper = new File("$buildDir/tmp_jsp/web.xml.jasper")
templateText = templateText.replaceAll("__JASPER__", jasper.text)
templateText = templateText.replaceAll("__VERSION__", project.version)
def webXml = new File("$buildDir/tmp_jsp/web.xml")
webXml.text = templateText
}
}
2019-11-30 08:28:22 +00:00
precompileJsp.dependsOn compileJava
generateWebXML.dependsOn precompileJsp
war.dependsOn generateWebXML
2019-11-29 16:40:02 +00:00
artifacts {
warArtifact war
jarArtifact jar
2019-11-29 16:40:02 +00:00
}