Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add android signing and update readme #1095

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
29 changes: 23 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
}
}
}
Expand Down
Loading