2019-09-03 00:31:51 +00:00
|
|
|
apply from: 'app/config.gradle'
|
2019-04-07 18:46:52 +00:00
|
|
|
|
|
|
|
buildscript {
|
2019-09-03 00:31:51 +00:00
|
|
|
apply from: 'app/config.gradle'
|
|
|
|
|
2019-08-27 09:16:33 +00:00
|
|
|
repositories {
|
|
|
|
google()
|
|
|
|
jcenter()
|
|
|
|
}
|
|
|
|
dependencies {
|
2019-09-03 00:31:51 +00:00
|
|
|
classpath libraries.androidGradlePlugin
|
2019-08-27 09:16:33 +00:00
|
|
|
}
|
2019-04-07 18:46:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
allprojects {
|
|
|
|
repositories {
|
2019-08-27 09:16:33 +00:00
|
|
|
google()
|
|
|
|
jcenter()
|
2019-09-03 00:31:51 +00:00
|
|
|
mavenCentral()
|
2019-04-07 18:46:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-03 00:31:51 +00:00
|
|
|
def binDir = "../../../bin/"
|
2019-04-07 18:46:52 +00:00
|
|
|
|
2019-09-03 00:31:51 +00:00
|
|
|
/**
|
|
|
|
* Copy the generated 'android_debug.apk' binary template into the Godot bin directory.
|
|
|
|
* Depends on the app build task to ensure the binary is generated prior to copying.
|
|
|
|
*/
|
|
|
|
task copyDebugBinaryToBin(type: Copy) {
|
|
|
|
dependsOn ':app:build'
|
|
|
|
from('app/build/outputs/apk/debug')
|
|
|
|
into(binDir)
|
|
|
|
include('android_debug.apk')
|
|
|
|
}
|
2019-08-27 09:16:33 +00:00
|
|
|
|
2019-09-03 00:31:51 +00:00
|
|
|
/**
|
|
|
|
* Copy the generated 'android_release.apk' binary template into the Godot bin directory.
|
|
|
|
* Depends on the app build task to ensure the binary is generated prior to copying.
|
|
|
|
*/
|
|
|
|
task copyReleaseBinaryToBin(type: Copy) {
|
|
|
|
dependsOn ':app:build'
|
|
|
|
from('app/build/outputs/apk/release')
|
|
|
|
into(binDir)
|
|
|
|
include('android_release.apk')
|
|
|
|
}
|
2019-08-27 09:16:33 +00:00
|
|
|
|
2019-09-03 00:31:51 +00:00
|
|
|
/**
|
|
|
|
* Copy the Godot android library archive debug file into the app debug libs directory.
|
|
|
|
* Depends on the library build task to ensure the AAR file is generated prior to copying.
|
|
|
|
*/
|
|
|
|
task copyDebugAAR(type: Copy) {
|
|
|
|
dependsOn ':lib:build'
|
|
|
|
from('lib/build/outputs/aar')
|
|
|
|
into('app/libs/debug')
|
|
|
|
include('godot-lib.debug.aar')
|
|
|
|
}
|
2019-08-27 09:16:33 +00:00
|
|
|
|
2019-09-03 00:31:51 +00:00
|
|
|
/**
|
|
|
|
* Copy the Godot android library archive release file into the app release libs directory.
|
|
|
|
* Depends on the library build task to ensure the AAR file is generated prior to copying.
|
|
|
|
*/
|
|
|
|
task copyReleaseAAR(type: Copy) {
|
|
|
|
dependsOn ':lib:build'
|
|
|
|
from('lib/build/outputs/aar')
|
|
|
|
into('app/libs/release')
|
|
|
|
include('godot-lib.release.aar')
|
|
|
|
}
|
2019-04-07 18:46:52 +00:00
|
|
|
|
2019-09-03 00:31:51 +00:00
|
|
|
/**
|
|
|
|
* Generate Godot custom build template by zipping the source files from the app directory, as well
|
|
|
|
* as the AAR files generated by 'copyDebugAAR' and 'copyReleaseAAR'.
|
|
|
|
* The zip file also includes some gradle tools to allow building of the custom build.
|
|
|
|
*/
|
|
|
|
task zipCustomBuild(type: Zip) {
|
|
|
|
dependsOn 'copyDebugAAR'
|
|
|
|
dependsOn 'copyReleaseAAR'
|
|
|
|
from(fileTree(dir: 'app', excludes: ['**/build/**', '**/.gradle/**', '**/*.iml']), fileTree(dir: '.', includes: ['gradle.properties','gradlew', 'gradlew.bat', 'gradle/**']))
|
|
|
|
include '**/*'
|
|
|
|
archiveName 'android_source.zip'
|
|
|
|
destinationDir(file(binDir))
|
2019-04-07 18:46:52 +00:00
|
|
|
}
|
|
|
|
|
2019-09-03 00:31:51 +00:00
|
|
|
/**
|
|
|
|
* Master task used to coordinate the tasks defined above to generate the set of Godot templates.
|
|
|
|
*/
|
|
|
|
task generateGodotTemplates(type: GradleBuild) {
|
|
|
|
tasks = [
|
|
|
|
// Copy the generated aar library files to the custom build directory.
|
|
|
|
'copyDebugAAR', 'copyReleaseAAR',
|
|
|
|
// Zip the custom build directory.
|
|
|
|
'zipCustomBuild',
|
|
|
|
// Copy the prebuilt binary templates to the bin directory.
|
|
|
|
'copyDebugBinaryToBin', 'copyReleaseBinaryToBin',
|
|
|
|
]
|
|
|
|
}
|