2019-02-17 01:27:05 +00:00
|
|
|
plugins {
|
|
|
|
id 'java-library'
|
|
|
|
id 'scala'
|
2024-01-28 12:09:10 +00:00
|
|
|
id 'me.champeau.jmh' version '0.7.2'
|
2019-02-17 01:27:05 +00:00
|
|
|
}
|
2017-11-26 23:20:24 +00:00
|
|
|
|
2014-06-24 05:18:16 +00:00
|
|
|
archivesBaseName = 'i2p'
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
java {
|
|
|
|
srcDir 'java/src'
|
2021-01-03 09:08:21 -05:00
|
|
|
srcDir 'java/build/messages-src'
|
2017-11-27 15:36:09 +00:00
|
|
|
exclude 'gnu/getopt'
|
|
|
|
exclude 'gnu/gettext'
|
2014-06-24 05:18:16 +00:00
|
|
|
}
|
2014-06-26 03:26:32 +00:00
|
|
|
resources {
|
|
|
|
srcDir 'java/src'
|
|
|
|
include 'gnu/getopt/*.properties'
|
|
|
|
}
|
2014-06-24 05:18:16 +00:00
|
|
|
}
|
|
|
|
test {
|
|
|
|
java {
|
|
|
|
srcDir 'java/test/junit'
|
2017-12-02 17:25:09 +00:00
|
|
|
exclude 'net/i2p/AllCoreTests.java'
|
|
|
|
exclude 'net/i2p/data/DataTestSuite.java'
|
|
|
|
exclude 'net/i2p/data/i2cp/I2CPTestSuite.java'
|
2017-12-02 19:35:33 +00:00
|
|
|
exclude {
|
|
|
|
it.name.endsWith('IT.java')
|
|
|
|
}
|
2014-06-24 05:18:16 +00:00
|
|
|
}
|
2017-10-31 12:50:30 +00:00
|
|
|
resources {
|
2019-08-10 17:19:21 +00:00
|
|
|
srcDir 'java/test/resources'
|
2017-10-31 12:50:30 +00:00
|
|
|
}
|
2014-06-24 05:18:16 +00:00
|
|
|
}
|
2019-02-17 09:49:03 +00:00
|
|
|
jmh {
|
|
|
|
java {
|
|
|
|
srcDir 'java/bench'
|
|
|
|
}
|
|
|
|
}
|
2014-06-24 05:18:16 +00:00
|
|
|
}
|
|
|
|
|
2017-11-27 15:36:09 +00:00
|
|
|
dependencies {
|
2024-01-28 12:09:10 +00:00
|
|
|
api 'gnu.getopt:java-getopt:1.0.13'
|
|
|
|
api 'org.gnu.gettext:libintl:0.18.3'
|
2017-12-09 01:43:09 +00:00
|
|
|
|
2019-02-17 15:42:15 +00:00
|
|
|
if (project.hasProperty("with.jbigi")) {
|
|
|
|
runtimeOnly project(path: ':installer', configuration: 'jbigi')
|
|
|
|
}
|
|
|
|
|
2024-01-28 12:09:10 +00:00
|
|
|
// don't use 2.12.4, stack overflow: https://github.com/sbt/zinc/issues/1010
|
|
|
|
testImplementation "org.scala-lang:scala-library:2.12.5"
|
|
|
|
testImplementation 'org.scalatest:scalatest_2.12:3.0.4'
|
2017-12-09 01:43:09 +00:00
|
|
|
}
|
|
|
|
|
2019-02-17 09:30:53 +00:00
|
|
|
if (System.getenv("TARGET_JAVA_HOME") == null && JavaVersion.current() != JavaVersion.VERSION_1_7) {
|
2017-12-09 12:42:52 +00:00
|
|
|
sourceSets {
|
|
|
|
test {
|
|
|
|
scala {
|
|
|
|
srcDir 'java/test/scalatest'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-12-09 02:28:01 +00:00
|
|
|
task scalaTest(dependsOn: ['testClasses'], type: JavaExec) {
|
|
|
|
main = 'org.scalatest.tools.Runner'
|
|
|
|
args = ['-R', 'build/classes/scala/test', '-o']
|
|
|
|
classpath = sourceSets.test.runtimeClasspath
|
|
|
|
}
|
2024-01-28 12:09:10 +00:00
|
|
|
|
2017-12-09 02:28:01 +00:00
|
|
|
test.dependsOn scalaTest
|
2017-11-27 15:36:09 +00:00
|
|
|
}
|
|
|
|
|
2021-01-03 09:08:21 -05:00
|
|
|
// 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 bundle {
|
|
|
|
doLast {
|
2021-01-03 10:35:04 -05:00
|
|
|
if (!(new File("$buildDir/classes/java/main/net/i2p/util/messages_de.class")).exists())
|
|
|
|
println "core/java/bundle-messages.sh".execute().text
|
2021-01-03 09:08:21 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
jar.dependsOn bundle
|
|
|
|
|
2019-04-21 21:01:28 +00:00
|
|
|
jar {
|
|
|
|
manifest {
|
|
|
|
attributes 'Specification-Title': 'I2P Core API'
|
|
|
|
attributes 'Implementation-Title': 'I2P Java Core API'
|
|
|
|
attributes 'Main-Class': 'net.i2p.util.CommandLine'
|
|
|
|
}
|
2021-01-01 10:17:00 -05:00
|
|
|
from ('resources', {
|
|
|
|
into "net/i2p/util/resources"
|
|
|
|
})
|
2019-04-21 21:01:28 +00:00
|
|
|
}
|
|
|
|
|
2014-06-25 02:50:24 +00:00
|
|
|
configurations {
|
|
|
|
tests
|
|
|
|
}
|
|
|
|
task testJar(type: Jar) {
|
2024-01-28 12:09:10 +00:00
|
|
|
archiveBaseName = 'i2p-test'
|
2014-06-25 02:50:24 +00:00
|
|
|
dependsOn classes
|
|
|
|
from sourceSets.test.output
|
|
|
|
}
|
|
|
|
artifacts {
|
|
|
|
tests testJar
|
2014-06-24 05:18:16 +00:00
|
|
|
}
|