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 @@ ...@@ -21,6 +21,6 @@
- [ ] I made sure all projects build. - [ ] 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 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 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 updated the relevant documentation.
- [ ] I rebased onto current `master`. - [ ] I rebased onto current `main`.
...@@ -3,21 +3,23 @@ ...@@ -3,21 +3,23 @@
name: permission_handler name: permission_handler
# Controls when the action will run. Triggers the workflow on push or pull request # 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: on:
push: push:
branches: [ master ] branches: [ main ]
paths: paths:
- 'permission_handler/**' - 'permission_handler/**'
- '.github/workflows/permission_handler.yaml'
pull_request: pull_request:
branches: [ master ] branches: [ main ]
paths: paths:
- 'permission_handler/**' - '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 # A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs: jobs:
format: format:
name: App Facing package name: App facing package
# The type of runner that the job will run on # The type of runner that the job will run on
runs-on: macos-latest runs-on: macos-latest
...@@ -41,9 +43,9 @@ jobs: ...@@ -41,9 +43,9 @@ jobs:
run: flutter pub get run: flutter pub get
working-directory: ${{env.source-directory}} working-directory: ${{env.source-directory}}
# Run Flutter Format to ensure formatting is valid # Run Dart Format to ensure formatting is valid
- name: Run Flutter Format - name: Run Dart Format
run: flutter format --set-exit-if-changed . run: dart format --set-exit-if-changed .
working-directory: ${{env.source-directory}} working-directory: ${{env.source-directory}}
# Run Flutter Analyzer # Run Flutter Analyzer
...@@ -67,8 +69,9 @@ jobs: ...@@ -67,8 +69,9 @@ jobs:
working-directory: ${{env.source-directory}} working-directory: ${{env.source-directory}}
# Upload code coverage information # Upload code coverage information
- uses: codecov/codecov-action@v1 - uses: codecov/codecov-action@v3
with: with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{env.source-directory}}/coverage/lcov.info # optional file: ${{env.source-directory}}/coverage/lcov.info # optional
name: permission_handler (App Facing Package) # optional flags: unittests # optional
fail_ci_if_error: true name: permission_handler # optional
\ No newline at end of file
...@@ -3,16 +3,18 @@ ...@@ -3,16 +3,18 @@
name: permission_handler_android name: permission_handler_android
# Controls when the action will run. Triggers the workflow on push or pull request # 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: on:
push: push:
branches: [ master ] branches: [ main ]
paths: paths:
- 'permission_handler_android/**' - 'permission_handler_android/**'
- '.github/workflows/permission_handler_android.yaml'
pull_request: pull_request:
branches: [ master ] branches: [ main ]
paths: paths:
- 'permission_handler_android/**' - '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 # A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs: jobs:
...@@ -41,9 +43,9 @@ jobs: ...@@ -41,9 +43,9 @@ jobs:
run: flutter pub get run: flutter pub get
working-directory: ${{env.source-directory}} working-directory: ${{env.source-directory}}
# Run Flutter Format to ensure formatting is valid # Run Dart Format to ensure formatting is valid
- name: Run Flutter Format - name: Run Dart Format
run: flutter format --set-exit-if-changed . run: dart format --set-exit-if-changed .
working-directory: ${{env.source-directory}} working-directory: ${{env.source-directory}}
# Run Flutter Analyzer # Run Flutter Analyzer
......
...@@ -3,16 +3,18 @@ ...@@ -3,16 +3,18 @@
name: permission_handler_apple name: permission_handler_apple
# Controls when the action will run. Triggers the workflow on push or pull request # 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: on:
push: push:
branches: [ master ] branches: [ main ]
paths: paths:
- 'permission_handler_apple/**' - 'permission_handler_apple/**'
- '.github/workflows/permission_handler_apple.yaml'
pull_request: pull_request:
branches: [ master ] branches: [ main ]
paths: paths:
- 'permission_handler_apple/**' - '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 # A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs: jobs:
...@@ -41,9 +43,9 @@ jobs: ...@@ -41,9 +43,9 @@ jobs:
run: flutter pub get run: flutter pub get
working-directory: ${{env.source-directory}} working-directory: ${{env.source-directory}}
# Run Flutter Format to ensure formatting is valid # Run Dart Format to ensure formatting is valid
- name: Run Flutter Format - name: Run Dart Format
run: flutter format --set-exit-if-changed . run: dart format --set-exit-if-changed .
working-directory: ${{env.source-directory}} working-directory: ${{env.source-directory}}
# Run Flutter Analyzer # Run Flutter Analyzer
......
...@@ -3,21 +3,23 @@ ...@@ -3,21 +3,23 @@
name: permission_handler_platform_interface name: permission_handler_platform_interface
# Controls when the action will run. Triggers the workflow on push or pull request # 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: on:
push: push:
branches: [ master ] branches: [ main ]
paths: paths:
- 'permission_handler_platform_interface/**' - 'permission_handler_platform_interface/**'
- '.github/workflows/permission_handler_platform_interface.yaml'
pull_request: pull_request:
branches: [ master ] branches: [ main ]
paths: paths:
- 'permission_handler_platform_interface/**' - '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 # A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs: jobs:
build: build:
name: Format name: Platform interface package
# The type of runner that the job will run on # The type of runner that the job will run on
runs-on: ubuntu-latest runs-on: ubuntu-latest
...@@ -40,9 +42,9 @@ jobs: ...@@ -40,9 +42,9 @@ jobs:
run: flutter pub get run: flutter pub get
working-directory: ${{env.source-directory}} working-directory: ${{env.source-directory}}
# Run Flutter Format to ensure formatting is valid # Run Dart Format to ensure formatting is valid
- name: Run Flutter Format - name: Run Dart Format
run: flutter format --set-exit-if-changed . run: dart format --set-exit-if-changed .
working-directory: ${{env.source-directory}} working-directory: ${{env.source-directory}}
# Run Flutter Analyzer # Run Flutter Analyzer
......
...@@ -114,7 +114,7 @@ class _PermissionState extends State<PermissionWidget> { ...@@ -114,7 +114,7 @@ class _PermissionState extends State<PermissionWidget> {
return ListTile( return ListTile(
title: Text( title: Text(
_permission.toString(), _permission.toString(),
style: Theme.of(context).textTheme.bodyText1, style: Theme.of(context).textTheme.bodyLarge,
), ),
subtitle: Text( subtitle: Text(
_permissionStatus.toString(), _permissionStatus.toString(),
......
...@@ -29,6 +29,4 @@ flutter: ...@@ -29,6 +29,4 @@ flutter:
assets: assets:
- res/images/baseflow_logo_def_light-02.png - res/images/baseflow_logo_def_light-02.png
- res/images/poweredByBaseflowLogoLight@3x.png - res/images/poweredByBaseflowLogoLight@3x.png
- packages/baseflow_plugin_template/logo.png
- packages/baseflow_plugin_template/poweredByBaseflow.png
...@@ -28,11 +28,6 @@ android { ...@@ -28,11 +28,6 @@ android {
namespace 'com.baseflow.permissionhandler.example' namespace 'com.baseflow.permissionhandler.example'
compileSdkVersion 33 compileSdkVersion 33
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.baseflow.permissionhandler.example" applicationId "com.baseflow.permissionhandler.example"
......
...@@ -5,7 +5,7 @@ buildscript { ...@@ -5,7 +5,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.1.0' classpath 'com.android.tools.build:gradle:7.1.2'
} }
} }
...@@ -22,6 +22,6 @@ subprojects { ...@@ -22,6 +22,6 @@ subprojects {
project.evaluationDependsOn(':app') project.evaluationDependsOn(':app')
} }
task clean(type: Delete) { tasks.register("clean", Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }
...@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME ...@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists 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: ...@@ -5,7 +5,7 @@ environment:
sdk: ">=2.15.0 <3.0.0" sdk: ">=2.15.0 <3.0.0"
dependencies: dependencies:
baseflow_plugin_template: ^2.1.1 baseflow_plugin_template: ^2.1.2
flutter: flutter:
sdk: flutter sdk: flutter
...@@ -29,6 +29,3 @@ flutter: ...@@ -29,6 +29,3 @@ flutter:
assets: assets:
- res/images/baseflow_logo_def_light-02.png - res/images/baseflow_logo_def_light-02.png
- res/images/poweredByBaseflowLogoLight@3x.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 { ...@@ -63,7 +63,7 @@ class PermissionWidget extends StatefulWidget {
final Permission _permission; final Permission _permission;
@override @override
_PermissionState createState() => _PermissionState(_permission); State<PermissionWidget> createState() => _PermissionState(_permission);
} }
class _PermissionState extends State<PermissionWidget> { class _PermissionState extends State<PermissionWidget> {
...@@ -104,7 +104,7 @@ class _PermissionState extends State<PermissionWidget> { ...@@ -104,7 +104,7 @@ class _PermissionState extends State<PermissionWidget> {
return ListTile( return ListTile(
title: Text( title: Text(
_permission.toString(), _permission.toString(),
style: Theme.of(context).textTheme.bodyText1, style: Theme.of(context).textTheme.bodyLarge,
), ),
subtitle: Text( subtitle: Text(
_permissionStatus.toString(), _permissionStatus.toString(),
......
...@@ -29,6 +29,3 @@ flutter: ...@@ -29,6 +29,3 @@ flutter:
assets: assets:
- res/images/baseflow_logo_def_light-02.png - res/images/baseflow_logo_def_light-02.png
- res/images/poweredByBaseflowLogoLight@3x.png - res/images/poweredByBaseflowLogoLight@3x.png
- packages/baseflow_plugin_template/logo.png
- packages/baseflow_plugin_template/poweredByBaseflow.png
...@@ -13,7 +13,7 @@ class MethodChannelMock { ...@@ -13,7 +13,7 @@ class MethodChannelMock {
this.result, this.result,
this.delay = Duration.zero, this.delay = Duration.zero,
}) : methodChannel = MethodChannel(channelName) { }) : methodChannel = MethodChannel(channelName) {
TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(methodChannel, _handler); .setMockMethodCallHandler(methodChannel, _handler);
} }
......
...@@ -98,7 +98,7 @@ class _PermissionState extends State<PermissionWidget> { ...@@ -98,7 +98,7 @@ class _PermissionState extends State<PermissionWidget> {
return ListTile( return ListTile(
title: Text( title: Text(
_permission.toString(), _permission.toString(),
style: Theme.of(context).textTheme.bodyText1, style: Theme.of(context).textTheme.bodyLarge,
), ),
subtitle: Text( subtitle: Text(
_permissionStatus.toString(), _permissionStatus.toString(),
......
...@@ -7,6 +7,9 @@ list(APPEND FLUTTER_PLUGIN_LIST ...@@ -7,6 +7,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
url_launcher_windows url_launcher_windows
) )
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES) set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST}) foreach(plugin ${FLUTTER_PLUGIN_LIST})
...@@ -15,3 +18,8 @@ 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 $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin) 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