- proper Java 7 cross-compilation support
This commit is contained in:
Radovan Panak 2018-03-08 16:08:05 +01:00
parent d05401c8ca
commit 7a047649b1
4 changed files with 25 additions and 20 deletions

View File

@ -21,6 +21,31 @@ allprojects {
dirs repoDir
}
}
//cross-compilation stuff for Java 7
assert (System.env.JDK_7_HOME != null): "Set environment property JDK_7_HOME"
project.ext.targetJavaHome = System.env.JDK_7_HOME
def javaExecutablesPath = new File(targetJavaHome, 'bin')
def javaExecutables = [:].withDefault { execName ->
def executable = new File(javaExecutablesPath, execName)
assert executable.exists(): "There is no ${execName} executable in ${javaExecutablesPath}"
executable
}
tasks.withType(JavaCompile) {
sourceCompatibility = '1.7'
options.with {
fork = true
forkOptions.javaHome = file(targetJavaHome)
}
}
tasks.withType(Javadoc) {
executable = javaExecutables.javadoc
}
tasks.withType(Test) {
executable = javaExecutables.java
}
tasks.withType(JavaExec) {
executable = javaExecutables.java
}
}
ext.with {

View File

@ -6,11 +6,6 @@ jar {
baseName 'batm_server_extensions_api'
}
dependencies {
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
}
distributions {
main {
contents {

View File

@ -18,9 +18,6 @@ artifacts {
}
dependencies {
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
compile project(':server_extensions_api');
compile(group: 'com.azazar', name: 'bitcoin-json-rpc-client', version: '1.0')
compile(group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25')
@ -33,13 +30,6 @@ dependencies {
compile(group: 'com.google.zxing', name: 'core', version: '2.3.0')
compile(group: 'org.knowm.xchange', name: 'xchange-bitfinex', version: '4.2.1')
compile(group: 'org.knowm.xchange', name: 'xchange-itbit', version: '4.2.1')
// compile(group: 'net.iharder', name: 'base64', version: '2.3.9')
// compile(group: 'commons-io', name: 'commons-io', version: '2.4')
// compile(group: 'org.knowm.xchange', name: 'xchange-bitrex', version: '4.2.1')
// compile(group: 'org.knowm.xchange', name: 'xchange-poloniex', version: '4.2.1')
// compile(group: 'oauth.signpost', name: 'signpost-core', version: '1.2.1.2')
// compile(group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.4.0')
// compile(group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.4.0')
}
dependencySubstitutions {

View File

@ -8,11 +8,6 @@ jar {
baseName 'batm_server_extensions_test'
}
dependencies {
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
}
dependencies {
compile project(':server_extensions_api');
compile project(':server_extensions_extra');