Skip to content

Commit

Permalink
chore: add android signing (#1095)
Browse files Browse the repository at this point in the history
Feichtmeier authored Dec 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 9c54130 commit afccd48
Showing 2 changed files with 32 additions and 6 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -79,6 +79,15 @@ https://hosted.weblate.org/projects/musicpod/app
If you find any error please feel free to report it as an issue and describe it as good as you can.
If you want to contribute code, please create an issue first.

## Build

- for Linux desktop builds: `sudo apt install libmpv-dev mpv`
- [install rust](https://www.rust-lang.org/tools/install) (for some dependencies)
- [install flutter](https://docs.flutter.dev/get-started/install)
- required for android builds: [install android-studio](https://developer.android.com/studio)
- required for macos builds: [install xcode](https://developer.apple.com/xcode/)
- as a good IDE for all builds: [install vcode](https://code.visualstudio.com/)

## Testing

Test mocks are generated with [Mockito](https://github.com/dart-lang/mockito). You need to run the `build_runner` command in order to re-generate mocks, in case you changed the signatures of service methods.
29 changes: 23 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -5,6 +5,13 @@ plugins {
id "dev.flutter.flutter-gradle-plugin"
}

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}


android {
namespace = "org.feichtmeier.musicpod"
compileSdk = flutter.compileSdkVersion
@@ -20,21 +27,31 @@ android {
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "org.feichtmeier.musicpod"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = 23
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}

signingConfigs {
release {
keyAlias = keystoreProperties['keyAlias']
keyPassword = keystoreProperties['keyPassword']
storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword = keystoreProperties['storePassword']
}
}

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.debug
if (keystorePropertiesFile.exists()) {
println "🗝 Keystore.properties found, loading config"
signingConfig = signingConfigs.release
} else {
println "⚠️ No Keystore.properties found, loading debug config"
signingConfig = signingConfigs.debug
}
}
}
}

0 comments on commit afccd48

Please sign in to comment.