diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5a883cae..ee6e94d8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,2 +1,29 @@ # Contributing to Finamp +Thanks for your interest in contrtributing to Finamp! This document goes over how to get started on Finamp development, and other ways to contribute. + +## Setting up a Development Environment + +Finamp is a fairly standard Flutter app, so all you have to do is [install Flutter](https://docs.flutter.dev/get-started/install). Once Flutter is installed, you should be able to run Finamp on emulators/real devices. + +### Android Keys + +To build release APKs, you need to set up a signing key for Android. To get that set up, follow [this guide](https://docs.flutter.dev/deployment/android#signing-the-app) from the Flutter documentation. Note that if you have Finamp installed already, your phone may panic because the key is different. + +### The Arcane Arts (Code Generation) + +![A conversation between me and Chaphasilor. I say "did you try running (the Dart build command)?" They reply "I wasn't aware I need to use the arcane arts for this"](assets/arcane-arts.png) + +Because Dart doesn't support macros and stuff, a few dependencies rely on code generation which must be run manually. These dependencies are: + +* Hive - the database that Finamp uses for storing all data +* `json_serializable` - For deserialising JSON into classes + +To rebuild these files, run `dart run build_runner build --delete-conflicting-outputs`. This must be done when: + +* Modifying a class that is returned by Jellyfin (such as the classes in `lib/models/jellyfin_models.dart`) +* Adding fields to a database class (annotated with `@HiveType`) + +### Hive + +As said earlier, Finamp uses Hive for all data storage needs. If you're doing work that involves data storage, I recommend you read [the Hive docs](https://docs.hivedb.dev/#/). Please ensure that your changes work when upgrading Finamp from the current release to your changes, as not handling upgrades will cause the app to crash. \ No newline at end of file diff --git a/assets/arcane-arts.png b/assets/arcane-arts.png new file mode 100644 index 00000000..36c2ae1d Binary files /dev/null and b/assets/arcane-arts.png differ