Commit cbb3e1e6 by Maurits van Beusekom Committed by GitHub

Migrates CI configuration to use 'dart format' (#1060)

* Migrates CI configuration to use 'dart format'

* Fixes typo

* Resolved analysis warning

* Fix Android build

* Fix deprecation of bodyText1

* Remove unsupported assets from configuration

* Remove redundant ! operator.

* Fix CodeCov configuration

* Update .github/workflows/permission_handler.yaml

Co-authored-by: Jeroen Weener <JeroenWeener@users.noreply.github.com>

---------

Co-authored-by: Jeroen Weener <JeroenWeener@users.noreply.github.com>
parent 6f36b31b
......@@ -21,6 +21,6 @@
- [ ] I made sure all projects build.
- [ ] I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy](https://dart.dev/tools/pub/versioning).
- [ ] I updated CHANGELOG.md to add a description of the change.
- [ ] I followed the style guide lines ([code style guide](https://github.com/Baseflow/flutter-permission-handler/blob/master/CONTRIBUTING.md)).
- [ ] I followed the style guide lines ([code style guide](https://github.com/Baseflow/flutter-permission-handler/blob/main/CONTRIBUTING.md)).
- [ ] I updated the relevant documentation.
- [ ] I rebased onto current `master`.
- [ ] I rebased onto current `main`.
......@@ -3,21 +3,23 @@
name: permission_handler
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
# events but only for the main branch
on:
push:
branches: [ master ]
branches: [ main ]
paths:
- 'permission_handler/**'
- '.github/workflows/permission_handler.yaml'
pull_request:
branches: [ master ]
branches: [ main ]
paths:
- 'permission_handler/**'
- '.github/workflows/permission_handler.yaml'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
format:
name: App Facing package
name: App facing package
# The type of runner that the job will run on
runs-on: macos-latest
......@@ -41,9 +43,9 @@ jobs:
run: flutter pub get
working-directory: ${{env.source-directory}}
# Run Flutter Format to ensure formatting is valid
- name: Run Flutter Format
run: flutter format --set-exit-if-changed .
# Run Dart Format to ensure formatting is valid
- name: Run Dart Format
run: dart format --set-exit-if-changed .
working-directory: ${{env.source-directory}}
# Run Flutter Analyzer
......@@ -67,8 +69,9 @@ jobs:
working-directory: ${{env.source-directory}}
# Upload code coverage information
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{env.source-directory}}/coverage/lcov.info # optional
name: permission_handler (App Facing Package) # optional
fail_ci_if_error: true
\ No newline at end of file
flags: unittests # optional
name: permission_handler # optional
......@@ -3,16 +3,18 @@
name: permission_handler_android
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
# events but only for the main branch
on:
push:
branches: [ master ]
branches: [ main ]
paths:
- 'permission_handler_android/**'
- '.github/workflows/permission_handler_android.yaml'
pull_request:
branches: [ master ]
branches: [ main ]
paths:
- 'permission_handler_android/**'
- '.github/workflows/permission_handler_android.yaml'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
......@@ -41,9 +43,9 @@ jobs:
run: flutter pub get
working-directory: ${{env.source-directory}}
# Run Flutter Format to ensure formatting is valid
- name: Run Flutter Format
run: flutter format --set-exit-if-changed .
# Run Dart Format to ensure formatting is valid
- name: Run Dart Format
run: dart format --set-exit-if-changed .
working-directory: ${{env.source-directory}}
# Run Flutter Analyzer
......
......@@ -3,16 +3,18 @@
name: permission_handler_apple
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
# events but only for the main branch
on:
push:
branches: [ master ]
branches: [ main ]
paths:
- 'permission_handler_apple/**'
- '.github/workflows/permission_handler_apple.yaml'
pull_request:
branches: [ master ]
branches: [ main ]
paths:
- 'permission_handler_apple/**'
- '.github/workflows/permission_handler_apple.yaml'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
......@@ -41,9 +43,9 @@ jobs:
run: flutter pub get
working-directory: ${{env.source-directory}}
# Run Flutter Format to ensure formatting is valid
- name: Run Flutter Format
run: flutter format --set-exit-if-changed .
# Run Dart Format to ensure formatting is valid
- name: Run Dart Format
run: dart format --set-exit-if-changed .
working-directory: ${{env.source-directory}}
# Run Flutter Analyzer
......
......@@ -3,21 +3,23 @@
name: permission_handler_platform_interface
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
# events but only for the main branch
on:
push:
branches: [ master ]
branches: [ main ]
paths:
- 'permission_handler_platform_interface/**'
- '.github/workflows/permission_handler_platform_interface.yaml'
pull_request:
branches: [ master ]
branches: [ main ]
paths:
- 'permission_handler_platform_interface/**'
- '.github/workflows/permission_handler_platform_interface.yaml'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
name: Format
name: Platform interface package
# The type of runner that the job will run on
runs-on: ubuntu-latest
......@@ -40,9 +42,9 @@ jobs:
run: flutter pub get
working-directory: ${{env.source-directory}}
# Run Flutter Format to ensure formatting is valid
- name: Run Flutter Format
run: flutter format --set-exit-if-changed .
# Run Dart Format to ensure formatting is valid
- name: Run Dart Format
run: dart format --set-exit-if-changed .
working-directory: ${{env.source-directory}}
# Run Flutter Analyzer
......
......@@ -114,7 +114,7 @@ class _PermissionState extends State<PermissionWidget> {
return ListTile(
title: Text(
_permission.toString(),
style: Theme.of(context).textTheme.bodyText1,
style: Theme.of(context).textTheme.bodyLarge,
),
subtitle: Text(
_permissionStatus.toString(),
......
......@@ -29,6 +29,4 @@ flutter:
assets:
- res/images/baseflow_logo_def_light-02.png
- res/images/poweredByBaseflowLogoLight@3x.png
- packages/baseflow_plugin_template/logo.png
- packages/baseflow_plugin_template/poweredByBaseflow.png
......@@ -28,11 +28,6 @@ android {
namespace 'com.baseflow.permissionhandler.example'
compileSdkVersion 33
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.baseflow.permissionhandler.example"
......
......@@ -5,7 +5,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:7.1.2'
}
}
......@@ -22,6 +22,6 @@ subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
......@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
......@@ -5,7 +5,7 @@ environment:
sdk: ">=2.15.0 <3.0.0"
dependencies:
baseflow_plugin_template: ^2.1.1
baseflow_plugin_template: ^2.1.2
flutter:
sdk: flutter
......@@ -29,6 +29,3 @@ flutter:
assets:
- res/images/baseflow_logo_def_light-02.png
- res/images/poweredByBaseflowLogoLight@3x.png
- packages/baseflow_plugin_template/logo.png
- packages/baseflow_plugin_template/poweredByBaseflow.png
......@@ -63,7 +63,7 @@ class PermissionWidget extends StatefulWidget {
final Permission _permission;
@override
_PermissionState createState() => _PermissionState(_permission);
State<PermissionWidget> createState() => _PermissionState(_permission);
}
class _PermissionState extends State<PermissionWidget> {
......@@ -104,7 +104,7 @@ class _PermissionState extends State<PermissionWidget> {
return ListTile(
title: Text(
_permission.toString(),
style: Theme.of(context).textTheme.bodyText1,
style: Theme.of(context).textTheme.bodyLarge,
),
subtitle: Text(
_permissionStatus.toString(),
......
......@@ -29,6 +29,3 @@ flutter:
assets:
- res/images/baseflow_logo_def_light-02.png
- res/images/poweredByBaseflowLogoLight@3x.png
- packages/baseflow_plugin_template/logo.png
- packages/baseflow_plugin_template/poweredByBaseflow.png
......@@ -13,7 +13,7 @@ class MethodChannelMock {
this.result,
this.delay = Duration.zero,
}) : methodChannel = MethodChannel(channelName) {
TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(methodChannel, _handler);
}
......
......@@ -98,7 +98,7 @@ class _PermissionState extends State<PermissionWidget> {
return ListTile(
title: Text(
_permission.toString(),
style: Theme.of(context).textTheme.bodyText1,
style: Theme.of(context).textTheme.bodyLarge,
),
subtitle: Text(
_permissionStatus.toString(),
......
......@@ -7,6 +7,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
url_launcher_windows
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
......@@ -15,3 +18,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment