config.gradle 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ext.versions = [
  2. androidGradlePlugin: '3.5.3',
  3. compileSdk : 29,
  4. minSdk : 18,
  5. targetSdk : 29,
  6. buildTools : '29.0.1',
  7. supportCoreUtils : '28.0.0',
  8. kotlinVersion : '1.3.61',
  9. v4Support : '28.0.0'
  10. ]
  11. ext.libraries = [
  12. androidGradlePlugin: "com.android.tools.build:gradle:$versions.androidGradlePlugin",
  13. supportCoreUtils : "com.android.support: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 : "com.android.support: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. /**
  28. * Parse the project properties for the 'custom_template_plugins' property and return
  29. * their binaries for inclusion in the build dependencies.
  30. *
  31. * The listed plugins must have their binaries in the project plugins directory.
  32. */
  33. ext.getGodotPluginsBinaries = { ->
  34. String[] binDeps = []
  35. // Retrieve the list of enabled plugins.
  36. if (project.hasProperty("custom_template_plugins")) {
  37. String pluginsList = project.property("custom_template_plugins")
  38. if (pluginsList != null && !pluginsList.trim().isEmpty()) {
  39. for (String plugin : pluginsList.split(",")) {
  40. binDeps += plugin.trim() + "*.aar"
  41. }
  42. }
  43. }
  44. return binDeps
  45. }
  46. /**
  47. * Parse the project properties for the 'custom_template_plugins_dir' property and return
  48. * its value.
  49. *
  50. * The returned value is the directory containing user plugins.
  51. */
  52. ext.getGodotPluginsDirectory = { ->
  53. // The plugins directory is provided by the 'custom_template_plugins_dir' property.
  54. String pluginsDir = project.hasProperty("custom_template_plugins_dir")
  55. ? project.property("custom_template_plugins_dir")
  56. : ""
  57. return pluginsDir
  58. }