build.gradle 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // Gradle build config for Godot Engine's Android port.
  2. plugins {
  3. id 'com.android.application'
  4. id 'org.jetbrains.kotlin.android'
  5. }
  6. dependencies {
  7. implementation libraries.kotlinStdLib
  8. implementation libraries.androidxFragment
  9. implementation project(":lib")
  10. implementation "androidx.window:window:1.0.0"
  11. }
  12. android {
  13. compileSdkVersion versions.compileSdk
  14. buildToolsVersion versions.buildTools
  15. ndkVersion versions.ndkVersion
  16. defaultConfig {
  17. // The 'applicationId' suffix allows to install Godot 3.x(v3) and 4.x(v4) on the same device
  18. applicationId "org.godotengine.editor.v4"
  19. versionCode getGodotLibraryVersionCode()
  20. versionName getGodotLibraryVersionName()
  21. minSdkVersion versions.minSdk
  22. targetSdkVersion versions.targetSdk
  23. missingDimensionStrategy 'products', 'editor'
  24. }
  25. compileOptions {
  26. sourceCompatibility versions.javaVersion
  27. targetCompatibility versions.javaVersion
  28. }
  29. kotlinOptions {
  30. jvmTarget = versions.javaVersion
  31. }
  32. buildTypes {
  33. dev {
  34. initWith debug
  35. applicationIdSuffix ".dev"
  36. }
  37. debug {
  38. initWith release
  39. // Need to swap with the release signing config when this is ready for public release.
  40. signingConfig signingConfigs.debug
  41. }
  42. release {
  43. // This buildtype is disabled below.
  44. // The editor can't be used with target=release only, as debugging tools are then not
  45. // included, and it would crash on errors instead of reporting them.
  46. }
  47. }
  48. packagingOptions {
  49. // 'doNotStrip' is enabled for development within Android Studio
  50. if (shouldNotStrip()) {
  51. doNotStrip '**/*.so'
  52. }
  53. }
  54. // Disable 'release' buildtype.
  55. // The editor can't be used with target=release only, as debugging tools are then not
  56. // included, and it would crash on errors instead of reporting them.
  57. variantFilter { variant ->
  58. if (variant.buildType.name == "release") {
  59. setIgnore(true)
  60. }
  61. }
  62. applicationVariants.all { variant ->
  63. variant.outputs.all { output ->
  64. def suffix = variant.name == "dev" ? "_dev" : ""
  65. output.outputFileName = "android_editor${suffix}.apk"
  66. }
  67. }
  68. }