-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
1,224 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// taken from https://github.com/melix/mrjar-gradle/blob/master/jdks.gradle | ||
// (c) Cedric Champeau | ||
|
||
String compat(String src) { | ||
if (src.contains('.')) { | ||
src.substring(src.lastIndexOf('.') + 1) | ||
} else { | ||
src | ||
} | ||
} | ||
|
||
// this will configure the java compile tasks with the appropriate JDK | ||
project.afterEvaluate { | ||
tasks.withType(JavaCompile) { | ||
def version = compat(sourceCompatibility) | ||
def jdkHome = System.getenv("JAVA_${version}") | ||
if (!jdkHome) { | ||
println "Warning: Please set path to JDK ${version} using environment variable JAVA_${version}" | ||
println 'Falling back to current JDK' | ||
} else { | ||
options.fork = true | ||
options.forkOptions.javaHome = file(jdkHome) | ||
doFirst { | ||
println "$name compiles using JDK $version" | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
File subdir = new File(rootDir, "subprojects") | ||
rootProject.name = 'ikonli' | ||
|
||
def includeProject = { String projectDirName, String projectName -> | ||
File baseDir = new File(settingsDir, projectDirName) | ||
File projectDir = new File(baseDir, projectName) | ||
String buildFileName = "${projectName}.gradle" | ||
|
||
assert projectDir.isDirectory() | ||
assert new File(projectDir, buildFileName).isFile() | ||
|
||
include projectName | ||
project(":${projectName}").projectDir = projectDir | ||
project(":${projectName}").buildFileName = buildFileName | ||
} | ||
|
||
File subdir = new File(rootDir, 'subprojects') | ||
subdir.eachDir { dir -> | ||
File buildFile = new File(dir, "${dir.name}.gradle") | ||
if (buildFile.exists()) { | ||
include "subprojects/${dir.name}" | ||
includeProject 'subprojects', dir.name | ||
} | ||
} | ||
|
||
rootProject.name = 'ikonli' | ||
rootProject.children.each { project -> | ||
int slash = project.name.indexOf('/') | ||
String fileBaseName = project.name[(slash + 1)..-1] | ||
String projectDirName = project.name | ||
project.name = fileBaseName | ||
project.projectDir = new File(settingsDir, projectDirName) | ||
project.buildFileName = "${fileBaseName}.gradle" | ||
assert project.projectDir.isDirectory() | ||
assert project.buildFile.isFile() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,102 @@ | ||
apply from: rootProject.file('gradle/javafx.gradle') | ||
apply plugin: 'java-library' | ||
apply from: rootProject.file('gradle/jdks.gradle') | ||
|
||
sourceSets { | ||
main { | ||
java { | ||
srcDirs = ['src/main/java'] | ||
} | ||
} | ||
java8 { | ||
java { | ||
srcDirs = ['src/main/java8'] | ||
} | ||
} | ||
java9 { | ||
java { | ||
srcDirs = ['src/main/java9'] | ||
} | ||
} | ||
java8Test { | ||
java { | ||
srcDirs = ['src/test/java8'] | ||
} | ||
} | ||
java9Test { | ||
java { | ||
srcDirs = ['src/test/java9'] | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compileOnly project.files(project.jfxrtLocation) | ||
testCompileOnly project.files(project.jfxrtLocation) | ||
compile project(':ikonli-core') | ||
} | ||
java8Implementation project(':ikonli-core') | ||
java9Implementation project(':ikonli-core') | ||
java8Implementation files(sourceSets.main.output.classesDirs) { builtBy compileJava } | ||
java9Implementation files(sourceSets.main.output.classesDirs) { builtBy compileJava } | ||
|
||
java8TestImplementation 'junit:junit:4.12', | ||
project(':ikonli-core'), | ||
files(sourceSets.main.output.classesDirs), | ||
files(sourceSets.java8.output.classesDirs) | ||
java9TestImplementation 'junit:junit:4.12', | ||
project(':ikonli-core'), | ||
files(sourceSets.main.output.classesDirs), | ||
files(sourceSets.java9.output.classesDirs) | ||
} | ||
|
||
compileJava { | ||
sourceCompatibility = 8 | ||
targetCompatibility = 8 | ||
} | ||
|
||
compileJava8Java { | ||
sourceCompatibility = 8 | ||
targetCompatibility = 8 | ||
} | ||
|
||
compileJava9Java { | ||
sourceCompatibility = 9 | ||
targetCompatibility = 9 | ||
} | ||
|
||
jar { | ||
into('META-INF/versions/9') { | ||
from sourceSets.java9.output | ||
} | ||
into('/') { | ||
from sourceSets.java8.output | ||
} | ||
manifest { | ||
attributes( | ||
'Multi-Release': 'true' | ||
) | ||
} | ||
} | ||
|
||
task testJava8(type: Test, dependsOn: java8Classes) { | ||
testClassesDirs = sourceSets.java8.output.classesDirs | ||
classpath = sourceSets.java8Test.runtimeClasspath | ||
} | ||
|
||
task testJava8Report(type: TestReport, dependsOn: testJava8) { | ||
destinationDir = file("${buildDir}/reports/tests/testJava8") | ||
reportOn testJava8.binResultsDir | ||
} | ||
|
||
testJava8.finalizedBy testJava8Report | ||
check.dependsOn testJava8 | ||
|
||
task testJava9(type: Test, dependsOn: java9Classes) { | ||
testClassesDirs = sourceSets.java9Test.output.classesDirs | ||
classpath = sourceSets.java9Test.runtimeClasspath | ||
} | ||
|
||
task testJava9Report(type: TestReport, dependsOn: testJava9) { | ||
destinationDir = file("${buildDir}/reports/tests/testJava9") | ||
reportOn testJava9.binResultsDir | ||
} | ||
|
||
testJava9.finalizedBy testJava9Report | ||
check.dependsOn testJava9 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.