2019-09-03 02:31:51 +02:00
|
|
|
ext.versions = [
|
2020-10-28 20:43:35 +01:00
|
|
|
androidGradlePlugin: '4.1.0',
|
2020-03-04 18:21:59 +01:00
|
|
|
compileSdk : 29,
|
|
|
|
minSdk : 18,
|
|
|
|
targetSdk : 29,
|
2020-10-28 20:43:35 +01:00
|
|
|
buildTools : '30.0.1',
|
2020-04-16 10:48:53 +02:00
|
|
|
supportCoreUtils : '1.0.0',
|
2020-10-28 20:43:35 +01:00
|
|
|
kotlinVersion : '1.4.10',
|
2020-04-16 10:48:53 +02:00
|
|
|
v4Support : '1.0.0'
|
2019-09-03 02:31:51 +02:00
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
ext.libraries = [
|
2020-03-04 18:21:59 +01:00
|
|
|
androidGradlePlugin: "com.android.tools.build:gradle:$versions.androidGradlePlugin",
|
2020-04-16 10:48:53 +02:00
|
|
|
supportCoreUtils : "androidx.legacy:legacy-support-core-utils:$versions.supportCoreUtils",
|
2020-02-25 17:18:36 +01:00
|
|
|
kotlinGradlePlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlinVersion",
|
2019-10-18 18:59:04 +02:00
|
|
|
kotlinStdLib : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$versions.kotlinVersion",
|
2020-04-16 10:48:53 +02:00
|
|
|
v4Support : "androidx.legacy:legacy-support-v4:$versions.v4Support"
|
2019-09-03 02:31:51 +02:00
|
|
|
]
|
2019-12-13 01:52:57 +01:00
|
|
|
|
|
|
|
ext.getExportPackageName = { ->
|
2020-03-04 18:21:59 +01:00
|
|
|
// Retrieve the app id from the project property set by the Godot build command.
|
|
|
|
String appId = project.hasProperty("export_package_name") ? project.property("export_package_name") : ""
|
|
|
|
// Check if the app id is valid, otherwise use the default.
|
|
|
|
if (appId == null || appId.isEmpty()) {
|
|
|
|
appId = "com.godot.game"
|
|
|
|
}
|
|
|
|
return appId
|
2019-12-13 01:52:57 +01:00
|
|
|
}
|
2019-10-18 18:59:04 +02:00
|
|
|
|
2020-07-23 18:16:03 +02:00
|
|
|
ext.getExportVersionCode = { ->
|
|
|
|
String versionCode = project.hasProperty("export_version_code") ? project.property("export_version_code") : ""
|
|
|
|
if (versionCode == null || versionCode.isEmpty()) {
|
|
|
|
versionCode = "1"
|
|
|
|
}
|
|
|
|
return Integer.parseInt(versionCode)
|
|
|
|
}
|
|
|
|
|
|
|
|
ext.getExportVersionName = { ->
|
|
|
|
String versionName = project.hasProperty("export_version_name") ? project.property("export_version_name") : ""
|
|
|
|
if (versionName == null || versionName.isEmpty()) {
|
|
|
|
versionName = "1.0"
|
|
|
|
}
|
|
|
|
return versionName
|
|
|
|
}
|
|
|
|
|
2020-04-24 09:45:14 +02:00
|
|
|
final String PLUGIN_VALUE_SEPARATOR_REGEX = "\\|"
|
|
|
|
|
2020-07-31 22:48:08 +02:00
|
|
|
// get the list of ABIs the project should be exported to
|
|
|
|
ext.getExportEnabledABIs = { ->
|
|
|
|
String enabledABIs = project.hasProperty("export_enabled_abis") ? project.property("export_enabled_abis") : "";
|
|
|
|
if (enabledABIs == null || enabledABIs.isEmpty()) {
|
|
|
|
enabledABIs = "armeabi-v7a|arm64-v8a|x86|x86_64|"
|
|
|
|
}
|
|
|
|
Set<String> exportAbiFilter = [];
|
|
|
|
for (String abi_name : enabledABIs.split(PLUGIN_VALUE_SEPARATOR_REGEX)) {
|
|
|
|
if (!abi_name.trim().isEmpty()){
|
|
|
|
exportAbiFilter.add(abi_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return exportAbiFilter;
|
|
|
|
}
|
|
|
|
|
|
|
|
ext.getExportPath = {
|
|
|
|
String exportPath = project.hasProperty("export_path") ? project.property("export_path") : ""
|
|
|
|
if (exportPath == null || exportPath.isEmpty()) {
|
|
|
|
exportPath = "."
|
|
|
|
}
|
|
|
|
return exportPath
|
|
|
|
}
|
|
|
|
|
|
|
|
ext.getExportFilename = {
|
|
|
|
String exportFilename = project.hasProperty("export_filename") ? project.property("export_filename") : ""
|
|
|
|
if (exportFilename == null || exportFilename.isEmpty()) {
|
|
|
|
exportFilename = "godot_android"
|
|
|
|
}
|
|
|
|
return exportFilename
|
|
|
|
}
|
|
|
|
|
2019-10-18 18:59:04 +02:00
|
|
|
/**
|
2020-04-24 09:45:14 +02:00
|
|
|
* Parse the project properties for the 'plugins_maven_repos' property and return the list
|
|
|
|
* of maven repos.
|
2019-10-18 18:59:04 +02:00
|
|
|
*/
|
2020-04-24 09:45:14 +02:00
|
|
|
ext.getGodotPluginsMavenRepos = { ->
|
|
|
|
Set<String> mavenRepos = []
|
2019-10-18 18:59:04 +02:00
|
|
|
|
2020-04-24 09:45:14 +02:00
|
|
|
// Retrieve the list of maven repos.
|
|
|
|
if (project.hasProperty("plugins_maven_repos")) {
|
|
|
|
String mavenReposProperty = project.property("plugins_maven_repos")
|
|
|
|
if (mavenReposProperty != null && !mavenReposProperty.trim().isEmpty()) {
|
|
|
|
for (String mavenRepoUrl : mavenReposProperty.split(PLUGIN_VALUE_SEPARATOR_REGEX)) {
|
|
|
|
mavenRepos += mavenRepoUrl.trim()
|
2019-10-18 18:59:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-24 09:45:14 +02:00
|
|
|
return mavenRepos
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Parse the project properties for the 'plugins_remote_binaries' property and return
|
|
|
|
* it for inclusion in the build dependencies.
|
|
|
|
*/
|
|
|
|
ext.getGodotPluginsRemoteBinaries = { ->
|
|
|
|
Set<String> remoteDeps = []
|
|
|
|
|
|
|
|
// Retrieve the list of remote plugins binaries.
|
|
|
|
if (project.hasProperty("plugins_remote_binaries")) {
|
|
|
|
String remoteDepsList = project.property("plugins_remote_binaries")
|
|
|
|
if (remoteDepsList != null && !remoteDepsList.trim().isEmpty()) {
|
|
|
|
for (String dep: remoteDepsList.split(PLUGIN_VALUE_SEPARATOR_REGEX)) {
|
|
|
|
remoteDeps += dep.trim()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return remoteDeps
|
2019-10-18 18:59:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2020-04-24 09:45:14 +02:00
|
|
|
* Parse the project properties for the 'plugins_local_binaries' property and return
|
|
|
|
* their binaries for inclusion in the build dependencies.
|
2019-10-18 18:59:04 +02:00
|
|
|
*/
|
2020-04-24 09:45:14 +02:00
|
|
|
ext.getGodotPluginsLocalBinaries = { ->
|
2020-05-27 21:04:31 +02:00
|
|
|
Set<String> binDeps = []
|
2020-04-24 09:45:14 +02:00
|
|
|
|
|
|
|
// Retrieve the list of local plugins binaries.
|
|
|
|
if (project.hasProperty("plugins_local_binaries")) {
|
|
|
|
String pluginsList = project.property("plugins_local_binaries")
|
|
|
|
if (pluginsList != null && !pluginsList.trim().isEmpty()) {
|
|
|
|
for (String plugin : pluginsList.split(PLUGIN_VALUE_SEPARATOR_REGEX)) {
|
|
|
|
binDeps += plugin.trim()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-10-18 18:59:04 +02:00
|
|
|
|
2020-04-24 09:45:14 +02:00
|
|
|
return binDeps
|
2019-10-18 18:59:04 +02:00
|
|
|
}
|