mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
pull version name and code from special properties file
This commit is contained in:
parent
b96ed25002
commit
03cabd3248
10 changed files with 102 additions and 8 deletions
|
|
@ -81,6 +81,8 @@ GEM
|
||||||
xcodeproj (>= 1.13.0, < 2.0.0)
|
xcodeproj (>= 1.13.0, < 2.0.0)
|
||||||
xcpretty (~> 0.3.0)
|
xcpretty (~> 0.3.0)
|
||||||
xcpretty-travis-formatter (>= 0.0.3)
|
xcpretty-travis-formatter (>= 0.0.3)
|
||||||
|
fastlane-plugin-properties (1.1.2)
|
||||||
|
java-properties
|
||||||
fastlane-plugin-semantic_release (1.14.1)
|
fastlane-plugin-semantic_release (1.14.1)
|
||||||
fastlane-plugin-versioning_android (0.1.0)
|
fastlane-plugin-versioning_android (0.1.0)
|
||||||
gh_inspector (1.1.3)
|
gh_inspector (1.1.3)
|
||||||
|
|
@ -116,6 +118,7 @@ GEM
|
||||||
http-cookie (1.0.3)
|
http-cookie (1.0.3)
|
||||||
domain_name (~> 0.5)
|
domain_name (~> 0.5)
|
||||||
httpclient (2.8.3)
|
httpclient (2.8.3)
|
||||||
|
java-properties (0.3.0)
|
||||||
jmespath (1.4.0)
|
jmespath (1.4.0)
|
||||||
json (2.3.0)
|
json (2.3.0)
|
||||||
jwt (2.1.0)
|
jwt (2.1.0)
|
||||||
|
|
@ -176,6 +179,7 @@ PLATFORMS
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
fastlane
|
fastlane
|
||||||
|
fastlane-plugin-properties
|
||||||
fastlane-plugin-semantic_release
|
fastlane-plugin-semantic_release
|
||||||
fastlane-plugin-versioning_android
|
fastlane-plugin-versioning_android
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ dependencies {
|
||||||
implementation "androidx.preference:preference-ktx:$preferences_version"
|
implementation "androidx.preference:preference-ktx:$preferences_version"
|
||||||
|
|
||||||
//Desugaring
|
//Desugaring
|
||||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.6'
|
||||||
|
|
||||||
implementation('com.jaredrummler:android-device-names:2.1.0')
|
implementation('com.jaredrummler:android-device-names:2.1.0')
|
||||||
|
|
||||||
|
|
@ -115,7 +115,7 @@ dependencies {
|
||||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
|
||||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
|
||||||
|
|
||||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.6'
|
||||||
|
|
||||||
implementation 'com.willowtreeapps:signinwithapplebutton:0.3'
|
implementation 'com.willowtreeapps:signinwithapplebutton:0.3'
|
||||||
|
|
||||||
|
|
@ -150,6 +150,9 @@ android {
|
||||||
buildConfigField "String", "TESTING_LEVEL", "\"production\""
|
buildConfigField "String", "TESTING_LEVEL", "\"production\""
|
||||||
resConfigs 'en', 'bg', 'de', 'en-rGB', 'es', 'fr', 'hr-rHR', 'in', 'it', 'iw', 'ja', 'ko', 'lt', 'nl', 'pl', 'pt-rBR', 'pt-rPT', 'ru', 'tr', 'zh', 'zh-rTW'
|
resConfigs 'en', 'bg', 'de', 'en-rGB', 'es', 'fr', 'hr-rHR', 'in', 'it', 'iw', 'ja', 'ko', 'lt', 'nl', 'pl', 'pt-rBR', 'pt-rPT', 'ru', 'tr', 'zh', 'zh-rTW'
|
||||||
|
|
||||||
|
println app_version_code
|
||||||
|
println app_version_name
|
||||||
|
|
||||||
versionCode app_version_code
|
versionCode app_version_code
|
||||||
versionName app_version_name
|
versionName app_version_name
|
||||||
|
|
||||||
|
|
|
||||||
2
Habitica/proguard-rules.pro
vendored
2
Habitica/proguard-rules.pro
vendored
|
|
@ -65,6 +65,8 @@
|
||||||
|
|
||||||
#keep Habitica code
|
#keep Habitica code
|
||||||
-keep class com.habitrpg.android.habitica.** { *; }
|
-keep class com.habitrpg.android.habitica.** { *; }
|
||||||
|
-keep class com.habitrpg.common.habitica.** { *; }
|
||||||
|
-keep class com.habitrpg.shared.habitica.** { *; }
|
||||||
|
|
||||||
#realm
|
#realm
|
||||||
-keep class io.realm.annotations.RealmModule
|
-keep class io.realm.annotations.RealmModule
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import android.text.InputType
|
||||||
import android.text.SpannableString
|
import android.text.SpannableString
|
||||||
import android.text.method.LinkMovementMethod
|
import android.text.method.LinkMovementMethod
|
||||||
import android.text.style.UnderlineSpan
|
import android.text.style.UnderlineSpan
|
||||||
|
import android.util.Log
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.Window
|
import android.view.Window
|
||||||
|
|
@ -36,11 +37,11 @@ import com.habitrpg.android.habitica.extensions.updateStatusBarColor
|
||||||
import com.habitrpg.android.habitica.helpers.AmplitudeManager
|
import com.habitrpg.android.habitica.helpers.AmplitudeManager
|
||||||
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
||||||
import com.habitrpg.android.habitica.helpers.RxErrorHandler
|
import com.habitrpg.android.habitica.helpers.RxErrorHandler
|
||||||
import com.habitrpg.common.habitica.models.auth.UserAuthResponse
|
|
||||||
import com.habitrpg.android.habitica.models.user.User
|
import com.habitrpg.android.habitica.models.user.User
|
||||||
import com.habitrpg.android.habitica.ui.helpers.dismissKeyboard
|
import com.habitrpg.android.habitica.ui.helpers.dismissKeyboard
|
||||||
import com.habitrpg.android.habitica.ui.viewmodels.AuthenticationViewModel
|
import com.habitrpg.android.habitica.ui.viewmodels.AuthenticationViewModel
|
||||||
import com.habitrpg.android.habitica.ui.views.dialogs.HabiticaAlertDialog
|
import com.habitrpg.android.habitica.ui.views.dialogs.HabiticaAlertDialog
|
||||||
|
import com.habitrpg.common.habitica.models.auth.UserAuthResponse
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class LoginActivity : BaseActivity() {
|
class LoginActivity : BaseActivity() {
|
||||||
|
|
@ -88,11 +89,13 @@ class LoginActivity : BaseActivity() {
|
||||||
showValidationError(R.string.login_validation_error_fieldsmissing)
|
showValidationError(R.string.login_validation_error_fieldsmissing)
|
||||||
return@OnClickListener
|
return@OnClickListener
|
||||||
}
|
}
|
||||||
|
Log.d("LoginActivity", ": $username, $password")
|
||||||
apiClient.connectUser(username, password).subscribe(
|
apiClient.connectUser(username, password).subscribe(
|
||||||
{ handleAuthResponse(it) },
|
{ handleAuthResponse(it) },
|
||||||
{
|
{
|
||||||
hideProgress()
|
hideProgress()
|
||||||
RxErrorHandler.reportError(it)
|
RxErrorHandler.reportError(it)
|
||||||
|
Log.d("LoginActivity", ": ${it.message}", it)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
21
build.gradle
21
build.gradle
|
|
@ -33,8 +33,8 @@ buildscript {
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.1.3'
|
classpath 'com.android.tools.build:gradle:7.1.3'
|
||||||
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
|
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
|
||||||
classpath 'com.google.gms:google-services:4.3.10'
|
classpath 'com.google.gms:google-services:4.3.13'
|
||||||
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.0'
|
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1'
|
||||||
classpath "io.realm:realm-gradle-plugin:10.10.1"
|
classpath "io.realm:realm-gradle-plugin:10.10.1"
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.19.0"
|
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.19.0"
|
||||||
|
|
@ -53,6 +53,23 @@ allprojects {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Properties props = new Properties()
|
||||||
|
def propFile = new File('version.properties')
|
||||||
|
if (propFile.canRead()) {
|
||||||
|
props.load(new FileInputStream(propFile))
|
||||||
|
|
||||||
|
if (props != null && props.containsKey('NAME') && props.containsKey('CODE') ) {
|
||||||
|
ext.app_version_name = props['NAME']
|
||||||
|
ext.app_version_code = props['CODE'] as Integer
|
||||||
|
} else {
|
||||||
|
println 'signing.properties found but some entries are missing'
|
||||||
|
android.buildTypes.release.signingConfig = null
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
println 'signing.properties not found'
|
||||||
|
android.buildTypes.release.signingConfig = null
|
||||||
|
}
|
||||||
|
|
||||||
detekt {
|
detekt {
|
||||||
source = files("Habitica/src/main/java")
|
source = files("Habitica/src/main/java")
|
||||||
config = files("detekt.yml")
|
config = files("detekt.yml")
|
||||||
|
|
|
||||||
3
common/proguard-rules.pro
vendored
3
common/proguard-rules.pro
vendored
|
|
@ -18,4 +18,5 @@
|
||||||
|
|
||||||
# If you keep the line number information, uncomment this to
|
# If you keep the line number information, uncomment this to
|
||||||
# hide the original source file name.
|
# hide the original source file name.
|
||||||
#-renamesourcefileattribute SourceFile
|
#-renamesourcefileattribute SourceFile
|
||||||
|
-keep class com.habitrpg.common.habitica.** { *; }
|
||||||
|
|
|
||||||
|
|
@ -4,3 +4,4 @@
|
||||||
|
|
||||||
gem 'fastlane-plugin-versioning_android'
|
gem 'fastlane-plugin-versioning_android'
|
||||||
gem 'fastlane-plugin-semantic_release'
|
gem 'fastlane-plugin-semantic_release'
|
||||||
|
gem 'fastlane-plugin-properties'
|
||||||
|
|
|
||||||
2
version.properties
Normal file
2
version.properties
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
NAME=4.0
|
||||||
|
CODE=4040
|
||||||
|
|
@ -15,7 +15,7 @@ android {
|
||||||
targetSdk target_sdk
|
targetSdk target_sdk
|
||||||
versionCode app_version_code + 1
|
versionCode app_version_code + 1
|
||||||
versionName app_version_name
|
versionName app_version_name
|
||||||
|
buildConfigField "String", "TESTING_LEVEL", "\"production\""
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|
@ -33,6 +33,44 @@ android {
|
||||||
resValue "string", "app_name", "Habitica"
|
resValue "string", "app_name", "Habitica"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
release
|
||||||
|
}
|
||||||
|
flavorDimensions "buildType"
|
||||||
|
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
dimension "buildType"
|
||||||
|
}
|
||||||
|
|
||||||
|
staff {
|
||||||
|
dimension "buildType"
|
||||||
|
buildConfigField "String", "TESTING_LEVEL", "\"staff\""
|
||||||
|
resValue "string", "app_name", "Habitica Staff"
|
||||||
|
versionCode app_version_code + 7
|
||||||
|
}
|
||||||
|
|
||||||
|
alpha {
|
||||||
|
dimension "buildType"
|
||||||
|
buildConfigField "String", "TESTING_LEVEL", "\"alpha\""
|
||||||
|
resValue "string", "app_name", "Habitica Alpha"
|
||||||
|
versionCode app_version_code + 5
|
||||||
|
}
|
||||||
|
|
||||||
|
beta {
|
||||||
|
buildConfigField "String", "TESTING_LEVEL", "\"beta\""
|
||||||
|
dimension "buildType"
|
||||||
|
versionCode app_version_code + 3
|
||||||
|
}
|
||||||
|
|
||||||
|
prod {
|
||||||
|
buildConfigField "String", "TESTING_LEVEL", "\"production\""
|
||||||
|
dimension "buildType"
|
||||||
|
versionCode app_version_code + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
viewBinding true
|
viewBinding true
|
||||||
}
|
}
|
||||||
|
|
@ -102,4 +140,24 @@ if (HRPG_PROPS_FILE.canRead()) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new MissingResourceException('habitica.properties not found')
|
throw new MissingResourceException('habitica.properties not found')
|
||||||
|
}
|
||||||
|
|
||||||
|
Properties props = new Properties()
|
||||||
|
def propFile = new File('signingrelease.properties')
|
||||||
|
if (propFile.canRead()) {
|
||||||
|
props.load(new FileInputStream(propFile))
|
||||||
|
|
||||||
|
if (props != null && props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
|
||||||
|
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
|
||||||
|
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
|
||||||
|
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
|
||||||
|
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
|
||||||
|
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
|
||||||
|
} else {
|
||||||
|
println 'signing.properties found but some entries are missing'
|
||||||
|
android.buildTypes.release.signingConfig = null
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
println 'signing.properties not found'
|
||||||
|
android.buildTypes.release.signingConfig = null
|
||||||
}
|
}
|
||||||
5
wearos/proguard-rules.pro
vendored
5
wearos/proguard-rules.pro
vendored
|
|
@ -18,4 +18,7 @@
|
||||||
|
|
||||||
# If you keep the line number information, uncomment this to
|
# If you keep the line number information, uncomment this to
|
||||||
# hide the original source file name.
|
# hide the original source file name.
|
||||||
#-renamesourcefileattribute SourceFile
|
#-renamesourcefileattribute SourceFile
|
||||||
|
-keep class com.habitrpg.wearos.habitica.** { *; }
|
||||||
|
-keep class com.habitrpg.common.habitica.** { *; }
|
||||||
|
-keep class com.habitrpg.shared.habitica.** { *; }
|
||||||
Loading…
Reference in a new issue