You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.9 KiB
39 lines
1.9 KiB
if (!hasProperty('mainClass')) {
|
|
ext.mainClass = ''
|
|
}
|
|
|
|
String classBuildDir = "${buildDir}" + File.separator + 'classes'
|
|
|
|
sourceSets {
|
|
main {
|
|
java {
|
|
srcDir 'src/main/java'
|
|
srcDir 'src/common/java'
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compile project(':jme3-core')
|
|
compile project(':jme3-terrain')
|
|
}
|
|
|
|
task generateNativeHeaders(type: Exec, dependsOn: classes) {
|
|
def files0 = fileTree("src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
|
|
def files1 = fileTree("src/common/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
|
|
def files2 = fileTree("../jme3-core/src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
|
|
def files3 = fileTree("../jme3-core/src/plugins/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
|
|
def files4 = fileTree("../jme3-core/src/tools/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
|
|
def files5 = fileTree("../jme3-terrain/src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
|
|
def classpath = sourceSets.main.runtimeClasspath.asPath
|
|
def nativeIncludes = new File(project(":jme3-bullet-native").projectDir, "src/native/cpp")
|
|
def filesList = "\"" + files0.join("\"\n\"") + "\"\n\"" + files1.join("\"\n\"") + "\"\n\"" + files2.join("\"\n\"") + "\"\n\"" + files3.join("\"\n\"") + "\"\n\"" + files4.join("\"\n\"") + "\"\n\"" + files5.join("\"\n\"") + "\""
|
|
new File("$projectDir/java_classes.jtxt").text = filesList.replaceAll(java.util.regex.Pattern.quote("\\"), java.util.regex.Matcher.quoteReplacement("/"))
|
|
executable org.gradle.internal.jvm.Jvm.current().getExecutable('javac')
|
|
args "-h", nativeIncludes
|
|
args "@$projectDir/java_classes.jtxt"
|
|
args '-d', classBuildDir
|
|
args "-encoding", "UTF-8"
|
|
}
|
|
|
|
assemble.dependsOn(generateNativeHeaders) |