Skip to content

Commit 199ce36

Browse files
committed
Merge pull request functionaljava#47 from arichiardi/master
Now findJavaCommand in lib.gradle is exposed and it is used by the other .gradle files.
2 parents 79f2905 + bc2b8fb commit 199ce36

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11

2-
import org.apache.tools.ant.taskdefs.condition.Os
3-
42
defaultTasks 'build'
53

64
Boolean doSigning() {

java8/build.gradle

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11

2-
import org.apache.tools.ant.taskdefs.condition.Os
3-
42
jar {
53
baseName "${project.projectName}-${project.name}"
64
}
@@ -15,13 +13,8 @@ dependencies {
1513
}
1614

1715
compileJava {
18-
def jh = System.getenv("JAVA8_HOME")
19-
if (jh == null) {
20-
throw new Exception("JAVA8_HOME environment variable not set")
21-
}
22-
def extension = Os.isFamily(Os.FAMILY_WINDOWS) ? ".exe" : ""
2316
options.fork = true
24-
options.forkOptions.executable = "$jh$extension/bin/javac"
17+
options.forkOptions.executable = findJavaCommand("javac")
2518
}
2619

2720
uploadArchives.enabled = true

lib.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ String findCommand(String dir, String command) {
1010
cmd
1111
}
1212

13-
String findJavaCommand(String s) {
13+
String findJavaCommand(String command) {
1414
def jh = System.getenv("JAVA8_HOME")
1515
if (jh == null) {
1616
throw new Exception("Environment variable JAVA8_HOME not set")
1717
}
18-
findCommand("$jh/bin", s)
18+
findCommand("$jh/bin", command)
1919
}
2020

2121
List<String> projectClasses(List<String> list, String base) {
@@ -36,10 +36,10 @@ def createDynamicJavadoc(String module, List<String> paths) {
3636

3737
ext {
3838
createDynamicJavadoc = this.&createDynamicJavadoc
39+
findJavaCommand = this.&findJavaCommand
3940
}
4041

4142
task java8Javadoc(type: Exec) {
4243
def c = findJavaCommand("javadoc")
4344
commandLine c, "-sourcepath", "$projectDir/src/main/java", "-d", "$buildDir/docs/javadoc", "-subpackages", "fj", "-Xdoclint:none", "-quiet"
44-
}
45-
45+
}

0 commit comments

Comments
 (0)