diff --git a/.github/workflows/build_web_app.yml b/.github/workflows/build_web_app.yml index c15fac5..22b7e22 100644 --- a/.github/workflows/build_web_app.yml +++ b/.github/workflows/build_web_app.yml @@ -1,9 +1,8 @@ - name: Build web app on: push: - branches: [ "main" ] + branches: ["main"] workflow_dispatch: jobs: @@ -14,7 +13,7 @@ jobs: - name: Setup Flutter uses: subosito/flutter-action@v2 with: - channel: 'stable' + channel: "stable" - run: flutter --version - name: Cache pub dependencies @@ -28,7 +27,7 @@ jobs: run: flutter pub get - name: Build Web App - run: cd example && flutter build web --base-href=/universal_ble/ + run: cd example && flutter build web --base-href=/${{ github.event.repository.name }}/ - name: Deploy to GitHub Pages 🚀 uses: JamesIves/github-pages-deploy-action@v4 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..e56f313 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,58 @@ +name: Pull Request + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + + - name: Install dependencies + run: flutter pub get + + - name: Analyze project source + run: flutter analyze + + - name: Run Flutter tests + run: flutter test + + - name: Install Chrome + uses: browser-actions/setup-chrome@latest + + - name: Run Flutter tests on Chrome + uses: coactions/setup-xvfb@v1 + with: + run: flutter test --platform chrome + + pana: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: subosito/flutter-action@v2 + + - name: Install Dependencies + run: | + flutter packages get + flutter pub global activate pana + sudo apt-get install webp + + - name: Verify Pub Score + run: | + PANA=$(pana . --no-warning); PANA_SCORE=$(echo $PANA | sed -n "s/.*Points: \([0-9]*\)\/\([0-9]*\)./\1\/\2/p") + echo "score: $PANA_SCORE" + IFS='/'; read -a SCORE_ARR <<< "$PANA_SCORE"; SCORE=SCORE_ARR[0]; TOTAL=SCORE_ARR[1] + if [ -z "$1" ]; then MINIMUM_SCORE=TOTAL; else MINIMUM_SCORE=$1; fi + if (( $SCORE < $MINIMUM_SCORE )); then echo "minimum score $MINIMUM_SCORE was not met!"; exit 1; fi diff --git a/.github/workflows/test_ble_uuid_parser.yml b/.github/workflows/test_ble_uuid_parser.yml deleted file mode 100644 index 5acc44c..0000000 --- a/.github/workflows/test_ble_uuid_parser.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: BleUuidParser Tests - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - channel: stable - - - name: Install dependencies - run: flutter pub get - - - name: Analyze project source - run: flutter analyze - - - name: Run Flutter tests - run: flutter test - - - name: Install Chrome - uses: browser-actions/setup-chrome@latest - - - name: Run Flutter tests on Chrome - uses: coactions/setup-xvfb@v1 - with: - run: flutter test --platform chrome \ No newline at end of file diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 0334aa4..de66133 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -44,7 +44,7 @@ android { applicationId "com.navideck.universal_ble_example" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdkVersion 21 + minSdkVersion flutter.minSdkVersion targetSdkVersion 35 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/example/macos/Podfile.lock b/example/macos/Podfile.lock index bf1d37e..fcf7fb4 100644 --- a/example/macos/Podfile.lock +++ b/example/macos/Podfile.lock @@ -20,9 +20,9 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/universal_ble/darwin SPEC CHECKSUMS: - device_info_plus: 5401765fde0b8d062a2f8eb65510fb17e77cf07f + device_info_plus: b0fafc687fb901e2af612763340f1b0d4352f8e5 FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1 - universal_ble: cf52a7b3fd2e7c14d6d7262e9fdadb72ab6b88a6 + universal_ble: ff19787898040d721109c6324472e5dd4bc86adc PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3 diff --git a/lib/src/universal_ble.dart b/lib/src/universal_ble.dart index cdabfbc..1a0b093 100644 --- a/lib/src/universal_ble.dart +++ b/lib/src/universal_ble.dart @@ -235,7 +235,7 @@ class UniversalBle { } /// Write a characteristic value. - /// To write a characteristic value without response, set [withoutResponse] to [true]. + /// To write a characteristic value without response, set [withoutResponse] to `true`. static Future write( String deviceId, String service, @@ -364,7 +364,7 @@ class UniversalBle { /// Get connected devices to the system (connected by any app). /// Use [withServices] to filter devices by services. - /// On `Apple`, [withServices] is required to get any connected devices. If not passed, several [18XX] generic services will be set by default. + /// On `Apple`, [withServices] is required to get any connected devices. If not passed, several 18XX generic services will be set by default. /// On `Android`, `Linux` and `Windows`, if [withServices] is used, then internally all services will be discovered for each device first (either by connecting or by using cached services). /// Not supported on `Web`. static Future> getSystemDevices({