Add release build
This commit is contained in:
parent
054eb8dfef
commit
8b4b9d3215
3 changed files with 12 additions and 27 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -13,4 +13,4 @@
|
||||||
.externalNativeBuild
|
.externalNativeBuild
|
||||||
.cxx
|
.cxx
|
||||||
local.properties
|
local.properties
|
||||||
/keystore.jks
|
keystore.jks
|
||||||
|
|
|
@ -7,6 +7,15 @@ android {
|
||||||
namespace = "com.henryhiles.qscan"
|
namespace = "com.henryhiles.qscan"
|
||||||
compileSdk = 33
|
compileSdk = 33
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
create("release") {
|
||||||
|
storeFile = file("${rootDir}/keystore.jks")
|
||||||
|
keyPassword = System.getenv("KEY_PASSWORD")
|
||||||
|
keyAlias = "key0"
|
||||||
|
storePassword = System.getenv("STORE_PASSWORD")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "com.henryhiles.qscan"
|
applicationId = "com.henryhiles.qscan"
|
||||||
minSdk = 29
|
minSdk = 29
|
||||||
|
@ -14,7 +23,6 @@ android {
|
||||||
versionCode = 1
|
versionCode = 1
|
||||||
versionName = "1.0"
|
versionName = "1.0"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
||||||
vectorDrawables {
|
vectorDrawables {
|
||||||
useSupportLibrary = true
|
useSupportLibrary = true
|
||||||
}
|
}
|
||||||
|
@ -23,6 +31,8 @@ android {
|
||||||
buildTypes {
|
buildTypes {
|
||||||
named("release") {
|
named("release") {
|
||||||
isMinifyEnabled = true
|
isMinifyEnabled = true
|
||||||
|
isShrinkResources = true
|
||||||
|
signingConfig = signingConfigs.getByName("release")
|
||||||
setProguardFiles(
|
setProguardFiles(
|
||||||
listOf(
|
listOf(
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
|
@ -31,7 +41,6 @@ android {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
named("debug") {
|
named("debug") {
|
||||||
isMinifyEnabled = false
|
|
||||||
applicationIdSuffix = ".debug"
|
applicationIdSuffix = ".debug"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
package com.henryhiles.qscan
|
|
||||||
|
|
||||||
import androidx.test.platform.app.InstrumentationRegistry
|
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
|
||||||
|
|
||||||
import org.junit.Test
|
|
||||||
import org.junit.runner.RunWith
|
|
||||||
|
|
||||||
import org.junit.Assert.*
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instrumented test, which will execute on an Android device.
|
|
||||||
*
|
|
||||||
* See [testing documentation](http://d.android.com/tools/testing).
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4::class)
|
|
||||||
class ExampleInstrumentedTest {
|
|
||||||
@Test
|
|
||||||
fun useAppContext() {
|
|
||||||
// Context of the app under test.
|
|
||||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
|
||||||
assertEquals("com.henryhiles.qscan", appContext.packageName)
|
|
||||||
}
|
|
||||||
}
|
|
Reference in a new issue