config.gradle 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. ext.versions = [
  2. androidGradlePlugin: '3.5.3',
  3. compileSdk : 29,
  4. minSdk : 18,
  5. targetSdk : 29,
  6. buildTools : '29.0.3',
  7. supportCoreUtils : '1.0.0',
  8. kotlinVersion : '1.3.61',
  9. v4Support : '1.0.0'
  10. ]
  11. ext.libraries = [
  12. androidGradlePlugin: "com.android.tools.build:gradle:$versions.androidGradlePlugin",
  13. supportCoreUtils : "androidx.legacy:legacy-support-core-utils:$versions.supportCoreUtils",
  14. kotlinGradlePlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlinVersion",
  15. kotlinStdLib : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$versions.kotlinVersion",
  16. v4Support : "androidx.legacy:legacy-support-v4:$versions.v4Support"
  17. ]
  18. ext.getExportPackageName = { ->
  19. // Retrieve the app id from the project property set by the Godot build command.
  20. String appId = project.hasProperty("export_package_name") ? project.property("export_package_name") : ""
  21. // Check if the app id is valid, otherwise use the default.
  22. if (appId == null || appId.isEmpty()) {
  23. appId = "com.godot.game"
  24. }
  25. return appId
  26. }
  27. final String PLUGIN_VALUE_SEPARATOR_REGEX = "\\|"
  28. /**
  29. * Parse the project properties for the 'plugins_maven_repos' property and return the list
  30. * of maven repos.
  31. */
  32. ext.getGodotPluginsMavenRepos = { ->
  33. Set<String> mavenRepos = []
  34. // Retrieve the list of maven repos.
  35. if (project.hasProperty("plugins_maven_repos")) {
  36. String mavenReposProperty = project.property("plugins_maven_repos")
  37. if (mavenReposProperty != null && !mavenReposProperty.trim().isEmpty()) {
  38. for (String mavenRepoUrl : mavenReposProperty.split(PLUGIN_VALUE_SEPARATOR_REGEX)) {
  39. mavenRepos += mavenRepoUrl.trim()
  40. }
  41. }
  42. }
  43. return mavenRepos
  44. }
  45. /**
  46. * Parse the project properties for the 'plugins_remote_binaries' property and return
  47. * it for inclusion in the build dependencies.
  48. */
  49. ext.getGodotPluginsRemoteBinaries = { ->
  50. Set<String> remoteDeps = []
  51. // Retrieve the list of remote plugins binaries.
  52. if (project.hasProperty("plugins_remote_binaries")) {
  53. String remoteDepsList = project.property("plugins_remote_binaries")
  54. if (remoteDepsList != null && !remoteDepsList.trim().isEmpty()) {
  55. for (String dep: remoteDepsList.split(PLUGIN_VALUE_SEPARATOR_REGEX)) {
  56. remoteDeps += dep.trim()
  57. }
  58. }
  59. }
  60. return remoteDeps
  61. }
  62. /**
  63. * Parse the project properties for the 'plugins_local_binaries' property and return
  64. * their binaries for inclusion in the build dependencies.
  65. */
  66. ext.getGodotPluginsLocalBinaries = { ->
  67. Set<String> binDeps = []
  68. // Retrieve the list of local plugins binaries.
  69. if (project.hasProperty("plugins_local_binaries")) {
  70. String pluginsList = project.property("plugins_local_binaries")
  71. if (pluginsList != null && !pluginsList.trim().isEmpty()) {
  72. for (String plugin : pluginsList.split(PLUGIN_VALUE_SEPARATOR_REGEX)) {
  73. binDeps += plugin.trim()
  74. }
  75. }
  76. }
  77. return binDeps
  78. }