build.gradle 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. plugins {
  2. id 'com.android.application'
  3. id 'org.jetbrains.kotlin.android'
  4. }
  5. /**
  6. * Use the number of seconds/10 since Jan 1 2016 as the versionCode.
  7. * This lets us upload a new build at most every 10 seconds for the
  8. * next 680 years.
  9. */
  10. def autoVersion = (int) (((new Date().getTime() / 1000) - 1451606400) / 10)
  11. def buildType
  12. android {
  13. namespace 'org.yuzu.yuzu_emu'
  14. compileSdkVersion 33
  15. ndkVersion "25.2.9519653"
  16. compileOptions {
  17. sourceCompatibility JavaVersion.VERSION_11
  18. targetCompatibility JavaVersion.VERSION_11
  19. }
  20. kotlinOptions {
  21. jvmTarget = '11'
  22. }
  23. lint {
  24. // This is important as it will run lint but not abort on error
  25. // Lint has some overly obnoxious "errors" that should really be warnings
  26. abortOnError false
  27. //Uncomment disable lines for test builds...
  28. //disable 'MissingTranslation'bin
  29. //disable 'ExtraTranslation'
  30. }
  31. defaultConfig {
  32. // TODO If this is ever modified, change application_id in strings.xml
  33. applicationId "org.yuzu.yuzu_emu"
  34. minSdkVersion 28
  35. targetSdkVersion 33
  36. versionCode autoVersion
  37. versionName getVersion()
  38. ndk.abiFilters "arm64-v8a", "x86_64"
  39. }
  40. signingConfigs {
  41. //release {
  42. // storeFile file('')
  43. // storePassword System.getenv('ANDROID_KEYPASS')
  44. // keyAlias = 'key0'
  45. // keyPassword System.getenv('ANDROID_KEYPASS')
  46. //}
  47. }
  48. applicationVariants.all { variant ->
  49. buildType = variant.buildType.name // sets the current build type
  50. }
  51. // Define build types, which are orthogonal to product flavors.
  52. buildTypes {
  53. // Signed by release key, allowing for upload to Play Store.
  54. release {
  55. signingConfig signingConfigs.debug
  56. }
  57. // builds a release build that doesn't need signing
  58. // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build.
  59. relWithDebInfo {
  60. initWith release
  61. versionNameSuffix '-debug'
  62. signingConfig signingConfigs.debug
  63. minifyEnabled false
  64. testCoverageEnabled false
  65. debuggable true
  66. jniDebuggable true
  67. }
  68. // Signed by debug key disallowing distribution on Play Store.
  69. // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build.
  70. debug {
  71. // TODO If this is ever modified, change application_id in debug/strings.xml
  72. versionNameSuffix '-debug'
  73. debuggable true
  74. jniDebuggable true
  75. }
  76. }
  77. flavorDimensions "version"
  78. productFlavors {
  79. mainline {
  80. dimension "version"
  81. }
  82. }
  83. externalNativeBuild {
  84. cmake {
  85. version "3.22.1"
  86. path "../../../CMakeLists.txt"
  87. }
  88. }
  89. defaultConfig {
  90. externalNativeBuild {
  91. cmake {
  92. arguments "-DENABLE_QT=0", // Don't use QT
  93. "-DENABLE_SDL2=0", // Don't use SDL
  94. "-DENABLE_WEB_SERVICE=0", // Don't use telemetry
  95. "-DBUNDLE_SPEEX=ON",
  96. "-DANDROID_ARM_NEON=true", // cryptopp requires Neon to work
  97. "-DYUZU_USE_BUNDLED_VCPKG=ON",
  98. "-DYUZU_USE_BUNDLED_FFMPEG=ON"
  99. abiFilters "arm64-v8a", "x86_64"
  100. }
  101. }
  102. }
  103. }
  104. dependencies {
  105. implementation 'androidx.core:core-ktx:1.9.0'
  106. implementation 'androidx.appcompat:appcompat:1.6.1'
  107. implementation 'androidx.exifinterface:exifinterface:1.3.6'
  108. implementation 'androidx.cardview:cardview:1.0.0'
  109. implementation 'androidx.recyclerview:recyclerview:1.2.1'
  110. implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  111. implementation 'androidx.lifecycle:lifecycle-viewmodel:2.5.1'
  112. implementation 'androidx.fragment:fragment:1.5.5'
  113. implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0"
  114. implementation "androidx.documentfile:documentfile:1.0.1"
  115. implementation 'com.google.android.material:material:1.8.0'
  116. implementation 'androidx.preference:preference:1.2.0'
  117. implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
  118. implementation "io.coil-kt:coil:2.2.2"
  119. implementation 'androidx.core:core-splashscreen:1.0.0'
  120. // Allows FRP-style asynchronous operations in Android.
  121. implementation 'io.reactivex:rxandroid:1.2.1'
  122. implementation 'com.nononsenseapps:filepicker:4.2.1'
  123. implementation 'org.ini4j:ini4j:0.5.4'
  124. implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  125. implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
  126. implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
  127. }
  128. def getVersion() {
  129. def versionName = '0.0'
  130. try {
  131. versionName = 'git describe --always --long'.execute([], project.rootDir).text
  132. .trim()
  133. .replaceAll(/(-0)?-[^-]+$/, "")
  134. } catch (Exception) {
  135. logger.error('Cannot find git, defaulting to dummy version number')
  136. }
  137. if (System.getenv("GITHUB_ACTIONS") != null) {
  138. def gitTag = System.getenv("GIT_TAG_NAME")
  139. versionName = gitTag ?: versionName
  140. }
  141. return versionName
  142. }