Create a publish flavor dedicated for public releases
This commit is contained in:
		@@ -118,6 +118,7 @@ steps:
 | 
			
		||||
  - dart run build_runner build
 | 
			
		||||
  - flutter build apk
 | 
			
		||||
    --release
 | 
			
		||||
    --flavor publish
 | 
			
		||||
    --build-name $(git describe --tags --abbrev=0) 
 | 
			
		||||
    --target-platform android-arm64 
 | 
			
		||||
    --build-number $(git rev-list --count $(git describe --tags --abbrev=0))
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								moneymgr_mobile/android/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								moneymgr_mobile/android/.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1,3 +1,5 @@
 | 
			
		||||
publish_key.properties
 | 
			
		||||
 | 
			
		||||
gradle-wrapper.jar
 | 
			
		||||
/.gradle
 | 
			
		||||
/captures/
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										8
									
								
								moneymgr_mobile/android/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								moneymgr_mobile/android/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
# Android version of application
 | 
			
		||||
 | 
			
		||||
Generate keystore:
 | 
			
		||||
 | 
			
		||||
```bash
 | 
			
		||||
keytool -genkey -v -keystore ./keystore.jks -keyalg RSA \
 | 
			
		||||
        -keysize 2048 -validity 20000 -alias moneymgr
 | 
			
		||||
```
 | 
			
		||||
@@ -1,3 +1,6 @@
 | 
			
		||||
import java.util.Properties
 | 
			
		||||
import java.io.FileInputStream
 | 
			
		||||
 | 
			
		||||
plugins {
 | 
			
		||||
    id("com.android.application")
 | 
			
		||||
    id("kotlin-android")
 | 
			
		||||
@@ -5,6 +8,12 @@ plugins {
 | 
			
		||||
    id("dev.flutter.flutter-gradle-plugin")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
val keystoreProperties = Properties()
 | 
			
		||||
val keystorePropertiesFile = rootProject.file("publish_key.properties")
 | 
			
		||||
if (keystorePropertiesFile.exists()) {
 | 
			
		||||
    keystoreProperties.load(FileInputStream(keystorePropertiesFile))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
android {
 | 
			
		||||
    namespace = "org.communiquons.moneymgr"
 | 
			
		||||
    compileSdk = flutter.compileSdkVersion
 | 
			
		||||
@@ -21,7 +30,6 @@ android {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    defaultConfig {
 | 
			
		||||
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
 | 
			
		||||
        applicationId = "org.communiquons.moneymgr"
 | 
			
		||||
        // You can update the following values to match your application needs.
 | 
			
		||||
        // For more information, see: https://flutter.dev/to/review-gradle-config.
 | 
			
		||||
@@ -31,17 +39,33 @@ android {
 | 
			
		||||
        versionName = flutter.versionName
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    buildTypes {
 | 
			
		||||
        debug {
 | 
			
		||||
            applicationIdSuffix = ".debug"
 | 
			
		||||
    signingConfigs {
 | 
			
		||||
        create("publish") {
 | 
			
		||||
            keyAlias = keystoreProperties["keyAlias"] as String
 | 
			
		||||
            keyPassword = keystoreProperties["keyPassword"] as String
 | 
			
		||||
            storeFile = keystoreProperties["storeFile"]?.let { file(it) }
 | 
			
		||||
            storePassword = keystoreProperties["storePassword"] as String
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    buildTypes {
 | 
			
		||||
        release {
 | 
			
		||||
            // TODO: Add your own signing config for the release build.
 | 
			
		||||
            // Signing with the debug keys for now, so `flutter run --release` works.
 | 
			
		||||
            signingConfig = signingConfigs.getByName("debug")
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    flavorDimensions += "default"
 | 
			
		||||
    productFlavors {
 | 
			
		||||
        create("development") {
 | 
			
		||||
            dimension = "default"
 | 
			
		||||
            applicationIdSuffix = ".debug"
 | 
			
		||||
        }
 | 
			
		||||
        create("publish") {
 | 
			
		||||
            dimension = "default"
 | 
			
		||||
            signingConfig = signingConfigs.getByName("publish")
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
flutter {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								moneymgr_mobile/android/publish_key.sample
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								moneymgr_mobile/android/publish_key.sample
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
storePassword=<password-from-previous-step>
 | 
			
		||||
keyPassword=<password-from-previous-step>
 | 
			
		||||
keyAlias=upload
 | 
			
		||||
storeFile=<keystore-file-location>
 | 
			
		||||
@@ -127,6 +127,9 @@ dev_dependencies:
 | 
			
		||||
# The following section is specific to Flutter packages.
 | 
			
		||||
flutter:
 | 
			
		||||
 | 
			
		||||
  # Default Android flavor
 | 
			
		||||
  default-flavor: development
 | 
			
		||||
 | 
			
		||||
  # The following line ensures that the Material Icons font is
 | 
			
		||||
  # included with your application, so that you can use the icons in
 | 
			
		||||
  # the material Icons class.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user