diff --git a/src/android/app/build.gradle b/src/android/app/build.gradle index e57271517..935000a14 100644 --- a/src/android/app/build.gradle +++ b/src/android/app/build.gradle @@ -1,8 +1,15 @@ apply plugin: 'com.android.application' +/** + * Use the number of seconds/10 since Jan 1 2016 as the versionCode. + * This lets us upload a new build at most every 10 seconds for the + * next 680 years. + */ +def autoVersion = (int)(((new Date().getTime()/1000) - 1451606400) / 10) +def buildType + android { - compileSdkVersion 26 - buildToolsVersion '28.0.3' + compileSdkVersion 28 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -13,34 +20,52 @@ android { // This is important as it will run lint but not abort on error // Lint has some overly obnoxious "errors" that should really be warnings abortOnError false + + //Uncomment disable lines for test builds... + //disable 'MissingTranslation'bin + //disable 'ExtraTranslation' } defaultConfig { - applicationId "org.citra_emu" + // TODO If this is ever modified, change application_id in strings.xml + applicationId "org.citra.citra_android" minSdkVersion 21 - targetSdkVersion 26 - - versionCode(getBuildVersionCode()) - - versionName "${getVersion()}" + targetSdkVersion 28 + versionCode autoVersion } signingConfigs { - release { - if (project.hasProperty('keystore')) { - storeFile file(project.property('keystore')) - storePassword project.property('storepass') - keyAlias project.property('keyalias') - keyPassword project.property('keypass') - } - } + //release { + // storeFile file('') + // storePassword System.getenv('ANDROID_KEYPASS') + // keyAlias = 'key0' + // keyPassword System.getenv('ANDROID_KEYPASS') + //} + } + + applicationVariants.all { variant -> + buildType = variant.buildType.name // sets the current build type } // Define build types, which are orthogonal to product flavors. buildTypes { + // Signed by release key, allowing for upload to Play Store. release { - signingConfig signingConfigs.release + signingConfig signingConfigs.debug + } + + // builds a release build that doesn't need signing + // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build. + relWithDebInfo { + initWith release + applicationIdSuffix ".debug" + versionNameSuffix '-debug' + signingConfig signingConfigs.debug + minifyEnabled false + testCoverageEnabled false + debuggable true + jniDebuggable true } // Signed by debug key disallowing distribution on Play Store. @@ -49,13 +74,14 @@ android { // TODO If this is ever modified, change application_id in debug/strings.xml applicationIdSuffix ".debug" versionNameSuffix '-debug' + debuggable true jniDebuggable true } } externalNativeBuild { cmake { - version getCmakeVersion() + version "3.10.2" path "../../../CMakeLists.txt" } } @@ -65,20 +91,17 @@ android { cmake { arguments "-DENABLE_QT=0", // Don't use QT "-DENABLE_SDL2=0", // Don't use SDL - "-DANDROID_ARM_NEON=true", // cryptopp requires Neon to work - "-DENABLE_CUBEB=0", - "-DANDROID_STL=c++_shared" + "-DENABLE_WEB_SERVICE=0", // Don't use telemetry + "-DANDROID_ARM_NEON=true" // cryptopp requires Neon to work - abiFilters "arm64-v8a" - - targets "citra-android" + abiFilters "arm64-v8a" //, "x86" } } } } ext { - androidSupportVersion = '26.1.0' + androidSupportVersion = '28.0.0' } dependencies { @@ -90,51 +113,15 @@ dependencies { // Android TV UI libraries. implementation "com.android.support:leanback-v17:$androidSupportVersion" - implementation 'com.android.support.constraint:constraint-layout:1.1.0' + // For showing the banner as a circle a-la Material Design Guidelines + implementation 'de.hdodenhof:circleimageview:2.1.0' - testImplementation "com.android.support.test:runner:1.0.2" - androidTestImplementation "com.android.support.test:runner:1.0.1" -} - -def getVersion() { - def versionNumber = '0.0' - - try { - versionNumber = 'git describe --always --long'.execute([], project.rootDir).text - .trim() - .replaceAll(/(-0)?-[^-]+$/, "") - } catch (Exception e) { - logger.error('Cannot find git, defaulting to dummy version number') - } - - return versionNumber -} - - -def getBuildVersionCode() { - try { - def versionNumber = 'git rev-list --first-parent --count HEAD'.execute([], project.rootDir).text - .trim() - return Integer.valueOf(versionNumber) - } catch (Exception e) { - logger.error('Cannot find git, defaulting to dummy version number') - } - - return 0 -} - -def getCmakeVersion() { - try { - // Tokenized form of the output will be - ["cmake", "version", "M.m.p-rcx"], the version number - // will be at index 2 - def version_string = 'cmake -version'.execute([], project.rootDir).text - .trim().tokenize()[2] - - return version_string - } - catch(Exception e) { - logger.error('Cannot find Cmake, using default Cmake') - } - - return null + // For loading huge screenshots from the disk. + implementation 'com.squareup.picasso:picasso:2.5.2' + + // Allows FRP-style asynchronous operations in Android. + implementation 'io.reactivex:rxandroid:1.2.1' + implementation 'com.nononsenseapps:filepicker:4.1.0' + implementation 'org.ini4j:ini4j:0.5.4' + implementation 'com.android.support.constraint:constraint-layout:1.1.3' }