Generate versionCode from timestamp.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -18,6 +18,13 @@ steps:
|
||||
- echo "keyAlias=key0" >> keystore.properties
|
||||
- echo "storeFile=../AndroidKey" >> keystore.properties
|
||||
|
||||
- name: generate versionCode
|
||||
image: busybox
|
||||
commands:
|
||||
- touch version.properties
|
||||
- let timestamp=$(date +%s)/10
|
||||
- echo "versionCode=$timestamp" >> version.properties
|
||||
|
||||
- name: build
|
||||
image: mingc/android-build-box
|
||||
commands:
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -14,3 +14,4 @@
|
||||
.cxx
|
||||
.idea
|
||||
keystore.properties
|
||||
version.properties
|
||||
|
||||
@@ -4,12 +4,17 @@ apply plugin: 'kotlin-android'
|
||||
// Create a variable called keystorePropertiesFile, and initialize it to your
|
||||
// keystore.properties file, in the rootProject folder.
|
||||
def keystorePropertiesFile = rootProject.file("keystore.properties")
|
||||
def versionPropertiesFile = rootProject.file("version.properties")
|
||||
|
||||
|
||||
// Initialize a new Properties() object called keystoreProperties.
|
||||
def keystoreProperties = new Properties()
|
||||
def versionProperties = new Properties()
|
||||
|
||||
|
||||
// Load your keystore.properties file into the keystoreProperties object.
|
||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||
versionProperties.load(new FileInputStream(versionPropertiesFile))
|
||||
|
||||
android {
|
||||
compileSdkVersion 32
|
||||
@@ -18,7 +23,7 @@ android {
|
||||
applicationId "me.zobrist.tichucounter"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 32
|
||||
versionCode 8
|
||||
versionCode keystoreProperties["versionCode"]
|
||||
versionName "1.1.0Beta1"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
Reference in New Issue
Block a user