2019-11-29 16:40:02 +00:00
|
|
|
configurations {
|
|
|
|
warArtifact
|
|
|
|
}
|
|
|
|
|
|
|
|
apply plugin : 'war'
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
providedCompile project(':core')
|
2019-11-29 16:49:44 +00:00
|
|
|
compile fileTree("../i2pjars") { include '*.jar' }
|
2019-11-29 16:40:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
war {
|
|
|
|
webInf {
|
|
|
|
from "$buildDir/compiledJsps"
|
|
|
|
into "classes"
|
|
|
|
}
|
|
|
|
excludes = new HashSet(['**/*.jsp'])
|
|
|
|
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',
|
|
|
|
uriroot: webAppDir,
|
|
|
|
outputDir: "$buildDir/tmp_jsp",
|
|
|
|
compilerSourceVM: "1.8",
|
|
|
|
compilerTargetVM: "1.8",
|
2019-11-29 18:00:32 +00:00
|
|
|
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',
|
|
|
|
destDir:file("$buildDir/compiledJsps"),
|
|
|
|
classpath: configurations.compile.asPath)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-29 18:00:32 +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)
|
|
|
|
def webXml = new File("$buildDir/tmp_jsp/web.xml")
|
|
|
|
webXml.text = templateText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
generateWebXML.dependsOn precompileJsp
|
|
|
|
war.dependsOn generateWebXML
|
2019-11-29 16:40:02 +00:00
|
|
|
|
|
|
|
artifacts {
|
|
|
|
warArtifact war
|
|
|
|
}
|