2019-11-29 16:40:02 +00:00
|
|
|
configurations {
|
|
|
|
warArtifact
|
2019-11-30 03:16:10 +00:00
|
|
|
jarArtifact
|
2019-11-29 16:40:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
apply plugin : 'war'
|
|
|
|
|
|
|
|
dependencies {
|
2019-11-30 03:44:57 +00:00
|
|
|
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"
|
|
|
|
})
|
2019-12-05 10:38:24 +00:00
|
|
|
from ('src/main/js', {
|
|
|
|
into "js"
|
|
|
|
})
|
2019-11-29 16:40:02 +00:00
|
|
|
webInf {
|
|
|
|
from "$buildDir/compiledJsps"
|
|
|
|
into "classes"
|
|
|
|
}
|
2019-12-05 10:38:24 +00:00
|
|
|
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",
|
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',
|
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
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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)
|
2019-11-30 13:07:47 +00:00
|
|
|
templateText = templateText.replaceAll("__VERSION__", project.version)
|
2019-11-29 18:00:32 +00:00
|
|
|
def webXml = new File("$buildDir/tmp_jsp/web.xml")
|
|
|
|
webXml.text = templateText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-30 08:28:22 +00:00
|
|
|
precompileJsp.dependsOn compileJava
|
2019-11-29 18:00:32 +00:00
|
|
|
generateWebXML.dependsOn precompileJsp
|
|
|
|
war.dependsOn generateWebXML
|
2019-11-29 16:40:02 +00:00
|
|
|
|
|
|
|
artifacts {
|
|
|
|
warArtifact war
|
2019-11-30 03:16:10 +00:00
|
|
|
jarArtifact jar
|
2019-11-29 16:40:02 +00:00
|
|
|
}
|