Skip to content

Commit 53209a9

Browse files
Merge pull request #88 from martijn00/updates
Updates to CI and code cleanup
2 parents a4950b4 + 4546c25 commit 53209a9

File tree

146 files changed

+3389
-4898
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+3389
-4898
lines changed

.github/workflows/base.yaml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Base
22

33
on:
4+
workflow_dispatch:
5+
46
push:
57
branches: [main]
68
tags:
@@ -9,11 +11,14 @@ on:
911
pull_request:
1012
branches: [main]
1113

12-
workflow_dispatch:
14+
# This ensures that previous jobs for the PR are canceled when PR is updated
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
1318

1419
jobs:
1520
build:
16-
runs-on: macos-latest
21+
runs-on: ubuntu-latest
1722

1823
steps:
1924
- uses: actions/checkout@v4
@@ -23,29 +28,37 @@ jobs:
2328
with:
2429
paths: "**/*.md"
2530

26-
- name: Flutter action
27-
uses: subosito/flutter-action@v2
31+
- uses: subosito/flutter-action@v2
2832
with:
2933
channel: 'stable'
34+
# use the build-in cache from Subosito
35+
cache: true
3036

3137
- name: Install dependencies
3238
run: flutter pub get
39+
40+
- name: Run l10n
41+
run: flutter gen-l10n
42+
3343
- name: Format code
3444
run: dart format --set-exit-if-changed $(find . -name "*.dart" -not -wholename "./lib/localization/intl/*")
45+
3546
- name: Analyze static code
3647
run: flutter analyze
48+
3749
- name: Run tests
3850
run: flutter test
51+
3952
- name: Check publish warnings
4053
run: dart pub publish --dry-run
54+
4155
- name: Build example
4256
run: |
4357
cd example
4458
flutter build appbundle --debug
45-
flutter build ios --debug --no-codesign
4659
4760
- name: Upload coverage to Codecov
48-
uses: codecov/codecov-action@v3
61+
uses: codecov/codecov-action@v4
4962
env:
5063
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5164
with:
@@ -62,11 +75,19 @@ jobs:
6275
runs-on: ubuntu-latest
6376
steps:
6477
- uses: actions/checkout@v4
78+
6579
- uses: dart-lang/setup-dart@v1
80+
6681
- name: Flutter action
6782
uses: subosito/flutter-action@v2
6883
with:
6984
channel: 'stable'
85+
# use the build-in cache from Subosito
86+
cache: true
87+
88+
- name: Run l10n
89+
run: flutter gen-l10n
90+
7091
- name: Publish package
7192
run: dart pub publish -v -f
7293

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
.pub-cache/
3131
.pub/
3232
build/
33+
pubspec.lock
3334

3435
# Android related
3536
**/android/**/gradle-wrapper.jar
@@ -73,3 +74,6 @@ build/
7374
!**/ios/**/default.mode2v3
7475
!**/ios/**/default.pbxuser
7576
!**/ios/**/default.perspectivev3
77+
78+
# L10n files
79+
**/intl

CHANGELOG.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## 10.0.0
2+
3+
* Update intl to 0.19.0
4+
* Update constraints to Dart 3.4
5+
* Built with Flutter 3.22.0
6+
* Improve CI
7+
* Improve Dutch language
8+
* Add Norwegian
9+
110
## 9.1.0
211

312
* Fix MN translation typo
@@ -28,15 +37,15 @@
2837
## 8.6.0
2938

3039
* Add missed translations for all languages
31-
* Add support for more languanges
40+
* Add support for more languages
3241
* Swedish
3342

3443
## 8.5.0
3544

3645
* New validators for minWordsCount & maxWordsCount
3746
* Simplify arb files and correct intl_zh.arb
3847
* Build with Flutter 3.7.5
39-
* Add support for more languanges
48+
* Add support for more languages
4049
* Mongolian
4150
* Nepali and burmese
4251
* Albanian
@@ -46,7 +55,7 @@
4655

4756
* Refactor l10n generator. Thanks [@ipcjs]()
4857
* Add property to allow empty on equalLength validator. Thanks [@CircleCurve](https://github.com/CircleCurve)
49-
* Add support for more languanges
58+
* Add support for more languages
5059
* Czech. Thanks [@edlman](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/pull/3)
5160
* Bosnian and Croatian. Thanks [@abratanovic](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/pull/9)
5261
* Malay. Thanks [@azmilazizi](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/pull/13)

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Validators support default `errorText` messages in these languages:
9797
- Lao (lo)
9898
- Malay (ms)
9999
- Mongolian (mn)
100+
- Norwegian
100101
- Polish (pl)
101102
- Portuguese (pt)
102103
- Romanian (ro)
@@ -220,7 +221,7 @@ We welcome efforts to internationalize/localize the package by translating the d
220221

221222
`flutter gen-l10n`
222223

223-
The command will automatically create/update files inside the `lib/localization` directory, including your newly added locale support.
224+
The command will automatically create/update files inside the `lib/localization` directory, including your newly added locale support. The files in here are only necessary for local development and will not be committed to Github.
224225

225226
4. Update README
226227

example/.metadata

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
11
# This file tracks properties of this Flutter project.
22
# Used by Flutter tool to assess capabilities and perform upgrades etc.
33
#
4-
# This file should be version controlled.
4+
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: 85684f9300908116a78138ea4c6036c35c9a1236
8-
channel: stable
7+
revision: "5dcb86f68f239346676ceb1ed1ea385bd215fba1"
8+
channel: "stable"
99

1010
project_type: app
1111

1212
# Tracks metadata for the flutter migrate command
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
17-
base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
16+
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
17+
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
18+
- platform: android
19+
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
20+
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
21+
- platform: ios
22+
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
23+
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
24+
- platform: macos
25+
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
26+
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
1827
- platform: web
19-
create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
20-
base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
28+
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
29+
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
30+
- platform: windows
31+
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
32+
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
2133

2234
# User provided section
2335

example/analysis_options.yaml

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
1-
# This file configures the analyzer, which statically analyzes Dart code to
2-
# check for errors, warnings, and lints.
3-
#
4-
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5-
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6-
# invoked from the command line by running `flutter analyze`.
7-
8-
# The following line activates a set of recommended lints for Flutter apps,
9-
# packages, and plugins designed to encourage good coding practices.
101
include: package:flutter_lints/flutter.yaml
112

12-
linter:
13-
# The lint rules applied to this project can be customized in the
14-
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15-
# included above or to enable additional rules. A list of all available lints
16-
# and their documentation is published at
17-
# https://dart-lang.github.io/linter/lints/index.html.
18-
#
19-
# Instead of disabling a lint rule for the entire project in the
20-
# section below, it can also be suppressed for a single line of code
21-
# or a specific dart file by using the `// ignore: name_of_lint` and
22-
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23-
# producing the lint.
24-
rules:
25-
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26-
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27-
28-
# Additional information about this file can be found at
29-
# https://dart.dev/guides/language/analysis-options
3+
analyzer:
4+
exclude:
5+
- lib/localization/intl/**

example/android/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ GeneratedPluginRegistrant.java
99
# Remember to never publicly share your keystore.
1010
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
1111
key.properties
12+
**/*.keystore
13+
**/*.jks

example/android/app/build.gradle

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,57 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id "dev.flutter.flutter-gradle-plugin"
6+
}
7+
18
def localProperties = new Properties()
2-
def localPropertiesFile = rootProject.file('local.properties')
9+
def localPropertiesFile = rootProject.file("local.properties")
310
if (localPropertiesFile.exists()) {
4-
localPropertiesFile.withReader('UTF-8') { reader ->
11+
localPropertiesFile.withReader("UTF-8") { reader ->
512
localProperties.load(reader)
613
}
714
}
815

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
14-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16+
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
1517
if (flutterVersionCode == null) {
16-
flutterVersionCode = '1'
18+
flutterVersionCode = "1"
1719
}
1820

19-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
21+
def flutterVersionName = localProperties.getProperty("flutter.versionName")
2022
if (flutterVersionName == null) {
21-
flutterVersionName = '1.0'
23+
flutterVersionName = "1.0"
2224
}
2325

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2826
android {
29-
compileSdkVersion 31
27+
namespace = "dev.danvickmiller.formbuildervalidators.example"
28+
compileSdk = flutter.compileSdkVersion
29+
ndkVersion = flutter.ndkVersion
3030

31-
sourceSets {
32-
main.java.srcDirs += 'src/main/kotlin'
31+
compileOptions {
32+
sourceCompatibility = JavaVersion.VERSION_1_8
33+
targetCompatibility = JavaVersion.VERSION_1_8
3334
}
3435

3536
defaultConfig {
36-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
37-
applicationId "dev.danvickmiller.formbuildervalidators.example"
38-
minSdkVersion flutter.minSdkVersion
39-
targetSdkVersion 30
40-
versionCode flutterVersionCode.toInteger()
41-
versionName flutterVersionName
37+
applicationId = "dev.danvickmiller.formbuildervalidators.example"
38+
// You can update the following values to match your application needs.
39+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
40+
minSdk = flutter.minSdkVersion
41+
targetSdk = flutter.targetSdkVersion
42+
versionCode = flutterVersionCode.toInteger()
43+
versionName = flutterVersionName
4244
}
4345

4446
buildTypes {
4547
release {
4648
// TODO: Add your own signing config for the release build.
4749
// Signing with the debug keys for now, so `flutter run --release` works.
48-
signingConfig signingConfigs.debug
50+
signingConfig = signingConfigs.debug
4951
}
5052
}
51-
namespace 'dev.danvickmiller.formbuildervalidators.example'
5253
}
5354

5455
flutter {
55-
source '../..'
56-
}
57-
58-
dependencies {
59-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
56+
source = "../.."
6057
}

example/android/app/src/debug/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2-
<!-- Flutter needs it to communicate with the running application
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
34
to allow setting breakpoints, to provide hot reload, etc.
45
-->
56
<uses-permission android:name="android.permission.INTERNET"/>
Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2-
<application
2+
<application
33
android:label="example"
4+
android:name="${applicationName}"
45
android:icon="@mipmap/ic_launcher">
56
<activity
67
android:name=".MainActivity"
8+
android:exported="true"
79
android:launchMode="singleTop"
10+
android:taskAffinity=""
811
android:theme="@style/LaunchTheme"
912
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1013
android:hardwareAccelerated="true"
@@ -17,15 +20,6 @@
1720
android:name="io.flutter.embedding.android.NormalTheme"
1821
android:resource="@style/NormalTheme"
1922
/>
20-
<!-- Displays an Android View that continues showing the launch screen
21-
Drawable until Flutter paints its first frame, then this splash
22-
screen fades out. A splash screen is useful to avoid any visual
23-
gap between the end of Android's launch screen and the painting of
24-
Flutter's first frame. -->
25-
<meta-data
26-
android:name="io.flutter.embedding.android.SplashScreenDrawable"
27-
android:resource="@drawable/launch_background"
28-
/>
2923
<intent-filter>
3024
<action android:name="android.intent.action.MAIN"/>
3125
<category android:name="android.intent.category.LAUNCHER"/>
@@ -37,4 +31,15 @@
3731
android:name="flutterEmbedding"
3832
android:value="2" />
3933
</application>
34+
<!-- Required to query activities that can process text, see:
35+
https://developer.android.com/training/package-visibility and
36+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
37+
38+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
39+
<queries>
40+
<intent>
41+
<action android:name="android.intent.action.PROCESS_TEXT"/>
42+
<data android:mimeType="text/plain"/>
43+
</intent>
44+
</queries>
4045
</manifest>

0 commit comments

Comments
 (0)