build.gradle 5.4 KB

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