forked from I2P_Developers/i2p.i2p
103 lines
3.3 KiB
Groovy
103 lines
3.3 KiB
Groovy
plugins {
|
|
id 'war'
|
|
id 'scala'
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
java {
|
|
srcDir 'java/src'
|
|
srcDir 'java/build/messages-src'
|
|
srcDir 'java/build/messages-countries-src'
|
|
srcDir 'java/build/messages-news-src'
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compile project(':core')
|
|
compile project(':router')
|
|
compile project(':installer')
|
|
providedCompile project(':apps:desktopgui')
|
|
providedCompile project(':apps:systray')
|
|
providedCompile project(':apps:jetty')
|
|
providedCompile project(':apps:jrobin')
|
|
|
|
testCompile "org.scala-lang:scala-library:2.12.4"
|
|
testCompile 'org.scalatest:scalatest_2.12:3.0.4'
|
|
}
|
|
|
|
if (System.getenv("TARGET_JAVA_HOME") == null && JavaVersion.current() != JavaVersion.VERSION_1_7) {
|
|
sourceSets {
|
|
test {
|
|
scala {
|
|
srcDir 'java/test/scalatest'
|
|
}
|
|
}
|
|
}
|
|
task scalaTest(dependsOn: ['testClasses'], type: JavaExec) {
|
|
main = 'org.scalatest.tools.Runner'
|
|
args = ['-R', 'build/classes/scala/test', '-o']
|
|
classpath = sourceSets.test.runtimeClasspath
|
|
}
|
|
test.dependsOn scalaTest
|
|
}
|
|
|
|
// Create the java files from the po files. The jar task will compile them.
|
|
// This requires gettext 0.19 or higher.
|
|
// We don't support the "slow way"
|
|
task bundleJar {
|
|
doLast {
|
|
if (!(new File("$buildDir/classes/java/main/net/i2p/router/countries/messages_de.class")).exists())
|
|
println "apps/routerconsole/java/bundle-messages-countries.sh".execute().text
|
|
if (!(new File("$buildDir/classes/java/main/net/i2p/router/news/messages_de.class")).exists())
|
|
println "apps/routerconsole/java/bundle-messages-news.sh".execute().text
|
|
}
|
|
}
|
|
task bundle {
|
|
doLast {
|
|
if (!(new File("$buildDir/classes/java/main/net/i2p/router/web/messages_de.class")).exists())
|
|
println "apps/routerconsole/java/bundle-messages.sh".execute().text
|
|
}
|
|
}
|
|
|
|
task consoleJar(type: Jar) {
|
|
from sourceSets.main.output
|
|
exclude 'net/i2p/router/web/helpers/**'
|
|
manifest {
|
|
// Top level installer will rename to jrobin.jar
|
|
// DTG added in 0.8.4, not in the classpath for very old installs,
|
|
// before we changed wrapper.config to specify *
|
|
// very old installs don't have i2psnark,jstl,standard in the classpath...
|
|
// not added in WebAppConfiguration any more
|
|
// All new jetty 7 jars should have been in 0.9.6, added in 0.9.7
|
|
attributes 'Class-Path': 'i2p.jar router.jar jrobin.jar desktopgui.jar i2psnark.jar jstl.jar standard.jar jetty-continuation.jar jetty-http.jar jetty-io.jar jetty-security.jar jetty-servlet.jar jetty-servlets.jar jetty-util.jar jetty-webapp.jar'
|
|
}
|
|
from ('resources-news', {
|
|
into "net/i2p/router/news/resources"
|
|
})
|
|
}
|
|
consoleJar.dependsOn bundleJar
|
|
war.dependsOn bundle
|
|
|
|
artifacts {
|
|
archives consoleJar
|
|
}
|
|
|
|
war {
|
|
rootSpec.exclude('/com/vuze/**/*')
|
|
rootSpec.exclude('/edu/internet2/**/*')
|
|
rootSpec.exclude('/net/i2p/router/news/*')
|
|
rootSpec.exclude('/net/i2p/router/sybil/*')
|
|
rootSpec.exclude('/net/i2p/router/update/*')
|
|
rootSpec.exclude('/net/i2p/router/web/*.class')
|
|
from 'jsp'
|
|
exclude 'jsp/web.xml'
|
|
exclude '*.jsi'
|
|
exclude '*.jsp'
|
|
webXml = file('jsp/web.xml')
|
|
from ('resources', {
|
|
into "WEB-INF/classes/net/i2p/router/web/resources"
|
|
})
|
|
}
|