diff options
Diffstat (limited to 'src/android/app/build.gradle')
| -rw-r--r-- | src/android/app/build.gradle | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/src/android/app/build.gradle b/src/android/app/build.gradle new file mode 100644 index 000000000..5a108743b --- /dev/null +++ b/src/android/app/build.gradle | |||
| @@ -0,0 +1,163 @@ | |||
| 1 | apply plugin: 'com.android.application' | ||
| 2 | |||
| 3 | /** | ||
| 4 | * Use the number of seconds/10 since Jan 1 2016 as the versionCode. | ||
| 5 | * This lets us upload a new build at most every 10 seconds for the | ||
| 6 | * next 680 years. | ||
| 7 | */ | ||
| 8 | def autoVersion = (int) (((new Date().getTime() / 1000) - 1451606400) / 10) | ||
| 9 | def buildType | ||
| 10 | def abiFilter = "arm64-v8a" //, "x86" | ||
| 11 | |||
| 12 | android { | ||
| 13 | compileSdkVersion 32 | ||
| 14 | ndkVersion "25.1.8937393" | ||
| 15 | |||
| 16 | compileOptions { | ||
| 17 | sourceCompatibility JavaVersion.VERSION_1_8 | ||
| 18 | targetCompatibility JavaVersion.VERSION_1_8 | ||
| 19 | } | ||
| 20 | |||
| 21 | lintOptions { | ||
| 22 | // This is important as it will run lint but not abort on error | ||
| 23 | // Lint has some overly obnoxious "errors" that should really be warnings | ||
| 24 | abortOnError false | ||
| 25 | |||
| 26 | //Uncomment disable lines for test builds... | ||
| 27 | //disable 'MissingTranslation'bin | ||
| 28 | //disable 'ExtraTranslation' | ||
| 29 | } | ||
| 30 | |||
| 31 | defaultConfig { | ||
| 32 | // TODO If this is ever modified, change application_id in strings.xml | ||
| 33 | applicationId "org.citra.citra_emu" | ||
| 34 | minSdkVersion 28 | ||
| 35 | targetSdkVersion 29 | ||
| 36 | versionCode autoVersion | ||
| 37 | versionName getVersion() | ||
| 38 | ndk.abiFilters abiFilter | ||
| 39 | } | ||
| 40 | |||
| 41 | signingConfigs { | ||
| 42 | //release { | ||
| 43 | // storeFile file('') | ||
| 44 | // storePassword System.getenv('ANDROID_KEYPASS') | ||
| 45 | // keyAlias = 'key0' | ||
| 46 | // keyPassword System.getenv('ANDROID_KEYPASS') | ||
| 47 | //} | ||
| 48 | } | ||
| 49 | |||
| 50 | applicationVariants.all { variant -> | ||
| 51 | buildType = variant.buildType.name // sets the current build type | ||
| 52 | } | ||
| 53 | |||
| 54 | // Define build types, which are orthogonal to product flavors. | ||
| 55 | buildTypes { | ||
| 56 | |||
| 57 | // Signed by release key, allowing for upload to Play Store. | ||
| 58 | release { | ||
| 59 | signingConfig signingConfigs.debug | ||
| 60 | } | ||
| 61 | |||
| 62 | // builds a release build that doesn't need signing | ||
| 63 | // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build. | ||
| 64 | relWithDebInfo { | ||
| 65 | initWith release | ||
| 66 | applicationIdSuffix ".debug" | ||
| 67 | versionNameSuffix '-debug' | ||
| 68 | signingConfig signingConfigs.debug | ||
| 69 | minifyEnabled false | ||
| 70 | testCoverageEnabled false | ||
| 71 | debuggable true | ||
| 72 | jniDebuggable true | ||
| 73 | } | ||
| 74 | |||
| 75 | // Signed by debug key disallowing distribution on Play Store. | ||
| 76 | // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build. | ||
| 77 | debug { | ||
| 78 | // TODO If this is ever modified, change application_id in debug/strings.xml | ||
| 79 | applicationIdSuffix ".debug" | ||
| 80 | versionNameSuffix '-debug' | ||
| 81 | debuggable true | ||
| 82 | jniDebuggable true | ||
| 83 | } | ||
| 84 | } | ||
| 85 | |||
| 86 | flavorDimensions "version" | ||
| 87 | productFlavors { | ||
| 88 | canary { | ||
| 89 | dimension "version" | ||
| 90 | applicationIdSuffix ".canary" | ||
| 91 | } | ||
| 92 | nightly { | ||
| 93 | dimension "version" | ||
| 94 | } | ||
| 95 | } | ||
| 96 | |||
| 97 | externalNativeBuild { | ||
| 98 | cmake { | ||
| 99 | version "3.22.1" | ||
| 100 | path "../../../CMakeLists.txt" | ||
| 101 | } | ||
| 102 | } | ||
| 103 | |||
| 104 | defaultConfig { | ||
| 105 | externalNativeBuild { | ||
| 106 | cmake { | ||
| 107 | arguments "-DENABLE_QT=0", // Don't use QT | ||
| 108 | "-DENABLE_SDL2=0", // Don't use SDL | ||
| 109 | "-DENABLE_WEB_SERVICE=0", // Don't use telemetry | ||
| 110 | "-DANDROID_ARM_NEON=true", // cryptopp requires Neon to work | ||
| 111 | "-DYUZU_USE_BUNDLED_VCPKG=ON", | ||
| 112 | "-DYUZU_USE_BUNDLED_FFMPEG=ON" | ||
| 113 | |||
| 114 | abiFilters abiFilter | ||
| 115 | } | ||
| 116 | } | ||
| 117 | } | ||
| 118 | } | ||
| 119 | |||
| 120 | dependencies { | ||
| 121 | implementation 'androidx.appcompat:appcompat:1.5.1' | ||
| 122 | implementation 'androidx.exifinterface:exifinterface:1.3.4' | ||
| 123 | implementation 'androidx.cardview:cardview:1.0.0' | ||
| 124 | implementation 'androidx.recyclerview:recyclerview:1.2.1' | ||
| 125 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' | ||
| 126 | implementation 'androidx.lifecycle:lifecycle-viewmodel:2.5.1' | ||
| 127 | implementation 'androidx.fragment:fragment:1.5.3' | ||
| 128 | implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0" | ||
| 129 | implementation 'com.google.android.material:material:1.6.1' | ||
| 130 | |||
| 131 | // For loading huge screenshots from the disk. | ||
| 132 | implementation 'com.squareup.picasso:picasso:2.71828' | ||
| 133 | |||
| 134 | // Allows FRP-style asynchronous operations in Android. | ||
| 135 | implementation 'io.reactivex:rxandroid:1.2.1' | ||
| 136 | implementation 'com.nononsenseapps:filepicker:4.2.1' | ||
| 137 | implementation 'org.ini4j:ini4j:0.5.4' | ||
| 138 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' | ||
| 139 | implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0' | ||
| 140 | implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' | ||
| 141 | |||
| 142 | // Please don't upgrade the billing library as the newer version is not GPL-compatible | ||
| 143 | implementation 'com.android.billingclient:billing:2.0.3' | ||
| 144 | } | ||
| 145 | |||
| 146 | def getVersion() { | ||
| 147 | def versionName = '0.0' | ||
| 148 | |||
| 149 | try { | ||
| 150 | versionName = 'git describe --always --long'.execute([], project.rootDir).text | ||
| 151 | .trim() | ||
| 152 | .replaceAll(/(-0)?-[^-]+$/, "") | ||
| 153 | } catch (Exception) { | ||
| 154 | logger.error('Cannot find git, defaulting to dummy version number') | ||
| 155 | } | ||
| 156 | |||
| 157 | if (System.getenv("GITHUB_ACTIONS") != null) { | ||
| 158 | def gitTag = System.getenv("GIT_TAG_NAME") | ||
| 159 | versionName = gitTag ?: versionName | ||
| 160 | } | ||
| 161 | |||
| 162 | return versionName | ||
| 163 | } | ||