diff --git a/.gitignore b/.gitignore index fde5fd0a..2e8e23f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.iml .gradle /local.properties +/keystore.properties /.idea/caches /.idea/libraries /.idea/modules.xml diff --git a/README.md b/README.md index 872f26fc..edfbd791 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,19 @@ # Occtax-mobile -![PNC](https://raw.githubusercontent.com/PnX-SI/gn_mobile_occtax/develop/occtax/src/pnc/res/mipmap-xxxhdpi/ic_launcher.png) -![PNE](https://raw.githubusercontent.com/PnX-SI/gn_mobile_occtax/develop/occtax/src/pne/res/mipmap-xxxhdpi/ic_launcher.png) -![PNM](https://raw.githubusercontent.com/PnX-SI/gn_mobile_occtax/develop/occtax/src/pnm/res/mipmap-xxxhdpi/ic_launcher.png) -![PNV](https://raw.githubusercontent.com/PnX-SI/gn_mobile_occtax/develop/occtax/src/pnv/res/mipmap-xxxhdpi/ic_launcher.png) - GeoNature Android mobile application for Occtax module. Installation documentation (French) : https://github.com/PnX-SI/gn_mobile_occtax/blob/master/docs/installation-fr.md +## Launcher icons + +| Name | Flavor | Launcher icon | +| -------------------------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------- | +| Default | _generic_ | ![PNX](https://raw.githubusercontent.com/PnX-SI/gn_mobile_occtax/develop/occtax/src/main/res/mipmap-xhdpi/ic_launcher.png) | +| [Parc National des Cévennes](http://www.cevennes-parcnational.fr) | _pnc_ | ![PNC](https://raw.githubusercontent.com/PnX-SI/gn_mobile_occtax/develop/occtax/src/pnc/res/mipmap-xhdpi/ic_launcher.png) | +| [Parc National des Écrins](http://www.ecrins-parcnational.fr) | _pne_ | ![PNE](https://raw.githubusercontent.com/PnX-SI/gn_mobile_occtax/develop/occtax/src/pne/res/mipmap-xhdpi/ic_launcher.png) | +| [Parc National du Mercantour](http://www.mercantour-parcnational.fr) | _pnm_ | ![PNE](https://raw.githubusercontent.com/PnX-SI/gn_mobile_occtax/develop/occtax/src/pnm/res/mipmap-xhdpi/ic_launcher.png) | +| [Parc National de la Vanoise](http://www.vanoise-parcnational.fr) | _pnv_ | ![PNE](https://raw.githubusercontent.com/PnX-SI/gn_mobile_occtax/develop/occtax/src/pnv/res/mipmap-xhdpi/ic_launcher.png) | + ## Settings Example: diff --git a/build.gradle b/build.gradle index 80c112f3..f1a756d4 100644 --- a/build.gradle +++ b/build.gradle @@ -34,10 +34,10 @@ task clean(type: Delete) { delete rootProject.buildDir } -File getVersionPropertiesFile(moduleName) { - def versionPropsFile = file(moduleName + '/version.properties') +private File loadVersionPropertiesFile(String moduleName) { + def versionPropsFile = file("$moduleName/version.properties") - println("getVersionCode: loading '" + versionPropsFile + "'") + println "reading '${versionPropsFile.name}' for module '$moduleName' ..." if (!versionPropsFile.exists()) { versionPropsFile.createNewFile() @@ -46,32 +46,41 @@ File getVersionPropertiesFile(moduleName) { return versionPropsFile } -Properties readVersionProperties(moduleName) { - Properties versionProps = new Properties() - versionProps.load(new FileInputStream(getVersionPropertiesFile(moduleName))) +@SuppressWarnings("unused") +int updateVersionCode(moduleName) { + File propertiesFile = loadVersionPropertiesFile(moduleName) - if (!versionProps['VERSION_CODE']) { - versionProps['VERSION_CODE'] = "1" - } + Properties versionProperties = new Properties() + versionProperties.load(new FileInputStream(propertiesFile)) - return versionProps -} + int versionCode = Integer.parseInt(versionProperties.getProperty('VERSION_CODE', '0').toString()).intValue() + 1 + + versionProperties['VERSION_CODE'] = versionCode.toString() + versionProperties.store(propertiesFile.newWriter(), null) -int getVersionCode(moduleName) { - Properties versionProps = readVersionProperties(moduleName) + println "version code: $versionCode" - return Integer.parseInt(versionProps['VERSION_CODE'].toString()).intValue() + return versionCode } @SuppressWarnings("unused") -int updateVersionCode(moduleName) { - Properties versionProps = readVersionProperties(moduleName) - def versionCode = getVersionCode(moduleName) + 1 +def readKeystoreProperties(moduleName) { + def propertiesFile = rootProject.file('keystore.properties') + def configName = 'release' - versionProps['VERSION_CODE'] = versionCode.toString() - versionProps.store(getVersionPropertiesFile(moduleName).newWriter(), null) + println "reading '${propertiesFile.absolutePath}' for module '$moduleName' ..." - println("updateVersionCode: " + versionCode) + Project moduleProject = project.project(moduleName) - return versionCode + if (propertiesFile.exists() && moduleProject.hasProperty("android") && moduleProject.android.signingConfigs.hasProperty(configName)) { + def props = new Properties() + props.load(new FileInputStream(propertiesFile)) + + moduleProject.android.signingConfigs[configName].storeFile = file(props['STORE_FILE']) + moduleProject.android.signingConfigs[configName].storePassword = props['STORE_PASSWORD'] + moduleProject.android.signingConfigs[configName].keyAlias = props['KEY_ALIAS'] + moduleProject.android.signingConfigs[configName].keyPassword = props['KEY_PASSWORD'] + + println 'done' + } } \ No newline at end of file diff --git a/gn_mobile_core b/gn_mobile_core index c0930773..e5eb36bb 160000 --- a/gn_mobile_core +++ b/gn_mobile_core @@ -1 +1 @@ -Subproject commit c093077376f1007b378076f7c91751c627dc7238 +Subproject commit e5eb36bb93adea4e64d334e2ae6920c2da9a00d7 diff --git a/gn_mobile_maps b/gn_mobile_maps index 97bfb7c1..95a04c9f 160000 --- a/gn_mobile_maps +++ b/gn_mobile_maps @@ -1 +1 @@ -Subproject commit 97bfb7c166cdb4a7bb44e0acb9fc65a35f7f7efa +Subproject commit 95a04c9ffa4f3fe573c760dae73102e357c7913f diff --git a/occtax/build.gradle b/occtax/build.gradle index b8116e40..7bf0ee45 100644 --- a/occtax/build.gradle +++ b/occtax/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' -version = "0.3.5" +version = "1.0.0" android { compileSdkVersion 29 @@ -23,13 +23,20 @@ android { archivesBaseName = module.name + "-" + versionName } + signingConfigs { + release { + readKeystoreProperties(module.name) + } + } + buildTypes { debug { - versionNameSuffix "." + getVersionCode(module.name) + "-DEV" + versionNameSuffix ".${defaultConfig.versionCode}-DEV" } release { - versionNameSuffix "." + getVersionCode(module.name) + signingConfig signingConfigs.release + versionNameSuffix ".${defaultConfig.versionCode}" debuggable false minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' diff --git a/occtax/version.properties b/occtax/version.properties index 16bbab97..54a1a493 100644 --- a/occtax/version.properties +++ b/occtax/version.properties @@ -1,2 +1,2 @@ -#Sun Jul 19 16:09:07 CEST 2020 -VERSION_CODE=1940 +#Sun Jul 26 15:45:18 CEST 2020 +VERSION_CODE=1950