Skip to content

Commit

Permalink
[325] Build mimir (#339)
Browse files Browse the repository at this point in the history
* [325] chore: build mimir

* [325] chore: upgrade to flutter 3.27.1

* [325] chore: improve mimir build

* [325] fix: notes shared plural

* [325] chore: fix submodules

* [325] chore: use flutter_mimir from pub.dev
  • Loading branch information
maelchiotti authored Jan 4, 2025
1 parent be6e07d commit 84293c2
Show file tree
Hide file tree
Showing 18 changed files with 163 additions and 89 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: Setup mimir
run: bash scripts/mimir/fdroid_build_mimir.sh
run: bash scripts/mimir/fdroid_build_mimir.sh x64 armv7 arm64
- name: Add keystore
run: echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 -d > android/localmaterialnotes_keystore.jks
- name: Add key properties
Expand Down
1 change: 0 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[submodule ".isar"]
path = .isar
url = https://github.com/isar-community/isar

[submodule ".mimir"]
path = .mimir
url = https://github.com/GregoryConrad/mimir
2 changes: 1 addition & 1 deletion .isar
2 changes: 1 addition & 1 deletion .mimir
4 changes: 2 additions & 2 deletions android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gradle-wrapper.jar
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
# See https://flutter.dev/to/reference-keystore
key.properties
**/*.keystore
**/*.jks
**/*.jks
13 changes: 5 additions & 8 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}

Expand Down Expand Up @@ -35,9 +36,9 @@ android.applicationVariants.all { variant ->
}

android {
namespace "com.maelchiotti.localmaterialnotes"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
namespace = "com.maelchiotti.localmaterialnotes"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
Expand All @@ -48,10 +49,6 @@ android {
jvmTarget = JavaVersion.VERSION_1_8
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

dependenciesInfo {
includeInApk = false
includeInBundle = false
Expand Down Expand Up @@ -92,7 +89,7 @@ android {
}

flutter {
source '../..'
source = "../.."
}

dependencies {
Expand Down
8 changes: 7 additions & 1 deletion android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
-keep class androidx.lifecycle.DefaultLifecycleObserver
-keep class androidx.lifecycle.DefaultLifecycleObserver

# TODO: check if this can be removed by removing the dependency to encrypt
-dontwarn com.google.errorprone.annotations.CanIgnoreReturnValue
-dontwarn com.google.errorprone.annotations.CheckReturnValue
-dontwarn com.google.errorprone.annotations.Immutable
-dontwarn com.google.errorprone.annotations.RestrictedApi
11 changes: 11 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTask"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
Expand Down Expand Up @@ -38,5 +39,15 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT" />
<data android:mimeType="text/plain" />
</intent>
</queries>
</manifest>
4 changes: 0 additions & 4 deletions android/app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Expand Down
4 changes: 0 additions & 4 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ allprojects {
}
}

rootProject.buildDir = '../build'
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
project.evaluationDependsOn(":app")
}

tasks.register("clean", Delete) {
Expand Down
4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-all.zip
distributionSha256Sum=fe696c020f241a5f69c30f763c5a7f38eec54b490db19cd2b0962dda420d7d12
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
distributionSha256Sum=bb09982fdf52718e4c7b25023d10df6d35a5fff969860bdf5a5bd27a3ab27a9e
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.4.2" apply false
id "com.android.application" version "8.1.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}

Expand Down
10 changes: 5 additions & 5 deletions lib/l10n/translations/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@
"@dialog_delete": {
"description": "Title of the the dialog to delete one or multiple notes (moving them to the bin), and text for the confirmation button."
},
"dialog_delete_body": "Do you really want to delete {count} {count, plural, zero{} one{note} other{notes}}? You can restore {count, plural, zero{} one{it} other{them}} from the bin.",
"dialog_delete_body": "Do you really want to delete {count} {count, plural, one{note} other{notes}}? You can restore {count, plural, one{it} other{them}} from the bin.",
"@dialog_delete_body": {
"description": "Text for the dialog to confirm the deletion of one or multiple notes.",
"placeholders": {
Expand All @@ -761,7 +761,7 @@
"@dialog_permanently_delete": {
"description": "Title of the the dialog to permanently delete one or multiple notes, and text for the confirmation button."
},
"dialog_permanently_delete_body": "Do you really want to permanently delete {count} {count, plural, zero{} one{note} other{notes}}? You will not be able to restore {count, plural, zero{} one{it} other{them}}.",
"dialog_permanently_delete_body": "Do you really want to permanently delete {count} {count, plural, one{note} other{notes}}? You will not be able to restore {count, plural, one{it} other{them}}.",
"@dialog_permanently_delete_body": {
"description": "Text for the dialog to confirm the permanent deletion of one or multiple notes.",
"placeholders": {
Expand All @@ -775,7 +775,7 @@
"@dialog_restore": {
"description": "Title of the the dialog to restore one or multiple notes from the bin, and text for the confirmation button."
},
"dialog_restore_body": "Do you really want to restore {count} {count, plural, zero{} one{note} other{notes}}?",
"dialog_restore_body": "Do you really want to restore {count} {count, plural, one{note} other{notes}}?",
"@dialog_restore_body": {
"description": "Text for the dialog to confirm restoring one or multiple notes from the bin.",
"placeholders": {
Expand All @@ -797,7 +797,7 @@
"@dialog_delete_label": {
"description": "Title of the the dialog to delete one or multiple labels, and text for the confirmation button."
},
"dialog_delete_label_body": "Do you really want to delete {count} {count, plural, zero{} one{label} other{labels}}? {count, plural, zero{} one{It} other{They}} will be removed from the notes where you added {count, plural, zero{} one{it} other{them}}.",
"dialog_delete_label_body": "Do you really want to delete {count} {count, plural, one{label} other{labels}}? {count, plural, one{It} other{They}} will be removed from the notes where you added {count, plural, one{it} other{them}}.",
"@dialog_delete_label_body": {
"description": "Text for the dialog to confirm the deletion of one or multiple notes.",
"placeholders": {
Expand Down Expand Up @@ -887,7 +887,7 @@
"@action_share": {
"description": "Swipe or menu action to share a note."
},
"action_share_subject": "{count} notes shared from Material Notes",
"action_share_subject": "{count} {count, plural, one{note} other{notes}} shared from Material Notes",
"@action_share_subject": {
"description": "Subject of the text that is shared when multiple notes are shared at the same time.",
"placeholders": {
Expand Down
Loading

0 comments on commit 84293c2

Please sign in to comment.