Major refactoring of the gradle build system.

This commit is contained in:
ghidravore
2019-04-09 11:59:17 -04:00
parent 62a180e0ae
commit f1e50fb079
198 changed files with 2005 additions and 2252 deletions

View File

@@ -110,7 +110,7 @@ def isNativeBinaryMakeTask(Task task, String platform) {
******************************************************************************************/
tasks.addRule("Pattern: buildNatives_<platform name>]: build all natives for given platform") { String taskName ->
if (taskName.startsWith("buildNatives_") && !project.hasProperty('EXCLUDE_FROM_NATIVE_BUILD')) {
if (taskName.startsWith("buildNatives_")) {
String platform = taskName - "buildNatives_"
task(taskName) { myTask ->
@@ -180,3 +180,25 @@ tasks.addRule("Pattern: prebuildNatives_<platform name>]: build all natives for
}
}
}
/*****************************************************************************************
* The following block of code changes the output directory for native builds
* to <projectDir>/build/os/<platform>/<executable> ?? is there a better way to do this?
****************************************************************************************/
gradle.taskGraph.whenReady {
def p = this.project
p.tasks.withType(LinkExecutable).each { t ->
File f = t.linkedFile.getAsFile().get()
String filename = f.getName()
NativePlatform platform = t.targetPlatform.get()
String osName = platform.getName()
t.linkedFile = p.file("build/os/${osName}/$filename")
}
p.tasks.withType(LinkSharedLibrary).each { t ->
File f = t.linkedFile.getAsFile().get()
String filename = f.getName()
NativePlatform platform = t.targetPlatform.get()
String osName = platform.getName()
t.linkedFile = p.file("build/os/${osName}/$filename")
}
}