diff --git a/.github/actions/filter-out-non-e2e-enabled/action.yml b/.github/actions/filter-out-non-e2e-enabled/action.yml deleted file mode 100644 index 7659d709f..000000000 --- a/.github/actions/filter-out-non-e2e-enabled/action.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Filter Out Non-E2E Enabled Packages -description: Action for filtering out packages that dont have E2E Tests -inputs: - paths: - description: An array of package paths - required: true -outputs: - e2e-paths: - description: An array of relative paths to packages that have e2e -runs: - using: node16 - main: main.js \ No newline at end of file diff --git a/.github/actions/filter-out-non-e2e-enabled/main.js b/.github/actions/filter-out-non-e2e-enabled/main.js deleted file mode 100644 index 9a80b504e..000000000 --- a/.github/actions/filter-out-non-e2e-enabled/main.js +++ /dev/null @@ -1,17 +0,0 @@ -require = require('esm')(module); - -const { relative, resolve, join } = require('path'); -const { existsSync } = require('fs'); -const core = require('@actions/core') - -const { root } = require('../../../scripts/lib/repo.mjs'); -const { execute } = require('../../../scripts/lib/cli.mjs'); - -execute(async () => { - const paths = JSON.parse(core.getInput('paths', '[]')).map(f => resolve(root, f)); - const filteredPaths = paths.filter(path => existsSync(join(path, 'e2e-tests'))); - const output = JSON.stringify(filteredPaths.map(path => relative(root, path))); - - core.info(`E2E enabled paths: ${output}`); - core.setOutput('e2e-paths', output); -}); \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 537629b08..3980bf3d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-14] + os: [ubuntu-latest, macos-15] timeout-minutes: 30 outputs: plugins: ${{ steps.packages.outputs.paths }} @@ -22,11 +22,9 @@ jobs: with: access_token: ${{ secrets.GITHUB_TOKEN }} - name: Get Latest - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18.x - - name: NPM ^9.5.0 - run: npm i -g npm@^9.5.0 --registry=https://registry.npmjs.org + node-version: 20 - uses: actions/checkout@v3 - name: Restore Dependency Cache id: cache-modules @@ -51,16 +49,14 @@ jobs: files: ${{ steps.catjson.outputs.FILES_JSON }} lint-scripts: - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 needs: - setup steps: - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18.x - - name: NPM ^9.5.0 - run: npm i -g npm@^9.5.0 --registry=https://registry.npmjs.org + node-version: 20 - uses: actions/checkout@v3 - name: Restore Dependency Cache id: cache-modules @@ -74,7 +70,7 @@ jobs: - run: npm run lint lint: - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 needs: - setup @@ -84,11 +80,9 @@ jobs: matrix: plugin: ${{ fromJson(needs.setup.outputs.plugins) }} steps: - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18.x - - name: NPM ^9.5.0 - run: npm i -g npm@^9.5.0 --registry=https://registry.npmjs.org + node-version: 20 - uses: actions/checkout@v3 - name: Restore Dependency Cache id: cache-modules @@ -103,7 +97,7 @@ jobs: working-directory: ${{ matrix.plugin }} verify-ios: - runs-on: macos-14 + runs-on: macos-15 if: needs.setup.outputs.plugins != '[]' timeout-minutes: 30 needs: @@ -113,15 +107,13 @@ jobs: strategy: matrix: xcode: - - /Applications/Xcode_15.0.app + - /Applications/Xcode_16.app plugin: ${{ fromJson(needs.setup.outputs.plugins) }} steps: - run: sudo xcode-select --switch ${{ matrix.xcode }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18.x - - name: NPM ^9.5.0 - run: npm i -g npm@^9.5.0 --registry=https://registry.npmjs.org + node-version: 20 - uses: actions/checkout@v3 - name: Restore Dependency Cache id: cache-modules @@ -147,16 +139,14 @@ jobs: matrix: plugin: ${{ fromJson(needs.setup.outputs.plugins) }} steps: - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18.x - - name: set up JDK 17 - uses: actions/setup-java@v3 + node-version: 20 + - name: set up JDK 21 + uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '21' distribution: 'zulu' - - name: NPM ^9.5.0 - run: npm i -g npm@^9.5.0 --registry=https://registry.npmjs.org - uses: actions/checkout@v3 - name: Restore Dependency Cache id: cache-modules @@ -183,11 +173,9 @@ jobs: matrix: plugin: ${{ fromJson(needs.setup.outputs.plugins) }} steps: - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18.x - - name: NPM ^9.5.0 - run: npm i -g npm@^9.5.0 --registry=https://registry.npmjs.org + node-version: 20 - uses: actions/checkout@v3 - name: Restore Dependency Cache id: cache-modules diff --git a/.github/workflows/dev-releases-for-pr.yml b/.github/workflows/dev-releases-for-pr.yml index c68855fb1..262206104 100644 --- a/.github/workflows/dev-releases-for-pr.yml +++ b/.github/workflows/dev-releases-for-pr.yml @@ -23,9 +23,9 @@ jobs: with: access_token: ${{ secrets.GITHUB_TOKEN }} - name: Get Latest - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18.18.0 + node-version: 20 - uses: actions/checkout@v3 - name: Restore Dependency Cache id: cache-modules @@ -61,9 +61,9 @@ jobs: matrix: plugin: ${{ fromJson(needs.setup.outputs.plugins) }} steps: - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18.18.0 + node-version: 20 - uses: actions/checkout@v3 - name: Restore Dependency Cache id: cache-modules diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml deleted file mode 100644 index 30ff12c5d..000000000 --- a/.github/workflows/e2e.yml +++ /dev/null @@ -1,166 +0,0 @@ -name: E2E Tests - -on: - pull_request: - branches: - - '**' - -jobs: - setup: - if: 'false' - runs-on: ubuntu-latest - timeout-minutes: 30 - outputs: - plugins: ${{ steps.e2e-packages.outputs.e2e-paths }} - steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@ce177499ccf9fd2aded3b0426c97e5434c2e8a73 - with: - access_token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v2 - - name: Restore Dependency Cache - id: cache-modules - uses: actions/cache@v2 - with: - path: | - node_modules - */node_modules - key: dependency-cache-${{ hashFiles('package.json', '*/package.json') }} - - run: npm install - - id: files - uses: imhoffd/get-changed-files@v2 - with: - format: 'json' - - id: packages - uses: ./.github/actions/changed-packages - with: - files: ${{ steps.files.outputs.all }} - - id: e2e-packages - uses: ./.github/actions/filter-out-non-e2e-enabled - with: - paths: ${{ steps.packages.outputs.paths }} - - e2e-ios: - runs-on: macos-11 - timeout-minutes: 35 - if: needs.setup.outputs.plugins != '[]' - needs: - - setup - strategy: - matrix: - plugin: ${{ fromJson(needs.setup.outputs.plugins) }} - defaults: - run: - working-directory: ${{ matrix.plugin }}/e2e-tests - steps: - - uses: actions/checkout@v2 - - - name: Setup NodeJS & NPM - uses: actions/setup-node@v2 - with: - node-version: 14.x - - - name: Prepare Local Package - run: npm install && npm run build && npm run pack-local - working-directory: ${{ matrix.plugin }} - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Setup NPMRC - run: echo "//registry.npmjs.org/:_authToken=${{secrets.E2E_NPM_TOKEN}}" > .npmrc - - - name: Prepare Local Package - run: npm run e2e:prepare - env: - NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} - - - name: Install Packages - run: npm install - env: - NPM_TOKEN: ${{ secrets.E2E_NPM_TOKEN }} - - - name: Run E2E Test on iOS - run: npm run e2e:ios - env: - REACT_APP_GOOGLE_MAPS_API_KEY: ${{ secrets.REACT_APP_GOOGLE_MAPS_API_KEY }} - - e2e-android: - runs-on: macos-10.15 - timeout-minutes: 35 - if: needs.setup.outputs.plugins != '[]' - needs: - - setup - strategy: - matrix: - plugin: ${{ fromJson(needs.setup.outputs.plugins) }} - defaults: - run: - working-directory: ${{ matrix.plugin }}/e2e-tests - steps: - - uses: actions/checkout@v2 - - - name: Setup NodeJS & NPM - uses: actions/setup-node@v2 - with: - node-version: 14.x - - - name: Prepare Local Package - run: npm run e2e:prepare - env: - NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} - - - name: Prepare Local Package - run: npm install && npm run build && npm run pack-local - working-directory: ${{ matrix.plugin }} - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Setup NPMRC - run: echo "//registry.npmjs.org/:_authToken=${{secrets.E2E_NPM_TOKEN}}" > .npmrc - - - name: Setup local.properties - run: echo "REACT_APP_GOOGLE_MAPS_API_KEY=${{secrets.REACT_APP_GOOGLE_MAPS_API_KEY}}" > android/local.properties - - - name: Install Packages - run: npm install - env: - NPM_TOKEN: ${{ secrets.E2E_NPM_TOKEN }} - - - name: AVD cache - uses: actions/cache@v2 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-adb-p3a-30-cache-2 - - - name: Create AVD and generate snapshot for caching - if: steps.avd-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@v2 - with: - avd-name: e2eDevice - api-level: 30 - target: google_apis - arch: x86 - profile: pixel_3a - emulator-build: 7759208 - force-avd-creation: true - emulator-options: -no-window -no-audio -no-boot-anim -accel on - script: echo "Generated AVD snapshot for caching." - - - name: Run E2E Test on Android - uses: reactivecircus/android-emulator-runner@v2 - with: - avd-name: e2eDevice - api-level: 30 - target: google_apis - arch: x86 - profile: pixel_3a - working-directory: ${{ matrix.plugin }}/e2e-tests - emulator-build: 7759208 - emulator-options: -no-window -no-audio -no-boot-anim -accel on -no-snapshot-save - disable-animations: false - script: npm run e2e:android - env: - REACT_APP_GOOGLE_MAPS_API_KEY: ${{ secrets.REACT_APP_GOOGLE_MAPS_API_KEY }} diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml index 3fb4f3fbf..c05e9bfb9 100644 --- a/.github/workflows/publish-android.yml +++ b/.github/workflows/publish-android.yml @@ -50,10 +50,10 @@ jobs: with: fetch-depth: 0 token: ${{ secrets.CAP_GH_RELEASE_TOKEN }} - - name: set up JDK 17 - uses: actions/setup-java@v3 + - name: set up JDK 21 + uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '21' distribution: 'zulu' - name: Grant execute permission for publishing script run: chmod +x ./scripts/publish-android.sh diff --git a/.github/workflows/publish-ios.yml b/.github/workflows/publish-ios.yml index 7187cb7bb..8506fb313 100644 --- a/.github/workflows/publish-ios.yml +++ b/.github/workflows/publish-ios.yml @@ -8,17 +8,17 @@ on: required: true jobs: publish-ios: - runs-on: macos-14 + runs-on: macos-15 if: github.event.inputs.plugins != '[]' timeout-minutes: 30 strategy: matrix: plugin: ${{ fromJson(github.event.inputs.plugins) }} steps: - - run: sudo xcode-select --switch /Applications/Xcode_15.0.app - - uses: actions/setup-node@v3 + - run: sudo xcode-select --switch /Applications/Xcode_16.app + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 20 - uses: actions/checkout@v3 - name: Install Cocoapods run: | diff --git a/.github/workflows/publish-npm-alpha.yml b/.github/workflows/publish-npm-alpha.yml index dca4f67f8..96ea717c5 100644 --- a/.github/workflows/publish-npm-alpha.yml +++ b/.github/workflows/publish-npm-alpha.yml @@ -8,16 +8,16 @@ permissions: jobs: deploy-npm-alpha: - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 steps: - uses: actions/checkout@v3 with: fetch-depth: 0 token: ${{ secrets.CAP_GH_RELEASE_TOKEN }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 registry-url: https://registry.npmjs.org/ cache: npm cache-dependency-path: '**/package.json' diff --git a/.github/workflows/publish-npm-beta.yml b/.github/workflows/publish-npm-beta.yml index d39d359a5..072dd1e43 100644 --- a/.github/workflows/publish-npm-beta.yml +++ b/.github/workflows/publish-npm-beta.yml @@ -8,16 +8,16 @@ permissions: jobs: deploy-npm-beta: - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 steps: - uses: actions/checkout@v3 with: fetch-depth: 0 token: ${{ secrets.CAP_GH_RELEASE_TOKEN }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 registry-url: https://registry.npmjs.org/ cache: npm cache-dependency-path: '**/package.json' diff --git a/.github/workflows/publish-npm-dev.yml b/.github/workflows/publish-npm-dev.yml index aff2ef85c..ea395eda5 100644 --- a/.github/workflows/publish-npm-dev.yml +++ b/.github/workflows/publish-npm-dev.yml @@ -8,16 +8,16 @@ permissions: jobs: deploy-npm-dev: - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 steps: - uses: actions/checkout@v3 with: fetch-depth: 0 token: ${{ secrets.CAP_GH_RELEASE_TOKEN }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 registry-url: https://registry.npmjs.org/ cache: npm cache-dependency-path: '**/package.json' diff --git a/.github/workflows/publish-npm-latest-from-pre.yml b/.github/workflows/publish-npm-latest-from-pre.yml index c0e19d912..cb1a2f080 100644 --- a/.github/workflows/publish-npm-latest-from-pre.yml +++ b/.github/workflows/publish-npm-latest-from-pre.yml @@ -16,16 +16,16 @@ permissions: jobs: deploy-npm-latest-from-pre: if: github.ref == 'refs/heads/main' - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 steps: - uses: actions/checkout@v3 with: fetch-depth: 0 token: ${{ secrets.CAP_GH_RELEASE_TOKEN }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 registry-url: https://registry.npmjs.org/ cache: npm cache-dependency-path: '**/package.json' diff --git a/.github/workflows/publish-npm-latest.yml b/.github/workflows/publish-npm-latest.yml index 2a4dac503..504281bcd 100644 --- a/.github/workflows/publish-npm-latest.yml +++ b/.github/workflows/publish-npm-latest.yml @@ -16,16 +16,16 @@ permissions: jobs: deploy-npm-latest: if: github.ref == 'refs/heads/main' - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 steps: - uses: actions/checkout@v3 with: fetch-depth: 0 token: ${{ secrets.CAP_GH_RELEASE_TOKEN }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 registry-url: https://registry.npmjs.org/ cache: npm cache-dependency-path: '**/package.json' diff --git a/.github/workflows/publish-npm-nightly.yml b/.github/workflows/publish-npm-nightly.yml index 30a89367e..39b6bfae6 100644 --- a/.github/workflows/publish-npm-nightly.yml +++ b/.github/workflows/publish-npm-nightly.yml @@ -11,16 +11,16 @@ permissions: jobs: deploy-npm-nightly: if: github.ref == 'refs/heads/main' - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 steps: - uses: actions/checkout@v3 with: fetch-depth: 0 token: ${{ secrets.CAP_GH_RELEASE_TOKEN }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 registry-url: https://registry.npmjs.org/ cache: npm cache-dependency-path: '**/package.json' diff --git a/.github/workflows/publish-npm-rc.yml b/.github/workflows/publish-npm-rc.yml index 017889bd3..cb9f71ebf 100644 --- a/.github/workflows/publish-npm-rc.yml +++ b/.github/workflows/publish-npm-rc.yml @@ -8,16 +8,16 @@ permissions: jobs: deploy-npm-rc: - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 30 steps: - uses: actions/checkout@v3 with: fetch-depth: 0 token: ${{ secrets.CAP_GH_RELEASE_TOKEN }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 registry-url: https://registry.npmjs.org/ cache: npm cache-dependency-path: '**/package.json' diff --git a/action-sheet/CHANGELOG.md b/action-sheet/CHANGELOG.md index 16e6326df..ff4c4b8f4 100644 --- a/action-sheet/CHANGELOG.md +++ b/action-sheet/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/action-sheet@7.0.0-alpha.1...@capacitor/action-sheet@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/action-sheet + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/action-sheet@6.0.2...@capacitor/action-sheet@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/action-sheet + +## [6.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/action-sheet@6.0.1...@capacitor/action-sheet@6.0.2) (2024-08-08) + +**Note:** Version bump only for package @capacitor/action-sheet + ## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/action-sheet@6.0.0...@capacitor/action-sheet@6.0.1) (2024-06-13) **Note:** Version bump only for package @capacitor/action-sheet diff --git a/action-sheet/CapacitorActionSheet.podspec b/action-sheet/CapacitorActionSheet.podspec index 3bee35eeb..e398da599 100644 --- a/action-sheet/CapacitorActionSheet.podspec +++ b/action-sheet/CapacitorActionSheet.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'action-sheet/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/action-sheet/Package.swift b/action-sheet/Package.swift index 696985a59..6f1520d05 100644 --- a/action-sheet/Package.swift +++ b/action-sheet/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorActionSheet", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorActionSheet", diff --git a/action-sheet/README.md b/action-sheet/README.md index 2c9872ed1..b72498423 100644 --- a/action-sheet/README.md +++ b/action-sheet/README.md @@ -13,7 +13,7 @@ npx cap sync This plugin will use the following project variables (defined in your app's `variables.gradle` file): -- `androidxMaterialVersion`: version of `com.google.android.material:material` (default: `1.10.0`) +- `androidxMaterialVersion`: version of `com.google.android.material:material` (default: `1.12.0`) ## PWA Notes diff --git a/action-sheet/android/build.gradle b/action-sheet/android/build.gradle index 75f5e32f1..de5ea4afc 100644 --- a/action-sheet/android/build.gradle +++ b/action-sheet/android/build.gradle @@ -1,10 +1,10 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxMaterialVersion = project.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.10.0' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxMaterialVersion = project.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.12.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -16,7 +16,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -32,10 +32,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.actionsheet" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -50,8 +50,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/action-sheet/android/gradle/wrapper/gradle-wrapper.jar b/action-sheet/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/action-sheet/android/gradle/wrapper/gradle-wrapper.jar and b/action-sheet/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/action-sheet/android/gradle/wrapper/gradle-wrapper.properties b/action-sheet/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/action-sheet/android/gradle/wrapper/gradle-wrapper.properties +++ b/action-sheet/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/action-sheet/android/gradlew b/action-sheet/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/action-sheet/android/gradlew +++ b/action-sheet/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/action-sheet/android/gradlew.bat b/action-sheet/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/action-sheet/android/gradlew.bat +++ b/action-sheet/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/action-sheet/package.json b/action-sheet/package.json index fb8b4aa37..736126bcb 100644 --- a/action-sheet/package.json +++ b/action-sheet/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/action-sheet", - "version": "6.0.1", + "version": "7.0.0-alpha.2", "description": "The Action Sheet API provides access to native Action Sheets, which come up from the bottom of the screen and display actions a user can take.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorActionSheet -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorActionSheet -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api ActionSheetPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorActionSheet.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/action-sheet/rollup.config.js b/action-sheet/rollup.config.mjs similarity index 100% rename from action-sheet/rollup.config.js rename to action-sheet/rollup.config.mjs diff --git a/app-launcher/CHANGELOG.md b/app-launcher/CHANGELOG.md index 85d6b759e..e287f28e4 100644 --- a/app-launcher/CHANGELOG.md +++ b/app-launcher/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/app-launcher@7.0.0-alpha.1...@capacitor/app-launcher@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/app-launcher + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/app-launcher@6.0.2...@capacitor/app-launcher@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/app-launcher + +## [6.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/app-launcher@6.0.1...@capacitor/app-launcher@6.0.2) (2024-08-08) + +**Note:** Version bump only for package @capacitor/app-launcher + ## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/app-launcher@6.0.0...@capacitor/app-launcher@6.0.1) (2024-06-13) **Note:** Version bump only for package @capacitor/app-launcher diff --git a/app-launcher/CapacitorAppLauncher.podspec b/app-launcher/CapacitorAppLauncher.podspec index 1ab008214..42f821c8d 100644 --- a/app-launcher/CapacitorAppLauncher.podspec +++ b/app-launcher/CapacitorAppLauncher.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'app-launcher/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/app-launcher/Package.swift b/app-launcher/Package.swift index 1b9729feb..1aa6f283c 100644 --- a/app-launcher/Package.swift +++ b/app-launcher/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorAppLauncher", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorAppLauncher", diff --git a/app-launcher/android/build.gradle b/app-launcher/android/build.gradle index 19e8c0c39..2c753b7c9 100644 --- a/app-launcher/android/build.gradle +++ b/app-launcher/android/build.gradle @@ -1,9 +1,9 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -15,7 +15,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.applauncher" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -49,8 +49,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/app-launcher/android/gradle/wrapper/gradle-wrapper.jar b/app-launcher/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/app-launcher/android/gradle/wrapper/gradle-wrapper.jar and b/app-launcher/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/app-launcher/android/gradle/wrapper/gradle-wrapper.properties b/app-launcher/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/app-launcher/android/gradle/wrapper/gradle-wrapper.properties +++ b/app-launcher/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/app-launcher/android/gradlew b/app-launcher/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/app-launcher/android/gradlew +++ b/app-launcher/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/app-launcher/android/gradlew.bat b/app-launcher/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/app-launcher/android/gradlew.bat +++ b/app-launcher/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/app-launcher/package.json b/app-launcher/package.json index 0c1230c12..bdadf196a 100644 --- a/app-launcher/package.json +++ b/app-launcher/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/app-launcher", - "version": "6.0.1", + "version": "7.0.0-alpha.2", "description": "The AppLauncher API allows to open other apps", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorAppLauncher -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorAppLauncher -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,17 +40,17 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api AppLauncherPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorAppLauncher.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", @@ -58,12 +58,12 @@ "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^3.0.2", - "rollup": "^2.32.0", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/app-launcher/rollup.config.js b/app-launcher/rollup.config.mjs similarity index 100% rename from app-launcher/rollup.config.js rename to app-launcher/rollup.config.mjs diff --git a/app/CHANGELOG.md b/app/CHANGELOG.md index 8638439a3..a9a74ae82 100644 --- a/app/CHANGELOG.md +++ b/app/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/app@7.0.0-alpha.1...@capacitor/app@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/app + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/app@6.0.1...@capacitor/app@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/app + +## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/app@6.0.0...@capacitor/app@6.0.1) (2024-08-08) + +**Note:** Version bump only for package @capacitor/app + # [6.0.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/app@6.0.0-rc.1...@capacitor/app@6.0.0) (2024-04-15) **Note:** Version bump only for package @capacitor/app diff --git a/app/CapacitorApp.podspec b/app/CapacitorApp.podspec index 2406e7fef..0c1c9262f 100644 --- a/app/CapacitorApp.podspec +++ b/app/CapacitorApp.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'app/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/app/Package.swift b/app/Package.swift index b831ef0c5..96680d462 100644 --- a/app/Package.swift +++ b/app/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorApp", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorApp", diff --git a/app/android/build.gradle b/app/android/build.gradle index 64597aa82..eb307964e 100644 --- a/app/android/build.gradle +++ b/app/android/build.gradle @@ -1,9 +1,9 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -15,7 +15,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.app" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -49,8 +49,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/app/android/gradle/wrapper/gradle-wrapper.jar b/app/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/app/android/gradle/wrapper/gradle-wrapper.jar and b/app/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/app/android/gradle/wrapper/gradle-wrapper.properties b/app/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/app/android/gradle/wrapper/gradle-wrapper.properties +++ b/app/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/app/android/gradlew b/app/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/app/android/gradlew +++ b/app/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/app/android/gradlew.bat b/app/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/app/android/gradlew.bat +++ b/app/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/app/package.json b/app/package.json index be87059ee..1893605ca 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/app", - "version": "6.0.0", + "version": "7.0.0-alpha.2", "description": "The App API handles high level App state and events.For example, this API emits events when the app enters and leaves the foreground, handles deeplinks, opens other apps, and manages persisted plugin state.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorApp -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorApp -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api AppPlugin --output-readme README.md", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorApp.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/app/rollup.config.js b/app/rollup.config.mjs similarity index 100% rename from app/rollup.config.js rename to app/rollup.config.mjs diff --git a/app/src/definitions.ts b/app/src/definitions.ts index 072dda507..ff8324896 100644 --- a/app/src/definitions.ts +++ b/app/src/definitions.ts @@ -275,15 +275,3 @@ export interface AppPlugin { */ removeAllListeners(): Promise; } - -/** - * @deprecated Use `RestoredListenerEvent`. - * @since 1.0.0 - */ -export type AppRestoredResult = RestoredListenerEvent; - -/** - * @deprecated Use `URLOpenListenerEvent`. - * @since 1.0.0 - */ -export type AppUrlOpen = URLOpenListenerEvent; diff --git a/browser/CHANGELOG.md b/browser/CHANGELOG.md index d40fbee76..d64251274 100644 --- a/browser/CHANGELOG.md +++ b/browser/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/browser@7.0.0-alpha.1...@capacitor/browser@7.0.0-alpha.2) (2024-12-19) + +### Bug Fixes + +- **browser:** crash when trying to open blob urls on android ([#2274](https://github.com/ionic-team/capacitor-plugins/issues/2274)) ([74fe051](https://github.com/ionic-team/capacitor-plugins/commit/74fe051ed9e852293550f201337d427e21c06421)) + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/browser@6.0.2...@capacitor/browser@7.0.0-alpha.1) (2024-12-16) + +### Bug Fixes + +- **browser:** call notifyListeners only when browser is dismissed ([#2186](https://github.com/ionic-team/capacitor-plugins/issues/2186)) ([aaa8658](https://github.com/ionic-team/capacitor-plugins/commit/aaa8658eb65b6c95ae231a3ed1547f3f78cd2cac)) + +## [6.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/browser@6.0.1...@capacitor/browser@6.0.2) (2024-08-08) + +**Note:** Version bump only for package @capacitor/browser + ## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/browser@6.0.0...@capacitor/browser@6.0.1) (2024-06-13) **Note:** Version bump only for package @capacitor/browser diff --git a/browser/CapacitorBrowser.podspec b/browser/CapacitorBrowser.podspec index 0314ab8ca..27b8b74ed 100644 --- a/browser/CapacitorBrowser.podspec +++ b/browser/CapacitorBrowser.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'browser/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/browser/Package.swift b/browser/Package.swift index ee4216df2..0be4ade96 100644 --- a/browser/Package.swift +++ b/browser/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorBrowser", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorBrowser", diff --git a/browser/README.md b/browser/README.md index 0c6a744d1..ac7553a67 100644 --- a/browser/README.md +++ b/browser/README.md @@ -17,7 +17,7 @@ npx cap sync This plugin will use the following project variables (defined in your app's `variables.gradle` file): -- `androidxBrowserVersion`: version of `androidx.browser:browser` (default: `1.7.0`) +- `androidxBrowserVersion`: version of `androidx.browser:browser` (default: `1.8.0`) ## Example diff --git a/browser/android/build.gradle b/browser/android/build.gradle index b68e83a4f..baee8e430 100644 --- a/browser/android/build.gradle +++ b/browser/android/build.gradle @@ -1,10 +1,10 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' - androidxBrowserVersion = project.hasProperty('androidxBrowserVersion') ? rootProject.ext.androidxBrowserVersion : '1.7.0' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' + androidxBrowserVersion = project.hasProperty('androidxBrowserVersion') ? rootProject.ext.androidxBrowserVersion : '1.8.0' } buildscript { @@ -16,7 +16,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -32,10 +32,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.browser" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -50,8 +50,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/browser/android/gradle/wrapper/gradle-wrapper.jar b/browser/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/browser/android/gradle/wrapper/gradle-wrapper.jar and b/browser/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/browser/android/gradle/wrapper/gradle-wrapper.properties b/browser/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/browser/android/gradle/wrapper/gradle-wrapper.properties +++ b/browser/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/browser/android/gradlew b/browser/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/browser/android/gradlew +++ b/browser/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/browser/android/gradlew.bat b/browser/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/browser/android/gradlew.bat +++ b/browser/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/browser/android/src/main/java/com/capacitorjs/plugins/browser/BrowserPlugin.java b/browser/android/src/main/java/com/capacitorjs/plugins/browser/BrowserPlugin.java index 1fbc16852..5cb859402 100644 --- a/browser/android/src/main/java/com/capacitorjs/plugins/browser/BrowserPlugin.java +++ b/browser/android/src/main/java/com/capacitorjs/plugins/browser/BrowserPlugin.java @@ -60,25 +60,25 @@ public void open(PluginCall call) { } // open the browser and finish - try { - Intent intent = new Intent(getContext(), BrowserControllerActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - getContext().startActivity(intent); - Integer finalToolbarColor = toolbarColor; - setBrowserControllerListener( - activity -> { + Intent intent = new Intent(getContext(), BrowserControllerActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + getContext().startActivity(intent); + + Integer finalToolbarColor = toolbarColor; + setBrowserControllerListener( + activity -> { + try { activity.open(implementation, url, finalToolbarColor); browserControllerActivityInstance = activity; call.resolve(); + } catch (ActivityNotFoundException ex) { + Logger.error(getLogTag(), ex.getLocalizedMessage(), null); + call.reject("Unable to display URL"); } - ); - } catch (ActivityNotFoundException ex) { - Logger.error(getLogTag(), ex.getLocalizedMessage(), null); - call.reject("Unable to display URL"); - return; - } + } + ); } @PluginMethod diff --git a/browser/ios/Sources/BrowserPlugin/BrowserPlugin.swift b/browser/ios/Sources/BrowserPlugin/BrowserPlugin.swift index d7db98bb5..0adf90bc3 100644 --- a/browser/ios/Sources/BrowserPlugin/BrowserPlugin.swift +++ b/browser/ios/Sources/BrowserPlugin/BrowserPlugin.swift @@ -29,7 +29,13 @@ public class CAPBrowserPlugin: CAPPlugin, CAPBridgedPlugin { return } implementation.browserEventDidOccur = { [weak self] (event) in - self?.notifyListeners(event.listenerEvent, data: nil) + if event == .finished { + self?.bridge?.dismissVC(animated: true, completion: { + self?.notifyListeners(event.listenerEvent, data: nil) + }) + } else { + self?.notifyListeners(event.listenerEvent, data: nil) + } } // display DispatchQueue.main.async { [weak self] in diff --git a/browser/package.json b/browser/package.json index a3167548f..0aa64631d 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/browser", - "version": "6.0.1", + "version": "7.0.0-alpha.2", "description": "The Browser API provides the ability to open an in-app browser and subscribe to browser events.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorBrowser -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorBrowser -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api BrowserPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorBrowser.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/browser/rollup.config.js b/browser/rollup.config.mjs similarity index 100% rename from browser/rollup.config.js rename to browser/rollup.config.mjs diff --git a/camera/CHANGELOG.md b/camera/CHANGELOG.md index 7ad82b3bb..0e97e8e55 100644 --- a/camera/CHANGELOG.md +++ b/camera/CHANGELOG.md @@ -3,6 +3,24 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/camera@7.0.0-alpha.1...@capacitor/camera@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/camera + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/camera@6.0.2...@capacitor/camera@7.0.0-alpha.1) (2024-12-16) + +### Bug Fixes + +- **camera:** Android dialog not fully showing when in landscape ([#2276](https://github.com/ionic-team/capacitor-plugins/issues/2276)) ([123193b](https://github.com/ionic-team/capacitor-plugins/commit/123193b9cf19784c69e1fd382516a319779e36a5)) + +### Features + +- **camera:** only request permission to save to the gallery for Android <= 9 ([#2222](https://github.com/ionic-team/capacitor-plugins/issues/2222)) ([30da38e](https://github.com/ionic-team/capacitor-plugins/commit/30da38ee9a92da1c5bbeb301fa6371a43365dfeb)) + +## [6.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/camera@6.0.1...@capacitor/camera@6.0.2) (2024-08-08) + +**Note:** Version bump only for package @capacitor/camera + ## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/camera@6.0.0...@capacitor/camera@6.0.1) (2024-06-13) ### Bug Fixes diff --git a/camera/CapacitorCamera.podspec b/camera/CapacitorCamera.podspec index 146063873..1bcb12d48 100644 --- a/camera/CapacitorCamera.podspec +++ b/camera/CapacitorCamera.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'camera/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/camera/Package.swift b/camera/Package.swift index 56884ea39..46f7478aa 100644 --- a/camera/Package.swift +++ b/camera/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorCamera", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorCamera", diff --git a/camera/README.md b/camera/README.md index 49a48d096..9ad234eee 100644 --- a/camera/README.md +++ b/camera/README.md @@ -68,8 +68,8 @@ Additionally, because the Camera API launches a separate Activity to handle taki This plugin will use the following project variables (defined in your app's `variables.gradle` file): -- `androidxExifInterfaceVersion`: version of `androidx.exifinterface:exifinterface` (default: `1.3.6`) -- `androidxMaterialVersion`: version of `com.google.android.material:material` (default: `1.10.0`) +- `androidxExifInterfaceVersion`: version of `androidx.exifinterface:exifinterface` (default: `1.3.7`) +- `androidxMaterialVersion`: version of `com.google.android.material:material` (default: `1.12.0`) ## PWA Notes diff --git a/camera/android/build.gradle b/camera/android/build.gradle index 40590d304..3b2b8665f 100644 --- a/camera/android/build.gradle +++ b/camera/android/build.gradle @@ -1,11 +1,11 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' - androidxExifInterfaceVersion = project.hasProperty('androidxExifInterfaceVersion') ? rootProject.ext.androidxExifInterfaceVersion : '1.3.6' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxMaterialVersion = project.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.10.0' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' + androidxExifInterfaceVersion = project.hasProperty('androidxExifInterfaceVersion') ? rootProject.ext.androidxExifInterfaceVersion : '1.3.7' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxMaterialVersion = project.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.12.0' } buildscript { @@ -17,7 +17,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -33,10 +33,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.camera" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -51,8 +51,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/camera/android/gradle/wrapper/gradle-wrapper.jar b/camera/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/camera/android/gradle/wrapper/gradle-wrapper.jar and b/camera/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/camera/android/gradle/wrapper/gradle-wrapper.properties b/camera/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/camera/android/gradle/wrapper/gradle-wrapper.properties +++ b/camera/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/camera/android/gradlew b/camera/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/camera/android/gradlew +++ b/camera/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/camera/android/gradlew.bat b/camera/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/camera/android/gradlew.bat +++ b/camera/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraBottomSheetDialogFragment.java b/camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraBottomSheetDialogFragment.java index 254f1360e..1f6f79c7c 100644 --- a/camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraBottomSheetDialogFragment.java +++ b/camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraBottomSheetDialogFragment.java @@ -113,10 +113,12 @@ public void setupDialog(Dialog dialog, int style) { dialog.setContentView(parentLayout.getRootView()); CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) parentLayout.getParent()).getLayoutParams(); - CoordinatorLayout.Behavior behavior = params.getBehavior(); + CoordinatorLayout.Behavior behavior = params.getBehavior(); - if (behavior != null && behavior instanceof BottomSheetBehavior) { - ((BottomSheetBehavior) behavior).addBottomSheetCallback(mBottomSheetBehaviorCallback); + if (behavior instanceof BottomSheetBehavior) { + BottomSheetBehavior bottomSheetBehavior = (BottomSheetBehavior) behavior; + bottomSheetBehavior.addBottomSheetCallback(mBottomSheetBehaviorCallback); + bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); } } } diff --git a/camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraPlugin.java b/camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraPlugin.java index 2dce20da1..d2a52ac46 100644 --- a/camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraPlugin.java +++ b/camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraPlugin.java @@ -204,6 +204,17 @@ private boolean checkCameraPermissions(PluginCall call) { boolean hasGalleryPerms = getPermissionState(SAVE_GALLERY) == PermissionState.GRANTED; // If we want to save to the gallery, we need two permissions + // actually we only need permissions to save to gallery for Android <= 9 (API 28) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + // we might still need to request permission for the camera + if (!hasCameraPerms) { + requestPermissionForAlias(CAMERA, call, "cameraPermissionsCallback"); + return false; + } + return true; + } + + // we need to request permissions to save to gallery for Android <= 9 if (settings.isSaveToGallery() && !(hasCameraPerms && hasGalleryPerms) && isFirstRequest) { isFirstRequest = false; String[] aliases; diff --git a/camera/package.json b/camera/package.json index 7909243ed..d550f1598 100644 --- a/camera/package.json +++ b/camera/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/camera", - "version": "6.0.1", + "version": "7.0.0-alpha.2", "description": "The Camera API provides the ability to take a photo with the camera or choose an existing one from the photo album.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorCamera -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorCamera -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api CameraPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorCamera.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/camera/rollup.config.js b/camera/rollup.config.mjs similarity index 100% rename from camera/rollup.config.js rename to camera/rollup.config.mjs diff --git a/clipboard/CHANGELOG.md b/clipboard/CHANGELOG.md index a37169d89..56ce06519 100644 --- a/clipboard/CHANGELOG.md +++ b/clipboard/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/clipboard@7.0.0-alpha.1...@capacitor/clipboard@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/clipboard + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/clipboard@6.0.1...@capacitor/clipboard@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/clipboard + +## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/clipboard@6.0.0...@capacitor/clipboard@6.0.1) (2024-08-08) + +**Note:** Version bump only for package @capacitor/clipboard + # [6.0.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/clipboard@6.0.0-rc.1...@capacitor/clipboard@6.0.0) (2024-04-15) **Note:** Version bump only for package @capacitor/clipboard diff --git a/clipboard/CapacitorClipboard.podspec b/clipboard/CapacitorClipboard.podspec index e1d80b6ce..26e48485e 100644 --- a/clipboard/CapacitorClipboard.podspec +++ b/clipboard/CapacitorClipboard.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'clipboard/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/clipboard/Package.swift b/clipboard/Package.swift index a42d393d8..d157759b4 100644 --- a/clipboard/Package.swift +++ b/clipboard/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorClipboard", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorClipboard", diff --git a/clipboard/android/build.gradle b/clipboard/android/build.gradle index e12f97d5d..2fbdf02c2 100644 --- a/clipboard/android/build.gradle +++ b/clipboard/android/build.gradle @@ -1,9 +1,9 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -15,7 +15,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.clipboard" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -49,8 +49,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/clipboard/android/gradle/wrapper/gradle-wrapper.jar b/clipboard/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/clipboard/android/gradle/wrapper/gradle-wrapper.jar and b/clipboard/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/clipboard/android/gradle/wrapper/gradle-wrapper.properties b/clipboard/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/clipboard/android/gradle/wrapper/gradle-wrapper.properties +++ b/clipboard/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/clipboard/android/gradlew b/clipboard/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/clipboard/android/gradlew +++ b/clipboard/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/clipboard/android/gradlew.bat b/clipboard/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/clipboard/android/gradlew.bat +++ b/clipboard/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/clipboard/package.json b/clipboard/package.json index 0a6f71073..764846f51 100644 --- a/clipboard/package.json +++ b/clipboard/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/clipboard", - "version": "6.0.0", + "version": "7.0.0-alpha.2", "description": "The Clipboard API enables copy and pasting to/from the system clipboard.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorClipboard -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorClipboard -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api ClipboardPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorClipboard.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/clipboard/rollup.config.js b/clipboard/rollup.config.mjs similarity index 100% rename from clipboard/rollup.config.js rename to clipboard/rollup.config.mjs diff --git a/device/CHANGELOG.md b/device/CHANGELOG.md index 87177c056..03fcffe34 100644 --- a/device/CHANGELOG.md +++ b/device/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/device@7.0.0-alpha.1...@capacitor/device@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/device + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/device@6.0.1...@capacitor/device@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/device + +## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/device@6.0.0...@capacitor/device@6.0.1) (2024-08-08) + +**Note:** Version bump only for package @capacitor/device + # [6.0.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/device@6.0.0-rc.1...@capacitor/device@6.0.0) (2024-04-15) **Note:** Version bump only for package @capacitor/device diff --git a/device/CapacitorDevice.podspec b/device/CapacitorDevice.podspec index 2ddf5544b..6ca2e4722 100644 --- a/device/CapacitorDevice.podspec +++ b/device/CapacitorDevice.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'device/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/device/Package.swift b/device/Package.swift index 2f7e6aa6d..803121bdd 100644 --- a/device/Package.swift +++ b/device/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorDevice", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorDevice", diff --git a/device/README.md b/device/README.md index 56c7d3947..39b6c154f 100644 --- a/device/README.md +++ b/device/README.md @@ -9,39 +9,6 @@ npm install @capacitor/device npx cap sync ``` -## Apple Privacy Manifest Requirements - -Apple mandates that app developers now specify approved reasons for API usage to enhance user privacy. By May 1st, 2024, it's required to include these reasons when submitting apps to the App Store Connect. - -When using this specific plugin in your app, you must create a `PrivacyInfo.xcprivacy` file in `/ios/App` or use the VS Code Extension to generate it, specifying the usage reasons. - -For detailed steps on how to do this, please see the [Capacitor Docs](https://capacitorjs.com/docs/ios/privacy-manifest). - -**For this plugin, the required dictionary key is [NSPrivacyAccessedAPICategoryDiskSpace](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api#4278397) and the recommended reason is [85F4.1](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api#4278397).** - -### Example PrivacyInfo.xcprivacy - -```xml - - - - - NSPrivacyAccessedAPITypes - - - - NSPrivacyAccessedAPIType - NSPrivacyAccessedAPICategoryDiskSpace - NSPrivacyAccessedAPITypeReasons - - 85F4.1 - - - - - -``` - ## Example Plugin Usage ```typescript @@ -176,10 +143,6 @@ Get the device's current language locale tag. | **`manufacturer`** | string | The manufacturer of the device. | 1.0.0 | | **`isVirtual`** | boolean | Whether the app is running in a simulator/emulator. | 1.0.0 | | **`memUsed`** | number | Approximate memory used by the current app, in bytes. Divide by 1048576 to get the number of MBs used. | 1.0.0 | -| **`diskFree`** | number | How much free disk space is available on the normal data storage path for the os, in bytes. On Android it returns the free disk space on the "system" partition holding the core Android OS. On iOS this value is not accurate. | 1.0.0 | -| **`diskTotal`** | number | The total size of the normal data storage path for the OS, in bytes. On Android it returns the disk space on the "system" partition holding the core Android OS. | 1.0.0 | -| **`realDiskFree`** | number | How much free disk space is available on the normal data storage, in bytes. | 1.1.0 | -| **`realDiskTotal`** | number | The total size of the normal data storage path, in bytes. | 1.1.0 | | **`webViewVersion`** | string | The web view browser version | 1.0.0 | diff --git a/device/android/build.gradle b/device/android/build.gradle index 5f816fcc5..c048bab0f 100644 --- a/device/android/build.gradle +++ b/device/android/build.gradle @@ -1,9 +1,9 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -15,7 +15,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.device" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -49,8 +49,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/device/android/gradle/wrapper/gradle-wrapper.jar b/device/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/device/android/gradle/wrapper/gradle-wrapper.jar and b/device/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/device/android/gradle/wrapper/gradle-wrapper.properties b/device/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/device/android/gradle/wrapper/gradle-wrapper.properties +++ b/device/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/device/android/gradlew b/device/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/device/android/gradlew +++ b/device/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/device/android/gradlew.bat b/device/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/device/android/gradlew.bat +++ b/device/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/device/android/src/main/java/com/capacitorjs/plugins/device/Device.java b/device/android/src/main/java/com/capacitorjs/plugins/device/Device.java index 477268c10..40d997550 100644 --- a/device/android/src/main/java/com/capacitorjs/plugins/device/Device.java +++ b/device/android/src/main/java/com/capacitorjs/plugins/device/Device.java @@ -7,8 +7,6 @@ import android.content.pm.PackageManager; import android.os.BatteryManager; import android.os.Build; -import android.os.Environment; -import android.os.StatFs; import android.provider.Settings; import android.webkit.WebView; @@ -26,26 +24,6 @@ public long getMemUsed() { return usedMem; } - public long getDiskFree() { - StatFs statFs = new StatFs(Environment.getRootDirectory().getAbsolutePath()); - return statFs.getAvailableBlocksLong() * statFs.getBlockSizeLong(); - } - - public long getDiskTotal() { - StatFs statFs = new StatFs(Environment.getRootDirectory().getAbsolutePath()); - return statFs.getBlockCountLong() * statFs.getBlockSizeLong(); - } - - public long getRealDiskFree() { - StatFs statFs = new StatFs(Environment.getDataDirectory().getAbsolutePath()); - return statFs.getAvailableBlocksLong() * statFs.getBlockSizeLong(); - } - - public long getRealDiskTotal() { - StatFs statFs = new StatFs(Environment.getDataDirectory().getAbsolutePath()); - return statFs.getBlockCountLong() * statFs.getBlockSizeLong(); - } - public String getPlatform() { return "android"; } diff --git a/device/android/src/main/java/com/capacitorjs/plugins/device/DevicePlugin.java b/device/android/src/main/java/com/capacitorjs/plugins/device/DevicePlugin.java index 9fed0725d..13f621353 100644 --- a/device/android/src/main/java/com/capacitorjs/plugins/device/DevicePlugin.java +++ b/device/android/src/main/java/com/capacitorjs/plugins/device/DevicePlugin.java @@ -32,10 +32,6 @@ public void getInfo(PluginCall call) { JSObject r = new JSObject(); r.put("memUsed", implementation.getMemUsed()); - r.put("diskFree", implementation.getDiskFree()); - r.put("diskTotal", implementation.getDiskTotal()); - r.put("realDiskFree", implementation.getRealDiskFree()); - r.put("realDiskTotal", implementation.getRealDiskTotal()); r.put("model", android.os.Build.MODEL); r.put("operatingSystem", "android"); r.put("osVersion", android.os.Build.VERSION.RELEASE); diff --git a/device/ios/Sources/DevicePlugin/Device.swift b/device/ios/Sources/DevicePlugin/Device.swift index cf2a0e832..22c194609 100644 --- a/device/ios/Sources/DevicePlugin/Device.swift +++ b/device/ios/Sources/DevicePlugin/Device.swift @@ -21,48 +21,6 @@ import UIKit } } - /** - * Get free disk space - */ - public func getFreeDiskSize() -> Int64? { - let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) - if let dictionary = try? FileManager.default.attributesOfFileSystem(forPath: paths.last!) { - if let freeSize = dictionary[FileAttributeKey.systemFreeSize] as? NSNumber { - return freeSize.int64Value - } - } - return nil - } - - /** - * Get real free disk space - */ - public func getRealFreeDiskSize() -> Int64? { - do { - let values = try URL(fileURLWithPath: NSHomeDirectory() as String).resourceValues(forKeys: [URLResourceKey.volumeAvailableCapacityForImportantUsageKey]) - if let available = values.volumeAvailableCapacityForImportantUsage { - return available - } else { - return nil - } - } catch { - return nil - } - } - - /** - * Get total disk size - */ - public func getTotalDiskSize() -> Int64? { - let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) - if let dictionary = try? FileManager.default.attributesOfFileSystem(forPath: paths.last!) { - if let freeSize = dictionary[FileAttributeKey.systemSize] as? NSNumber { - return freeSize.int64Value - } - } - return nil - } - public func getLanguageCode() -> String { return String(Locale.preferredLanguages[0].prefix(2)) } diff --git a/device/ios/Sources/DevicePlugin/DevicePlugin.swift b/device/ios/Sources/DevicePlugin/DevicePlugin.swift index 7b18c82ef..b340a7468 100644 --- a/device/ios/Sources/DevicePlugin/DevicePlugin.swift +++ b/device/ios/Sources/DevicePlugin/DevicePlugin.swift @@ -34,17 +34,10 @@ public class DevicePlugin: CAPPlugin, CAPBridgedPlugin { #endif let memUsed = implementation.getMemoryUsage() - let diskFree = implementation.getFreeDiskSize() ?? 0 - let realDiskFree = implementation.getRealFreeDiskSize() ?? 0 - let diskTotal = implementation.getTotalDiskSize() ?? 0 let systemVersionNum = implementation.getSystemVersionInt() ?? 0 call.resolve([ "memUsed": memUsed, - "diskFree": diskFree, - "diskTotal": diskTotal, - "realDiskFree": realDiskFree, - "realDiskTotal": diskTotal, "name": UIDevice.current.name, "model": modelName, "operatingSystem": "ios", diff --git a/device/package.json b/device/package.json index 2c26fa32c..afd741184 100644 --- a/device/package.json +++ b/device/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/device", - "version": "6.0.0", + "version": "7.0.0-alpha.2", "description": "The Device API exposes internal information about the device, such as the model and operating system version, along with user information such as unique ids.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -32,7 +32,7 @@ "scripts": { "test": "uvu -r esm -r ts-node/register src/__tests__", "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorDevice -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorDevice -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build && npm test", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -41,17 +41,17 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api DevicePlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorDevice.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", @@ -59,15 +59,15 @@ "esm": "^3.2.25", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "ts-node": "^9.1.1", "typescript": "~4.1.5", "uvu": "^0.5.1" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/device/rollup.config.js b/device/rollup.config.mjs similarity index 100% rename from device/rollup.config.js rename to device/rollup.config.mjs diff --git a/device/src/__tests__/useragent.spec.ts b/device/src/__tests__/useragent.spec.ts index 35fa58c59..69df133b1 100644 --- a/device/src/__tests__/useragent.spec.ts +++ b/device/src/__tests__/useragent.spec.ts @@ -1,11 +1,9 @@ -import type { WebPluginConfig } from '@capacitor/core'; import { test } from 'uvu'; import * as assert from 'uvu/assert'; import { DeviceWeb } from '../web'; -const config: WebPluginConfig = { name: 'DevicePlugin' }; -const web = new DeviceWeb(config); +const web = new DeviceWeb(); test('Chrome', () => { // Mock empty navigator/window objects diff --git a/device/src/definitions.ts b/device/src/definitions.ts index fd64be9a2..20f4ed006 100644 --- a/device/src/definitions.ts +++ b/device/src/definitions.ts @@ -99,44 +99,6 @@ export interface DeviceInfo { */ memUsed?: number; - /** - * How much free disk space is available on the normal data storage - * path for the os, in bytes. - * - * On Android it returns the free disk space on the "system" - * partition holding the core Android OS. - * On iOS this value is not accurate. - * - * @deprecated Use `realDiskFree`. - * @since 1.0.0 - */ - diskFree?: number; - - /** - * The total size of the normal data storage path for the OS, in bytes. - * - * On Android it returns the disk space on the "system" - * partition holding the core Android OS. - * - * @deprecated Use `realDiskTotal`. - * @since 1.0.0 - */ - diskTotal?: number; - - /** - * How much free disk space is available on the normal data storage, in bytes. - * - * @since 1.1.0 - */ - realDiskFree?: number; - - /** - * The total size of the normal data storage path, in bytes. - * - * @since 1.1.0 - */ - realDiskTotal?: number; - /** * The web view browser version * @@ -215,15 +177,3 @@ export interface DevicePlugin { */ getLanguageTag(): Promise; } - -/** - * @deprecated Use `BatteryInfo`. - * @since 1.0.0 - */ -export type DeviceBatteryInfo = BatteryInfo; - -/** - * @deprecated Use `GetLanguageCodeResult`. - * @since 1.0.0 - */ -export type DeviceLanguageCodeResult = GetLanguageCodeResult; diff --git a/dialog/CHANGELOG.md b/dialog/CHANGELOG.md index 3ef50bcce..7e329cc1e 100644 --- a/dialog/CHANGELOG.md +++ b/dialog/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/dialog@7.0.0-alpha.1...@capacitor/dialog@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/dialog + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/dialog@6.0.1...@capacitor/dialog@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/dialog + +## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/dialog@6.0.0...@capacitor/dialog@6.0.1) (2024-08-08) + +**Note:** Version bump only for package @capacitor/dialog + # [6.0.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/dialog@6.0.0-rc.1...@capacitor/dialog@6.0.0) (2024-04-15) **Note:** Version bump only for package @capacitor/dialog diff --git a/dialog/CapacitorDialog.podspec b/dialog/CapacitorDialog.podspec index bb541696c..347563c18 100644 --- a/dialog/CapacitorDialog.podspec +++ b/dialog/CapacitorDialog.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'dialog/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/dialog/Package.swift b/dialog/Package.swift index aeeec64c4..a41eed174 100644 --- a/dialog/Package.swift +++ b/dialog/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorDialog", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorDialog", diff --git a/dialog/android/build.gradle b/dialog/android/build.gradle index ef512bdbf..4ba77b25f 100644 --- a/dialog/android/build.gradle +++ b/dialog/android/build.gradle @@ -1,9 +1,9 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -15,7 +15,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.dialog" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -49,8 +49,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/dialog/android/gradle/wrapper/gradle-wrapper.jar b/dialog/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/dialog/android/gradle/wrapper/gradle-wrapper.jar and b/dialog/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/dialog/android/gradle/wrapper/gradle-wrapper.properties b/dialog/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/dialog/android/gradle/wrapper/gradle-wrapper.properties +++ b/dialog/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/dialog/android/gradlew b/dialog/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/dialog/android/gradlew +++ b/dialog/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/dialog/android/gradlew.bat b/dialog/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/dialog/android/gradlew.bat +++ b/dialog/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/dialog/package.json b/dialog/package.json index 725359c64..c0295c48e 100644 --- a/dialog/package.json +++ b/dialog/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/dialog", - "version": "6.0.0", + "version": "7.0.0-alpha.2", "description": "The Dialog API provides methods for triggering native dialog windows for alerts, confirmations, and input prompts", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorDialog -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorDialog -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api DialogPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorDialog.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/dialog/rollup.config.js b/dialog/rollup.config.mjs similarity index 100% rename from dialog/rollup.config.js rename to dialog/rollup.config.mjs diff --git a/filesystem/CHANGELOG.md b/filesystem/CHANGELOG.md index 104b8b2bd..f6fce3abe 100644 --- a/filesystem/CHANGELOG.md +++ b/filesystem/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/filesystem@7.0.0-alpha.1...@capacitor/filesystem@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/filesystem + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/filesystem@6.0.1...@capacitor/filesystem@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/filesystem + +## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/filesystem@6.0.0...@capacitor/filesystem@6.0.1) (2024-08-08) + +**Note:** Version bump only for package @capacitor/filesystem + # [6.0.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/filesystem@6.0.0-rc.1...@capacitor/filesystem@6.0.0) (2024-04-15) **Note:** Version bump only for package @capacitor/filesystem diff --git a/filesystem/CapacitorFilesystem.podspec b/filesystem/CapacitorFilesystem.podspec index 2df667cdb..c2a829104 100644 --- a/filesystem/CapacitorFilesystem.podspec +++ b/filesystem/CapacitorFilesystem.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'filesystem/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/filesystem/Package.swift b/filesystem/Package.swift index cd551de2d..20608534b 100644 --- a/filesystem/Package.swift +++ b/filesystem/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorFilesystem", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorFilesystem", diff --git a/filesystem/android/build.gradle b/filesystem/android/build.gradle index e5d428611..6d5458124 100644 --- a/filesystem/android/build.gradle +++ b/filesystem/android/build.gradle @@ -1,9 +1,9 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -15,7 +15,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.filesystem" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -49,8 +49,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/filesystem/android/gradle/wrapper/gradle-wrapper.jar b/filesystem/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/filesystem/android/gradle/wrapper/gradle-wrapper.jar and b/filesystem/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/filesystem/android/gradle/wrapper/gradle-wrapper.properties b/filesystem/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/filesystem/android/gradle/wrapper/gradle-wrapper.properties +++ b/filesystem/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/filesystem/android/gradlew b/filesystem/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/filesystem/android/gradlew +++ b/filesystem/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/filesystem/android/gradlew.bat b/filesystem/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/filesystem/android/gradlew.bat +++ b/filesystem/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/filesystem/package.json b/filesystem/package.json index e64f92c3b..f6c9faa14 100644 --- a/filesystem/package.json +++ b/filesystem/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/filesystem", - "version": "6.0.0", + "version": "7.0.0-alpha.2", "description": "The Filesystem API provides a NodeJS-like API for working with files on the device.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorFilesystem -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorFilesystem -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api FilesystemPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorFilesystem.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/filesystem/rollup.config.js b/filesystem/rollup.config.mjs similarity index 100% rename from filesystem/rollup.config.js rename to filesystem/rollup.config.mjs diff --git a/geolocation/CHANGELOG.md b/geolocation/CHANGELOG.md index e4f303eae..6e90a0289 100644 --- a/geolocation/CHANGELOG.md +++ b/geolocation/CHANGELOG.md @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/geolocation@7.0.0-alpha.1...@capacitor/geolocation@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/geolocation + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/geolocation@6.0.1...@capacitor/geolocation@7.0.0-alpha.1) (2024-12-16) + +### Features + +- **geolocation:** add `minimumUpdateInterval` parameter for `startWatch` ([#2272](https://github.com/ionic-team/capacitor-plugins/issues/2272)) ([c6ddc53](https://github.com/ionic-team/capacitor-plugins/commit/c6ddc53efb7eb2b3fc04fc9f2dc9660c9db1a464)) + +## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/geolocation@6.0.0...@capacitor/geolocation@6.0.1) (2024-08-08) + +**Note:** Version bump only for package @capacitor/geolocation + # [6.0.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/geolocation@6.0.0-rc.1...@capacitor/geolocation@6.0.0) (2024-04-15) **Note:** Version bump only for package @capacitor/geolocation diff --git a/geolocation/CapacitorGeolocation.podspec b/geolocation/CapacitorGeolocation.podspec index b004b1318..17ecc7b25 100644 --- a/geolocation/CapacitorGeolocation.podspec +++ b/geolocation/CapacitorGeolocation.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'geolocation/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/geolocation/Package.swift b/geolocation/Package.swift index dd7b40ba3..dbd5fc1e7 100644 --- a/geolocation/Package.swift +++ b/geolocation/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorGeolocation", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorGeolocation", diff --git a/geolocation/README.md b/geolocation/README.md index 2c2f86313..106e4a0ea 100644 --- a/geolocation/README.md +++ b/geolocation/README.md @@ -36,7 +36,7 @@ Read about [Setting Permissions](https://capacitorjs.com/docs/android/configurat This plugin will use the following project variables (defined in your app's `variables.gradle` file): -- `playServicesLocationVersion` version of `com.google.android.gms:play-services-location` (default: `21.1.0`) +- `playServicesLocationVersion` version of `com.google.android.gms:play-services-location` (default: `21.3.0`) ## Example @@ -171,11 +171,12 @@ Request location permissions. Will throw if system location services are disabl #### PositionOptions -| Prop | Type | Description | Default | Since | -| ------------------------ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----- | -| **`enableHighAccuracy`** | boolean | High accuracy mode (such as GPS, if available) On Android 12+ devices it will be ignored if users didn't grant ACCESS_FINE_LOCATION permissions (can be checked with location alias). | false | 1.0.0 | -| **`timeout`** | number | The maximum wait time in milliseconds for location updates. In Android, since version 4.0.0 of the plugin, timeout gets ignored for getCurrentPosition. | 10000 | 1.0.0 | -| **`maximumAge`** | number | The maximum age in milliseconds of a possible cached position that is acceptable to return | 0 | 1.0.0 | +| Prop | Type | Description | Default | Since | +| --------------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----- | +| **`enableHighAccuracy`** | boolean | High accuracy mode (such as GPS, if available) On Android 12+ devices it will be ignored if users didn't grant ACCESS_FINE_LOCATION permissions (can be checked with location alias). | false | 1.0.0 | +| **`timeout`** | number | The maximum wait time in milliseconds for location updates. In Android, since version 4.0.0 of the plugin, timeout gets ignored for getCurrentPosition. | 10000 | 1.0.0 | +| **`maximumAge`** | number | The maximum age in milliseconds of a possible cached position that is acceptable to return | 0 | 1.0.0 | +| **`minimumUpdateInterval`** | number | The minumum update interval for location updates. If location updates are available faster than this interval then an update will only occur if the minimum update interval has expired since the last location update. This parameter is only available for Android. It has no effect on iOS or Web platforms. | 5000 | 6.1.0 | #### ClearWatchOptions diff --git a/geolocation/android/build.gradle b/geolocation/android/build.gradle index 684fec186..f07f0102a 100644 --- a/geolocation/android/build.gradle +++ b/geolocation/android/build.gradle @@ -1,10 +1,10 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' - playServicesLocationVersion = project.hasProperty('playServicesLocationVersion') ? rootProject.ext.playServicesLocationVersion : '21.1.0' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' + playServicesLocationVersion = project.hasProperty('playServicesLocationVersion') ? rootProject.ext.playServicesLocationVersion : '21.3.0' } buildscript { @@ -16,7 +16,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -32,10 +32,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.geolocation" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -50,8 +50,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/geolocation/android/gradle/wrapper/gradle-wrapper.jar b/geolocation/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/geolocation/android/gradle/wrapper/gradle-wrapper.jar and b/geolocation/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/geolocation/android/gradle/wrapper/gradle-wrapper.properties b/geolocation/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/geolocation/android/gradle/wrapper/gradle-wrapper.properties +++ b/geolocation/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/geolocation/android/gradlew b/geolocation/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/geolocation/android/gradlew +++ b/geolocation/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/geolocation/android/gradlew.bat b/geolocation/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/geolocation/android/gradlew.bat +++ b/geolocation/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/geolocation/android/src/main/java/com/capacitorjs/plugins/geolocation/Geolocation.java b/geolocation/android/src/main/java/com/capacitorjs/plugins/geolocation/Geolocation.java index 41b8af269..e5263a0a2 100644 --- a/geolocation/android/src/main/java/com/capacitorjs/plugins/geolocation/Geolocation.java +++ b/geolocation/android/src/main/java/com/capacitorjs/plugins/geolocation/Geolocation.java @@ -68,7 +68,12 @@ public void sendLocation(boolean enableHighAccuracy, final LocationResultCallbac } @SuppressWarnings("MissingPermission") - public void requestLocationUpdates(boolean enableHighAccuracy, int timeout, final LocationResultCallback resultCallback) { + public void requestLocationUpdates( + boolean enableHighAccuracy, + int timeout, + int minUpdateInterval, + final LocationResultCallback resultCallback + ) { int resultCode = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context); if (resultCode == ConnectionResult.SUCCESS) { clearLocationUpdates(); @@ -87,7 +92,7 @@ public void requestLocationUpdates(boolean enableHighAccuracy, int timeout, fina LocationRequest locationRequest = new LocationRequest.Builder(10000) .setMaxUpdateDelayMillis(timeout) - .setMinUpdateIntervalMillis(5000) + .setMinUpdateIntervalMillis(minUpdateInterval) .setPriority(priority) .build(); diff --git a/geolocation/android/src/main/java/com/capacitorjs/plugins/geolocation/GeolocationPlugin.java b/geolocation/android/src/main/java/com/capacitorjs/plugins/geolocation/GeolocationPlugin.java index 84514a682..d198c675b 100644 --- a/geolocation/android/src/main/java/com/capacitorjs/plugins/geolocation/GeolocationPlugin.java +++ b/geolocation/android/src/main/java/com/capacitorjs/plugins/geolocation/GeolocationPlugin.java @@ -172,10 +172,12 @@ public void error(String message) { @SuppressWarnings("MissingPermission") private void startWatch(final PluginCall call) { int timeout = call.getInt("timeout", 10000); + int minUpdateInterval = call.getInt("minimumUpdateInterval", 5000); implementation.requestLocationUpdates( isHighAccuracy(call), timeout, + minUpdateInterval, new LocationResultCallback() { @Override public void success(Location location) { diff --git a/geolocation/ios/Sources/GeolocationPlugin/GeolocationPlugin.swift b/geolocation/ios/Sources/GeolocationPlugin/GeolocationPlugin.swift index e25afa011..d43d7add1 100644 --- a/geolocation/ios/Sources/GeolocationPlugin/GeolocationPlugin.swift +++ b/geolocation/ios/Sources/GeolocationPlugin/GeolocationPlugin.swift @@ -38,7 +38,7 @@ public class GeolocationPlugin: CAPPlugin, CLLocationManagerDelegate, CAPBridged self.locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers } - if CLLocationManager.authorizationStatus() == .notDetermined { + if self.locationManager.authorizationStatus == .notDetermined { self.locationManager.requestWhenInUseAuthorization() } else { self.locationManager.requestLocation() @@ -59,7 +59,7 @@ public class GeolocationPlugin: CAPPlugin, CLLocationManagerDelegate, CAPBridged self.locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers } - if CLLocationManager.authorizationStatus() == .notDetermined { + if self.locationManager.authorizationStatus == .notDetermined { self.locationManager.requestWhenInUseAuthorization() } else { self.locationManager.startUpdatingLocation() @@ -121,13 +121,15 @@ public class GeolocationPlugin: CAPPlugin, CLLocationManagerDelegate, CAPBridged } } - public func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { + public func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) { let removalQueue = callQueue.filter { $0.value == .permissions } callQueue = callQueue.filter { $0.value != .permissions } for (id, _) in removalQueue { if let call = bridge?.savedCall(withID: id) { - checkPermissions(call) + DispatchQueue(label: "permissionsQueue").async { + self.checkPermissions(call) + } bridge?.releaseCall(call) } } @@ -161,7 +163,7 @@ public class GeolocationPlugin: CAPPlugin, CLLocationManagerDelegate, CAPBridged var status: String = "" if CLLocationManager.locationServicesEnabled() { - switch CLLocationManager.authorizationStatus() { + switch self.locationManager.authorizationStatus { case .notDetermined: status = "prompt" case .restricted, .denied: @@ -188,7 +190,7 @@ public class GeolocationPlugin: CAPPlugin, CLLocationManagerDelegate, CAPBridged if CLLocationManager.locationServicesEnabled() { // If state is not yet determined, request perms. // Otherwise, report back the state right away - if CLLocationManager.authorizationStatus() == .notDetermined { + if self.locationManager.authorizationStatus == .notDetermined { bridge?.saveCall(call) callQueue[call.callbackId] = .permissions diff --git a/geolocation/package.json b/geolocation/package.json index dca86b923..d22f9ce4e 100644 --- a/geolocation/package.json +++ b/geolocation/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/geolocation", - "version": "6.0.0", + "version": "7.0.0-alpha.2", "description": "The Geolocation API provides simple methods for getting and tracking the current position of the device using GPS, along with altitude, heading, and speed information if available.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorGeolocation -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorGeolocation -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api GeolocationPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorGeolocation.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/geolocation/rollup.config.js b/geolocation/rollup.config.mjs similarity index 100% rename from geolocation/rollup.config.js rename to geolocation/rollup.config.mjs diff --git a/geolocation/src/definitions.ts b/geolocation/src/definitions.ts index 94fd9b61f..9e6239e1d 100644 --- a/geolocation/src/definitions.ts +++ b/geolocation/src/definitions.ts @@ -180,6 +180,19 @@ export interface PositionOptions { * @since 1.0.0 */ maximumAge?: number; + + /** + * The minumum update interval for location updates. + * + * If location updates are available faster than this interval then an update + * will only occur if the minimum update interval has expired since the last location update. + * + * This parameter is only available for Android. It has no effect on iOS or Web platforms. + * + * @default 5000 + * @since 6.1.0 + */ + minimumUpdateInterval?: number; } export type WatchPositionCallback = ( diff --git a/geolocation/src/web.ts b/geolocation/src/web.ts index 6830085de..5288ff9c0 100644 --- a/geolocation/src/web.ts +++ b/geolocation/src/web.ts @@ -44,6 +44,7 @@ export class GeolocationWeb extends WebPlugin implements GeolocationPlugin { enableHighAccuracy: false, timeout: 10000, maximumAge: 0, + minimumUpdateInterval: 5000, ...options, }, ); diff --git a/haptics/CHANGELOG.md b/haptics/CHANGELOG.md index 0851014f7..10a562648 100644 --- a/haptics/CHANGELOG.md +++ b/haptics/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/haptics@7.0.0-alpha.1...@capacitor/haptics@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/haptics + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/haptics@6.0.1...@capacitor/haptics@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/haptics + +## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/haptics@6.0.0...@capacitor/haptics@6.0.1) (2024-08-08) + +**Note:** Version bump only for package @capacitor/haptics + # [6.0.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/haptics@6.0.0-rc.1...@capacitor/haptics@6.0.0) (2024-04-15) **Note:** Version bump only for package @capacitor/haptics diff --git a/haptics/CapacitorHaptics.podspec b/haptics/CapacitorHaptics.podspec index 6adcd650a..53d8548d2 100644 --- a/haptics/CapacitorHaptics.podspec +++ b/haptics/CapacitorHaptics.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'haptics/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/haptics/Package.swift b/haptics/Package.swift index c5b1dc8e4..624e4b3cc 100644 --- a/haptics/Package.swift +++ b/haptics/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorHaptics", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorHaptics", diff --git a/haptics/android/build.gradle b/haptics/android/build.gradle index 343662f7b..9525b75ec 100644 --- a/haptics/android/build.gradle +++ b/haptics/android/build.gradle @@ -1,9 +1,9 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -15,7 +15,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.haptics" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -49,8 +49,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/haptics/android/gradle/wrapper/gradle-wrapper.jar b/haptics/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/haptics/android/gradle/wrapper/gradle-wrapper.jar and b/haptics/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/haptics/android/gradle/wrapper/gradle-wrapper.properties b/haptics/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/haptics/android/gradle/wrapper/gradle-wrapper.properties +++ b/haptics/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/haptics/android/gradlew b/haptics/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/haptics/android/gradlew +++ b/haptics/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/haptics/android/gradlew.bat b/haptics/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/haptics/android/gradlew.bat +++ b/haptics/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/haptics/android/src/main/java/com/capacitorjs/plugins/haptics/Haptics.java b/haptics/android/src/main/java/com/capacitorjs/plugins/haptics/Haptics.java index e9f182e68..392aa4190 100644 --- a/haptics/android/src/main/java/com/capacitorjs/plugins/haptics/Haptics.java +++ b/haptics/android/src/main/java/com/capacitorjs/plugins/haptics/Haptics.java @@ -10,12 +10,10 @@ public class Haptics { - private Context context; private boolean selectionStarted = false; private final Vibrator vibrator; Haptics(Context context) { - this.context = context; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { VibratorManager vibratorManager = (VibratorManager) context.getSystemService(Context.VIBRATOR_MANAGER_SERVICE); this.vibrator = vibratorManager.getDefaultVibrator(); @@ -43,8 +41,8 @@ private void vibratePre26(int duration) { } @SuppressWarnings({ "deprecation" }) - private void vibratePre26(long[] pattern, int repeat) { - vibrator.vibrate(pattern, repeat); + private void vibratePre26(long[] pattern) { + vibrator.vibrate(pattern, -1); } public void selectionStart() { @@ -65,7 +63,7 @@ public void performHaptics(HapticsVibrationType type) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { vibrator.vibrate(VibrationEffect.createWaveform(type.getTimings(), type.getAmplitudes(), -1)); } else { - vibratePre26(type.getOldSDKPattern(), -1); + vibratePre26(type.getOldSDKPattern()); } } } diff --git a/haptics/package.json b/haptics/package.json index 84223f37b..8a364d27f 100644 --- a/haptics/package.json +++ b/haptics/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/haptics", - "version": "6.0.0", + "version": "7.0.0-alpha.2", "description": "The Haptics API provides physical feedback to the user through touch or vibration.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorHaptics -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorHaptics -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api HapticsPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorHaptics.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/haptics/rollup.config.js b/haptics/rollup.config.mjs similarity index 100% rename from haptics/rollup.config.js rename to haptics/rollup.config.mjs diff --git a/haptics/src/definitions.ts b/haptics/src/definitions.ts index 01389a6d6..aa9f61b8f 100644 --- a/haptics/src/definitions.ts +++ b/haptics/src/definitions.ts @@ -124,27 +124,3 @@ export interface VibrateOptions { */ duration: number; } - -/** - * @deprecated Use `ImpactOptions`. - * @since 1.0.0 - */ -export type HapticsImpactOptions = ImpactOptions; - -/** - * @deprecated Use `NotificationOptions`. - * @since 1.0.0 - */ -export type HapticsNotificationOptions = NotificationOptions; - -/** - * @deprecated Use `NotificationType`. - * @since 1.0.0 - */ -export const HapticsNotificationType = NotificationType; - -/** - * @deprecated Use `ImpactStyle`. - * @since 1.0.0 - */ -export const HapticsImpactStyle = ImpactStyle; diff --git a/keyboard/CHANGELOG.md b/keyboard/CHANGELOG.md index 41adc8aa7..1b7c11a7f 100644 --- a/keyboard/CHANGELOG.md +++ b/keyboard/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/keyboard@7.0.0-alpha.1...@capacitor/keyboard@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/keyboard + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/keyboard@6.0.2...@capacitor/keyboard@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/keyboard + +## [6.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/keyboard@6.0.1...@capacitor/keyboard@6.0.2) (2024-08-08) + +**Note:** Version bump only for package @capacitor/keyboard + ## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/keyboard@6.0.0...@capacitor/keyboard@6.0.1) (2024-06-13) ### Bug Fixes diff --git a/keyboard/CapacitorKeyboard.podspec b/keyboard/CapacitorKeyboard.podspec index 5c5fd977b..e942b47e3 100644 --- a/keyboard/CapacitorKeyboard.podspec +++ b/keyboard/CapacitorKeyboard.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'keyboard/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/keyboard/Package.swift b/keyboard/Package.swift index af3495701..3f6e865d3 100644 --- a/keyboard/Package.swift +++ b/keyboard/Package.swift @@ -4,7 +4,7 @@ import PackageDescription let package = Package( name: "CapacitorKeyboard", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorKeyboard", diff --git a/keyboard/android/build.gradle b/keyboard/android/build.gradle index be18b24f6..889d1cb96 100644 --- a/keyboard/android/build.gradle +++ b/keyboard/android/build.gradle @@ -1,9 +1,9 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -15,7 +15,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.keyboard" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -49,8 +49,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/keyboard/android/gradle/wrapper/gradle-wrapper.jar b/keyboard/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/keyboard/android/gradle/wrapper/gradle-wrapper.jar and b/keyboard/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/keyboard/android/gradle/wrapper/gradle-wrapper.properties b/keyboard/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/keyboard/android/gradle/wrapper/gradle-wrapper.properties +++ b/keyboard/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/keyboard/android/gradlew b/keyboard/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/keyboard/android/gradlew +++ b/keyboard/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/keyboard/android/gradlew.bat b/keyboard/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/keyboard/android/gradlew.bat +++ b/keyboard/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/keyboard/package.json b/keyboard/package.json index 6cdf8b4e8..42e6214e6 100644 --- a/keyboard/package.json +++ b/keyboard/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/keyboard", - "version": "6.0.1", + "version": "7.0.0-alpha.2", "description": "The Keyboard API provides keyboard display and visibility control, along with event tracking when the keyboard shows and hides.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorKeyboard -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorKeyboard -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,31 +40,31 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api KeyboardPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorKeyboard.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", + "@capacitor/android": "next", "@capacitor/cli": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/keyboard/rollup.config.js b/keyboard/rollup.config.mjs similarity index 100% rename from keyboard/rollup.config.js rename to keyboard/rollup.config.mjs diff --git a/local-notifications/CHANGELOG.md b/local-notifications/CHANGELOG.md index 23df0f8b1..a1c630cc7 100644 --- a/local-notifications/CHANGELOG.md +++ b/local-notifications/CHANGELOG.md @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@7.0.0-alpha.1...@capacitor/local-notifications@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/local-notifications + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@6.1.0...@capacitor/local-notifications@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/local-notifications + +# [6.1.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@6.0.0...@capacitor/local-notifications@6.1.0) (2024-08-08) + +### Features + +- **local-notifications:** Allowing local notifications to be delivered silently while app is in foreground (iOS only) ([#1921](https://github.com/ionic-team/capacitor-plugins/issues/1921)) ([9421137](https://github.com/ionic-team/capacitor-plugins/commit/94211377433c7d26208aedbcee8bb82f3d0985ae)) + # [6.0.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/local-notifications@6.0.0-rc.1...@capacitor/local-notifications@6.0.0) (2024-04-15) **Note:** Version bump only for package @capacitor/local-notifications diff --git a/local-notifications/CapacitorLocalNotifications.podspec b/local-notifications/CapacitorLocalNotifications.podspec index 53358ffd1..ca4168ca8 100644 --- a/local-notifications/CapacitorLocalNotifications.podspec +++ b/local-notifications/CapacitorLocalNotifications.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'local-notifications/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/local-notifications/Package.swift b/local-notifications/Package.swift index 39b31fa14..b32ad8ab8 100644 --- a/local-notifications/Package.swift +++ b/local-notifications/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorLocalNotifications", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorLocalNotifications", diff --git a/local-notifications/README.md b/local-notifications/README.md index 3ed442a0f..7af4e5076 100644 --- a/local-notifications/README.md +++ b/local-notifications/README.md @@ -10,6 +10,7 @@ npx cap sync ``` ## Android + Android 13 requires a permission check in order to send notifications. You are required to call `checkPermissions()` and `requestPermissions()` accordingly. On Android 12 and older it won't show a prompt and will just return as granted. @@ -24,6 +25,12 @@ Note that even if the permission is present, users can still disable exact notif On Android 14, there is a new permission called `USE_EXACT_ALARM`. Use this permission to use exact alarms without needing to request permission from the user. This should only be used if the use of exact alarms is central to your app's functionality. Read more about the implications of using this permission [here](https://developer.android.com/reference/android/Manifest.permission#USE_EXACT_ALARM). +From Android 15 onwards, users can install an app in the [Private space](https://developer.android.com/about/versions/15/features#private-space). Users can lock their private space at any time, which means that push notifications are not shown until the user unlocks it. + +It is not possible to detect if an app is installed in the private space. Therefore, if your app shows any critical notifications, inform your users to avoid installing the app in the private space. + +For more information about the behavior changes of your app related to the private space, refer to [Android documentation](https://developer.android.com/about/versions/15/behavior-changes-all#private-space-changes). + ## Configuration @@ -469,6 +476,7 @@ The object that describes a local notification. | **`ongoing`** | boolean | If true, the notification can't be swiped away. Calls `setOngoing()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android. | 1.0.0 | | **`autoCancel`** | boolean | If true, the notification is canceled when the user clicks on it. Calls `setAutoCancel()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android. | 1.0.0 | | **`inboxList`** | string[] | Sets a list of strings for display in an inbox style notification. Up to 5 strings are allowed. Only available for Android. | 1.0.0 | +| **`silent`** | boolean | If true, notification will not appear while app is in the foreground. Only available for iOS. | 5.0.0 | #### Schedule diff --git a/local-notifications/android/build.gradle b/local-notifications/android/build.gradle index d0780952c..cc5dfc501 100644 --- a/local-notifications/android/build.gradle +++ b/local-notifications/android/build.gradle @@ -1,9 +1,9 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -15,7 +15,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.localnotifications" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -49,8 +49,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/local-notifications/android/gradle/wrapper/gradle-wrapper.jar b/local-notifications/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/local-notifications/android/gradle/wrapper/gradle-wrapper.jar and b/local-notifications/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/local-notifications/android/gradle/wrapper/gradle-wrapper.properties b/local-notifications/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/local-notifications/android/gradle/wrapper/gradle-wrapper.properties +++ b/local-notifications/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/local-notifications/android/gradlew b/local-notifications/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/local-notifications/android/gradlew +++ b/local-notifications/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/local-notifications/android/gradlew.bat b/local-notifications/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/local-notifications/android/gradlew.bat +++ b/local-notifications/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationManager.java b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationManager.java index a1c896f39..0b826a546 100644 --- a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationManager.java +++ b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationManager.java @@ -382,13 +382,13 @@ private void setExactIfPossible( "Capacitor/LocalNotification", "Exact alarms not allowed in user settings. Notification scheduled with non-exact alarm." ); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && schedule.allowWhileIdle()) { + if (schedule.allowWhileIdle()) { alarmManager.setAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, trigger, pendingIntent); } else { alarmManager.set(AlarmManager.RTC, trigger, pendingIntent); } } else { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && schedule.allowWhileIdle()) { + if (schedule.allowWhileIdle()) { alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, trigger, pendingIntent); } else { alarmManager.setExact(AlarmManager.RTC, trigger, pendingIntent); diff --git a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationsPlugin.java b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationsPlugin.java index 6bdd2c0e6..c9f09e59c 100644 --- a/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationsPlugin.java +++ b/local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationsPlugin.java @@ -123,33 +123,31 @@ public void areEnabled(PluginCall call) { @PluginMethod public void getDeliveredNotifications(PluginCall call) { JSArray notifications = new JSArray(); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications(); + StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications(); - for (StatusBarNotification notif : activeNotifications) { - JSObject jsNotif = new JSObject(); + for (StatusBarNotification notif : activeNotifications) { + JSObject jsNotif = new JSObject(); - jsNotif.put("id", notif.getId()); - jsNotif.put("tag", notif.getTag()); + jsNotif.put("id", notif.getId()); + jsNotif.put("tag", notif.getTag()); - Notification notification = notif.getNotification(); - if (notification != null) { - jsNotif.put("title", notification.extras.getCharSequence(Notification.EXTRA_TITLE)); - jsNotif.put("body", notification.extras.getCharSequence(Notification.EXTRA_TEXT)); - jsNotif.put("group", notification.getGroup()); - jsNotif.put("groupSummary", 0 != (notification.flags & Notification.FLAG_GROUP_SUMMARY)); + Notification notification = notif.getNotification(); + if (notification != null) { + jsNotif.put("title", notification.extras.getCharSequence(Notification.EXTRA_TITLE)); + jsNotif.put("body", notification.extras.getCharSequence(Notification.EXTRA_TEXT)); + jsNotif.put("group", notification.getGroup()); + jsNotif.put("groupSummary", 0 != (notification.flags & Notification.FLAG_GROUP_SUMMARY)); - JSObject extras = new JSObject(); + JSObject extras = new JSObject(); - for (String key : notification.extras.keySet()) { - extras.put(key, notification.extras.getString(key)); - } - - jsNotif.put("data", extras); + for (String key : notification.extras.keySet()) { + extras.put(key, notification.extras.getString(key)); } - notifications.put(jsNotif); + jsNotif.put("data", extras); } + + notifications.put(jsNotif); } JSObject result = new JSObject(); diff --git a/local-notifications/package.json b/local-notifications/package.json index 9673cee82..cc7ca0208 100644 --- a/local-notifications/package.json +++ b/local-notifications/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/local-notifications", - "version": "6.0.0", + "version": "7.0.0-alpha.2", "description": "The Local Notifications API provides a way to schedule device notifications locally (i.e. without a server sending push notifications).", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorLocalNotifications -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorLocalNotifications -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,31 +40,31 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api LocalNotificationsPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorLocalNotifications.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", + "@capacitor/android": "next", "@capacitor/cli": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/local-notifications/rollup.config.js b/local-notifications/rollup.config.mjs similarity index 100% rename from local-notifications/rollup.config.js rename to local-notifications/rollup.config.mjs diff --git a/motion/CHANGELOG.md b/motion/CHANGELOG.md index 53e34912e..95803ee92 100644 --- a/motion/CHANGELOG.md +++ b/motion/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/motion@7.0.0-alpha.1...@capacitor/motion@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/motion + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/motion@6.0.1...@capacitor/motion@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/motion + +## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/motion@6.0.0...@capacitor/motion@6.0.1) (2024-08-08) + +**Note:** Version bump only for package @capacitor/motion + # [6.0.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/motion@6.0.0-rc.1...@capacitor/motion@6.0.0) (2024-04-15) **Note:** Version bump only for package @capacitor/motion diff --git a/motion/package.json b/motion/package.json index fffe63060..69c3b04c0 100644 --- a/motion/package.json +++ b/motion/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/motion", - "version": "6.0.0", + "version": "7.0.0-alpha.2", "description": "The Motion API tracks accelerometer and device orientation (compass heading, etc.)", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -33,27 +33,27 @@ "eslint": "eslint . --ext ts", "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "docgen": "docgen --api MotionPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "eslintConfig": { diff --git a/motion/rollup.config.js b/motion/rollup.config.mjs similarity index 100% rename from motion/rollup.config.js rename to motion/rollup.config.mjs diff --git a/network/CHANGELOG.md b/network/CHANGELOG.md index 8435c900c..3ad22b465 100644 --- a/network/CHANGELOG.md +++ b/network/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/network@7.0.0-alpha.1...@capacitor/network@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/network + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/network@6.0.2...@capacitor/network@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/network + +## [6.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/network@6.0.1...@capacitor/network@6.0.2) (2024-08-08) + +**Note:** Version bump only for package @capacitor/network + ## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/network@6.0.0...@capacitor/network@6.0.1) (2024-06-13) **Note:** Version bump only for package @capacitor/network diff --git a/network/CapacitorNetwork.podspec b/network/CapacitorNetwork.podspec index 1a91f3c89..ab886e812 100644 --- a/network/CapacitorNetwork.podspec +++ b/network/CapacitorNetwork.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'network/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/network/Package.swift b/network/Package.swift index 46fb0d69c..9db27118d 100644 --- a/network/Package.swift +++ b/network/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorNetwork", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorNetwork", diff --git a/network/android/build.gradle b/network/android/build.gradle index 1b9981806..8a6205632 100644 --- a/network/android/build.gradle +++ b/network/android/build.gradle @@ -1,9 +1,9 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -15,7 +15,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.network" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -49,8 +49,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/network/android/gradle/wrapper/gradle-wrapper.jar b/network/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/network/android/gradle/wrapper/gradle-wrapper.jar and b/network/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/network/android/gradle/wrapper/gradle-wrapper.properties b/network/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/network/android/gradle/wrapper/gradle-wrapper.properties +++ b/network/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/network/android/gradlew b/network/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/network/android/gradlew +++ b/network/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/network/android/gradlew.bat b/network/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/network/android/gradlew.bat +++ b/network/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/network/package.json b/network/package.json index 26149a305..54c56ff00 100644 --- a/network/package.json +++ b/network/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/network", - "version": "6.0.1", + "version": "7.0.0-alpha.2", "description": "The Network API provides network and connectivity information.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorNetwork -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorNetwork -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api NetworkPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorNetwork.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/network/rollup.config.js b/network/rollup.config.mjs similarity index 100% rename from network/rollup.config.js rename to network/rollup.config.mjs diff --git a/preferences/CHANGELOG.md b/preferences/CHANGELOG.md index 6ba6ff717..b89f0fee6 100644 --- a/preferences/CHANGELOG.md +++ b/preferences/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/preferences@7.0.0-alpha.1...@capacitor/preferences@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/preferences + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/preferences@6.0.2...@capacitor/preferences@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/preferences + +## [6.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/preferences@6.0.1...@capacitor/preferences@6.0.2) (2024-08-08) + +**Note:** Version bump only for package @capacitor/preferences + ## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/preferences@6.0.0...@capacitor/preferences@6.0.1) (2024-06-13) **Note:** Version bump only for package @capacitor/preferences diff --git a/preferences/CapacitorPreferences.podspec b/preferences/CapacitorPreferences.podspec index c20687265..322b44305 100644 --- a/preferences/CapacitorPreferences.podspec +++ b/preferences/CapacitorPreferences.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'preferences/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/preferences/Package.swift b/preferences/Package.swift index 4448dec82..b4c5853ff 100644 --- a/preferences/Package.swift +++ b/preferences/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorPreferences", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorPreferences", diff --git a/preferences/android/build.gradle b/preferences/android/build.gradle index 90e1f3f37..fcef135e1 100644 --- a/preferences/android/build.gradle +++ b/preferences/android/build.gradle @@ -1,9 +1,9 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -15,7 +15,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.preferences" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -49,8 +49,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/preferences/android/gradle/wrapper/gradle-wrapper.jar b/preferences/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/preferences/android/gradle/wrapper/gradle-wrapper.jar and b/preferences/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/preferences/android/gradle/wrapper/gradle-wrapper.properties b/preferences/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/preferences/android/gradle/wrapper/gradle-wrapper.properties +++ b/preferences/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/preferences/android/gradlew b/preferences/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/preferences/android/gradlew +++ b/preferences/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/preferences/android/gradlew.bat b/preferences/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/preferences/android/gradlew.bat +++ b/preferences/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/preferences/package.json b/preferences/package.json index 7098a03ac..b500a4367 100644 --- a/preferences/package.json +++ b/preferences/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/preferences", - "version": "6.0.1", + "version": "7.0.0-alpha.2", "description": "The Preferences API provides a simple key/value persistent store for lightweight data.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorPreferences -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorPreferences -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api PreferencesPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorPreferences.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/preferences/rollup.config.js b/preferences/rollup.config.mjs similarity index 100% rename from preferences/rollup.config.js rename to preferences/rollup.config.mjs diff --git a/push-notifications/CHANGELOG.md b/push-notifications/CHANGELOG.md index 8d708bba5..db4cb9a47 100644 --- a/push-notifications/CHANGELOG.md +++ b/push-notifications/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/push-notifications@7.0.0-alpha.1...@capacitor/push-notifications@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/push-notifications + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/push-notifications@6.0.2...@capacitor/push-notifications@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/push-notifications + +## [6.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/push-notifications@6.0.1...@capacitor/push-notifications@6.0.2) (2024-08-08) + +**Note:** Version bump only for package @capacitor/push-notifications + ## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/push-notifications@6.0.0...@capacitor/push-notifications@6.0.1) (2024-06-13) **Note:** Version bump only for package @capacitor/push-notifications diff --git a/push-notifications/CapacitorPushNotifications.podspec b/push-notifications/CapacitorPushNotifications.podspec index ad91d61a3..5e2af6e57 100644 --- a/push-notifications/CapacitorPushNotifications.podspec +++ b/push-notifications/CapacitorPushNotifications.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'push-notifications/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/push-notifications/Package.swift b/push-notifications/Package.swift index 6e3738495..4a8f6bdc7 100644 --- a/push-notifications/Package.swift +++ b/push-notifications/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorPushNotifications", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorPushNotifications", diff --git a/push-notifications/README.md b/push-notifications/README.md index 22d5fe7dd..85fca33b1 100644 --- a/push-notifications/README.md +++ b/push-notifications/README.md @@ -31,11 +31,17 @@ The Push Notification API uses [Firebase Cloud Messaging](https://firebase.googl Android 13 requires a permission check in order to receive push notifications. You are required to call `checkPermissions()` and `requestPermissions()` accordingly, when targeting SDK 33. +From Android 15 onwards, users can install an app in the [Private space](https://developer.android.com/about/versions/15/features#private-space). Users can lock their private space at any time, which means that push notifications are not shown until the user unlocks it. + +It is not possible to detect if an app is installed in the private space. Therefore, if your app shows any critical notifications, inform your users to avoid installing the app in the private space. + +For more information about the behavior changes of your app related to the private space, refer to [Android documentation](https://developer.android.com/about/versions/15/behavior-changes-all#private-space-changes). + ### Variables This plugin will use the following project variables (defined in your app's `variables.gradle` file): -- `firebaseMessagingVersion` version of `com.google.firebase:firebase-messaging` (default: `23.3.1`) +- `firebaseMessagingVersion` version of `com.google.firebase:firebase-messaging` (default: `24.1.0`) --- diff --git a/push-notifications/android/build.gradle b/push-notifications/android/build.gradle index 034f3a626..b01276989 100644 --- a/push-notifications/android/build.gradle +++ b/push-notifications/android/build.gradle @@ -1,10 +1,10 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' - firebaseMessagingVersion = project.hasProperty('firebaseMessagingVersion') ? rootProject.ext.firebaseMessagingVersion : '23.3.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' + firebaseMessagingVersion = project.hasProperty('firebaseMessagingVersion') ? rootProject.ext.firebaseMessagingVersion : '24.1.0' } buildscript { @@ -16,7 +16,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -32,10 +32,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.pushnotifications" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -50,8 +50,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/push-notifications/android/gradle/wrapper/gradle-wrapper.jar b/push-notifications/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/push-notifications/android/gradle/wrapper/gradle-wrapper.jar and b/push-notifications/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/push-notifications/android/gradle/wrapper/gradle-wrapper.properties b/push-notifications/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/push-notifications/android/gradle/wrapper/gradle-wrapper.properties +++ b/push-notifications/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/push-notifications/android/gradlew b/push-notifications/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/push-notifications/android/gradlew +++ b/push-notifications/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/push-notifications/android/gradlew.bat b/push-notifications/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/push-notifications/android/gradlew.bat +++ b/push-notifications/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/push-notifications/android/src/main/java/com/capacitorjs/plugins/pushnotifications/PushNotificationsPlugin.java b/push-notifications/android/src/main/java/com/capacitorjs/plugins/pushnotifications/PushNotificationsPlugin.java index 761c3331c..8b6823179 100644 --- a/push-notifications/android/src/main/java/com/capacitorjs/plugins/pushnotifications/PushNotificationsPlugin.java +++ b/push-notifications/android/src/main/java/com/capacitorjs/plugins/pushnotifications/PushNotificationsPlugin.java @@ -126,33 +126,31 @@ public void unregister(PluginCall call) { @PluginMethod public void getDeliveredNotifications(PluginCall call) { JSArray notifications = new JSArray(); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications(); + StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications(); - for (StatusBarNotification notif : activeNotifications) { - JSObject jsNotif = new JSObject(); + for (StatusBarNotification notif : activeNotifications) { + JSObject jsNotif = new JSObject(); - jsNotif.put("id", notif.getId()); - jsNotif.put("tag", notif.getTag()); + jsNotif.put("id", notif.getId()); + jsNotif.put("tag", notif.getTag()); - Notification notification = notif.getNotification(); - if (notification != null) { - jsNotif.put("title", notification.extras.getCharSequence(Notification.EXTRA_TITLE)); - jsNotif.put("body", notification.extras.getCharSequence(Notification.EXTRA_TEXT)); - jsNotif.put("group", notification.getGroup()); - jsNotif.put("groupSummary", 0 != (notification.flags & Notification.FLAG_GROUP_SUMMARY)); + Notification notification = notif.getNotification(); + if (notification != null) { + jsNotif.put("title", notification.extras.getCharSequence(Notification.EXTRA_TITLE)); + jsNotif.put("body", notification.extras.getCharSequence(Notification.EXTRA_TEXT)); + jsNotif.put("group", notification.getGroup()); + jsNotif.put("groupSummary", 0 != (notification.flags & Notification.FLAG_GROUP_SUMMARY)); - JSObject extras = new JSObject(); + JSObject extras = new JSObject(); - for (String key : notification.extras.keySet()) { - extras.put(key, notification.extras.getString(key)); - } - - jsNotif.put("data", extras); + for (String key : notification.extras.keySet()) { + extras.put(key, notification.extras.getString(key)); } - notifications.put(jsNotif); + jsNotif.put("data", extras); } + + notifications.put(jsNotif); } JSObject result = new JSObject(); diff --git a/push-notifications/package.json b/push-notifications/package.json index 2bc6c1575..fb0cb1139 100644 --- a/push-notifications/package.json +++ b/push-notifications/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/push-notifications", - "version": "6.0.1", + "version": "7.0.0-alpha.2", "description": "The Push Notifications API provides access to native push notifications.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorPushNotifications -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorPushNotifications -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,31 +40,31 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api PushNotificationsPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorPushNotifications.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", + "@capacitor/android": "next", "@capacitor/cli": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/push-notifications/rollup.config.js b/push-notifications/rollup.config.mjs similarity index 100% rename from push-notifications/rollup.config.js rename to push-notifications/rollup.config.mjs diff --git a/screen-orientation/CHANGELOG.md b/screen-orientation/CHANGELOG.md index 9a0a97cb4..6a958605e 100644 --- a/screen-orientation/CHANGELOG.md +++ b/screen-orientation/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/screen-orientation@7.0.0-alpha.1...@capacitor/screen-orientation@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/screen-orientation + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/screen-orientation@6.0.2...@capacitor/screen-orientation@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/screen-orientation + +## [6.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/screen-orientation@6.0.1...@capacitor/screen-orientation@6.0.2) (2024-08-08) + +**Note:** Version bump only for package @capacitor/screen-orientation + ## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/screen-orientation@6.0.0...@capacitor/screen-orientation@6.0.1) (2024-06-13) **Note:** Version bump only for package @capacitor/screen-orientation diff --git a/screen-orientation/CapacitorScreenOrientation.podspec b/screen-orientation/CapacitorScreenOrientation.podspec index 4d981cd75..e550e225b 100644 --- a/screen-orientation/CapacitorScreenOrientation.podspec +++ b/screen-orientation/CapacitorScreenOrientation.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'screen-orientation/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/screen-orientation/Package.swift b/screen-orientation/Package.swift index bbceb3088..f063971aa 100644 --- a/screen-orientation/Package.swift +++ b/screen-orientation/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorScreenOrientation", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorScreenOrientation", diff --git a/screen-orientation/android/build.gradle b/screen-orientation/android/build.gradle index 02c183b87..5da5c7248 100644 --- a/screen-orientation/android/build.gradle +++ b/screen-orientation/android/build.gradle @@ -1,9 +1,9 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -15,7 +15,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.screenorientation" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -49,8 +49,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/screen-orientation/android/gradle/wrapper/gradle-wrapper.jar b/screen-orientation/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/screen-orientation/android/gradle/wrapper/gradle-wrapper.jar and b/screen-orientation/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/screen-orientation/android/gradle/wrapper/gradle-wrapper.properties b/screen-orientation/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/screen-orientation/android/gradle/wrapper/gradle-wrapper.properties +++ b/screen-orientation/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/screen-orientation/android/gradlew b/screen-orientation/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/screen-orientation/android/gradlew +++ b/screen-orientation/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/screen-orientation/android/gradlew.bat b/screen-orientation/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/screen-orientation/android/gradlew.bat +++ b/screen-orientation/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/screen-orientation/package.json b/screen-orientation/package.json index a30bb6826..6405f6535 100644 --- a/screen-orientation/package.json +++ b/screen-orientation/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/screen-orientation", - "version": "6.0.1", + "version": "7.0.0-alpha.2", "description": "The Screen Orientation API provides methods to lock and unlock the screen orientation.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorScreenOrientation -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorScreenOrientation -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api ScreenOrientationPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorScreenOrientation.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/screen-orientation/rollup.config.js b/screen-orientation/rollup.config.mjs similarity index 100% rename from screen-orientation/rollup.config.js rename to screen-orientation/rollup.config.mjs diff --git a/screen-reader/CHANGELOG.md b/screen-reader/CHANGELOG.md index 771cff886..bca55e7c4 100644 --- a/screen-reader/CHANGELOG.md +++ b/screen-reader/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/screen-reader@7.0.0-alpha.1...@capacitor/screen-reader@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/screen-reader + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/screen-reader@6.0.2...@capacitor/screen-reader@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/screen-reader + +## [6.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/screen-reader@6.0.1...@capacitor/screen-reader@6.0.2) (2024-08-08) + +**Note:** Version bump only for package @capacitor/screen-reader + ## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/screen-reader@6.0.0...@capacitor/screen-reader@6.0.1) (2024-06-13) **Note:** Version bump only for package @capacitor/screen-reader diff --git a/screen-reader/CapacitorScreenReader.podspec b/screen-reader/CapacitorScreenReader.podspec index f56442cf2..60881c8d7 100644 --- a/screen-reader/CapacitorScreenReader.podspec +++ b/screen-reader/CapacitorScreenReader.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'screen-reader/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/screen-reader/Package.swift b/screen-reader/Package.swift index 99e99f344..5b1b1a421 100644 --- a/screen-reader/Package.swift +++ b/screen-reader/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorScreenReader", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorScreenReader", diff --git a/screen-reader/android/build.gradle b/screen-reader/android/build.gradle index 6357efc12..96affc51b 100644 --- a/screen-reader/android/build.gradle +++ b/screen-reader/android/build.gradle @@ -1,9 +1,9 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -15,7 +15,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.screenreader" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -49,8 +49,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/screen-reader/android/gradle/wrapper/gradle-wrapper.jar b/screen-reader/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/screen-reader/android/gradle/wrapper/gradle-wrapper.jar and b/screen-reader/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/screen-reader/android/gradle/wrapper/gradle-wrapper.properties b/screen-reader/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/screen-reader/android/gradle/wrapper/gradle-wrapper.properties +++ b/screen-reader/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/screen-reader/android/gradlew b/screen-reader/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/screen-reader/android/gradlew +++ b/screen-reader/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/screen-reader/android/gradlew.bat b/screen-reader/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/screen-reader/android/gradlew.bat +++ b/screen-reader/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/screen-reader/package.json b/screen-reader/package.json index 3e751fb43..324d9b98e 100644 --- a/screen-reader/package.json +++ b/screen-reader/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/screen-reader", - "version": "6.0.1", + "version": "7.0.0-alpha.2", "description": "The Screen Reader API provides access to TalkBack/VoiceOver/etc. and provides simple text-to-speech capabilities for visual accessibility.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorScreenReader -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorScreenReader -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api ScreenReaderPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorScreenReader.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/screen-reader/rollup.config.js b/screen-reader/rollup.config.mjs similarity index 100% rename from screen-reader/rollup.config.js rename to screen-reader/rollup.config.mjs diff --git a/share/CHANGELOG.md b/share/CHANGELOG.md index 39753e422..11735d998 100644 --- a/share/CHANGELOG.md +++ b/share/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/share@7.0.0-alpha.1...@capacitor/share@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/share + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/share@6.0.2...@capacitor/share@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/share + +## [6.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/share@6.0.1...@capacitor/share@6.0.2) (2024-08-08) + +**Note:** Version bump only for package @capacitor/share + ## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/share@6.0.0...@capacitor/share@6.0.1) (2024-06-13) **Note:** Version bump only for package @capacitor/share diff --git a/share/CapacitorShare.podspec b/share/CapacitorShare.podspec index 12447deb5..1d8efeb0b 100644 --- a/share/CapacitorShare.podspec +++ b/share/CapacitorShare.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'share/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/share/Package.swift b/share/Package.swift index a682fdf02..067ccdb6d 100644 --- a/share/Package.swift +++ b/share/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorShare", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorShare", diff --git a/share/android/build.gradle b/share/android/build.gradle index ca473b6ea..e62e3875a 100644 --- a/share/android/build.gradle +++ b/share/android/build.gradle @@ -1,10 +1,10 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.12.0' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.15.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -16,7 +16,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -32,10 +32,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.share" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -50,8 +50,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/share/android/gradle/wrapper/gradle-wrapper.jar b/share/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/share/android/gradle/wrapper/gradle-wrapper.jar and b/share/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/share/android/gradle/wrapper/gradle-wrapper.properties b/share/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/share/android/gradle/wrapper/gradle-wrapper.properties +++ b/share/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/share/android/gradlew b/share/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/share/android/gradlew +++ b/share/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/share/android/gradlew.bat b/share/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/share/android/gradlew.bat +++ b/share/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/share/package.json b/share/package.json index 2e35382a9..5026a816f 100644 --- a/share/package.json +++ b/share/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/share", - "version": "6.0.1", + "version": "7.0.0-alpha.2", "description": "The Share API provides methods for sharing content in any sharing-enabled apps the user may have installed.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorShare -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorShare -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api SharePlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorShare.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/share/rollup.config.js b/share/rollup.config.mjs similarity index 100% rename from share/rollup.config.js rename to share/rollup.config.mjs diff --git a/splash-screen/CHANGELOG.md b/splash-screen/CHANGELOG.md index 76a18a4d3..ddabc5b3c 100644 --- a/splash-screen/CHANGELOG.md +++ b/splash-screen/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/splash-screen@7.0.0-alpha.1...@capacitor/splash-screen@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/splash-screen + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/splash-screen@6.0.2...@capacitor/splash-screen@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/splash-screen + +## [6.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/splash-screen@6.0.1...@capacitor/splash-screen@6.0.2) (2024-08-08) + +**Note:** Version bump only for package @capacitor/splash-screen + ## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/splash-screen@6.0.0...@capacitor/splash-screen@6.0.1) (2024-06-13) ### Bug Fixes diff --git a/splash-screen/CapacitorSplashScreen.podspec b/splash-screen/CapacitorSplashScreen.podspec index 0e5fab08b..2982e193b 100644 --- a/splash-screen/CapacitorSplashScreen.podspec +++ b/splash-screen/CapacitorSplashScreen.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'splash-screen/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/splash-screen/Package.swift b/splash-screen/Package.swift index 83b78fb23..4833aa68d 100644 --- a/splash-screen/Package.swift +++ b/splash-screen/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorSplashScreen", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorSplashScreen", diff --git a/splash-screen/android/build.gradle b/splash-screen/android/build.gradle index a0dfda682..d1cc5e393 100644 --- a/splash-screen/android/build.gradle +++ b/splash-screen/android/build.gradle @@ -1,9 +1,9 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' coreSplashScreenVersion = project.hasProperty('coreSplashScreenVersion') ? rootProject.ext.coreSplashScreenVersion : '1.0.1' } @@ -16,7 +16,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -32,10 +32,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.splashscreen" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -50,8 +50,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/splash-screen/android/gradle/wrapper/gradle-wrapper.jar b/splash-screen/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/splash-screen/android/gradle/wrapper/gradle-wrapper.jar and b/splash-screen/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/splash-screen/android/gradle/wrapper/gradle-wrapper.properties b/splash-screen/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/splash-screen/android/gradle/wrapper/gradle-wrapper.properties +++ b/splash-screen/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/splash-screen/android/gradlew b/splash-screen/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/splash-screen/android/gradlew +++ b/splash-screen/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/splash-screen/android/gradlew.bat b/splash-screen/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/splash-screen/android/gradlew.bat +++ b/splash-screen/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/splash-screen/package.json b/splash-screen/package.json index fe6f887f8..e7fc4a329 100644 --- a/splash-screen/package.json +++ b/splash-screen/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/splash-screen", - "version": "6.0.1", + "version": "7.0.0-alpha.2", "description": "The Splash Screen API provides methods for showing or hiding a Splash image.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorSplashScreen -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorSplashScreen -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,31 +40,31 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api SplashScreenPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorSplashScreen.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", + "@capacitor/android": "next", "@capacitor/cli": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.2", - "rollup": "^2.32.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/splash-screen/rollup.config.js b/splash-screen/rollup.config.mjs similarity index 100% rename from splash-screen/rollup.config.js rename to splash-screen/rollup.config.mjs diff --git a/splash-screen/src/definitions.ts b/splash-screen/src/definitions.ts index 2b0ab5ad6..4cb6f2380 100644 --- a/splash-screen/src/definitions.ts +++ b/splash-screen/src/definitions.ts @@ -235,15 +235,3 @@ export interface SplashScreenPlugin { */ hide(options?: HideOptions): Promise; } - -/** - * @deprecated Use `ShowOptions`. - * @since 1.0.0 - */ -export type SplashScreenShowOptions = ShowOptions; - -/** - * @deprecated Use `HideOptions`. - * @since 1.0.0 - */ -export type SplashScreenHideOptions = HideOptions; diff --git a/status-bar/CHANGELOG.md b/status-bar/CHANGELOG.md index 3c25594a7..cbabbcc29 100644 --- a/status-bar/CHANGELOG.md +++ b/status-bar/CHANGELOG.md @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/status-bar@7.0.0-alpha.1...@capacitor/status-bar@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/status-bar + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/status-bar@6.0.1...@capacitor/status-bar@7.0.0-alpha.1) (2024-12-16) + +### Bug Fixes + +- **statusbar:** fix info when notify listeners ([#2247](https://github.com/ionic-team/capacitor-plugins/issues/2247)) ([af2317f](https://github.com/ionic-team/capacitor-plugins/commit/af2317f75f72d80308fac83ae65b7196cca98371)) + +## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/status-bar@6.0.0...@capacitor/status-bar@6.0.1) (2024-08-08) + +**Note:** Version bump only for package @capacitor/status-bar + # [6.0.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/status-bar@6.0.0-rc.1...@capacitor/status-bar@6.0.0) (2024-04-15) **Note:** Version bump only for package @capacitor/status-bar diff --git a/status-bar/CapacitorStatusBar.podspec b/status-bar/CapacitorStatusBar.podspec index bb7bdd57f..7db148e5f 100644 --- a/status-bar/CapacitorStatusBar.podspec +++ b/status-bar/CapacitorStatusBar.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'status-bar/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/status-bar/Package.swift b/status-bar/Package.swift index 8b2ee4841..bac45dc99 100644 --- a/status-bar/Package.swift +++ b/status-bar/Package.swift @@ -4,7 +4,7 @@ import PackageDescription let package = Package( name: "CapacitorStatusBar", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorStatusBar", diff --git a/status-bar/README.md b/status-bar/README.md index 555c1239e..93dfc5a37 100644 --- a/status-bar/README.md +++ b/status-bar/README.md @@ -20,9 +20,6 @@ The status bar visibility defaults to visible and the style defaults to `Style.Default`. You can change these defaults by adding `UIStatusBarHidden` and/or `UIStatusBarStyle` in `Info.plist`. -`setBackgroundColor` and `setOverlaysWebView` are currently not supported on -iOS devices. - ## Example ```typescript @@ -33,7 +30,7 @@ window.addEventListener('statusTap', function () { console.log('statusbar tapped'); }); -// Display content under transparent status bar (Android only) +// Display content under transparent status bar StatusBar.setOverlaysWebView({ overlay: true }); const setStatusBarStyleDark = async () => { @@ -53,6 +50,57 @@ const showStatusBar = async () => { }; ``` +## Configuration + + + + +These config values are available: + +| Prop | Type | Description | Default | Since | +| --------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----- | +| **`overlaysWebView`** | boolean | Whether the statusbar is overlaid or not. For applications targeting Android 15, this property has no effect unless the property windowOptOutEdgeToEdgeEnforcement is added to the application layout file. Otherwise, the application assumes always overlays as true. More details in https://developer.android.com/reference/android/R.attr#windowOptOutEdgeToEdgeEnforcement | true | 1.0.0 | +| **`style`** | string | Style of the text of the status bar. | default | 1.0.0 | +| **`backgroundColor`** | string | Color of the background of the statusbar in hex format, #RRGGBB. Doesn't work if `overlaysWebView` is true. | #000000 | 1.0.0 | + +### Examples + +In `capacitor.config.json`: + +```json +{ + "plugins": { + "StatusBar": { + "overlaysWebView": false, + "style": "DARK", + "backgroundColor": "#ffffffff" + } + } +} +``` + +In `capacitor.config.ts`: + +```ts +/// + +import { CapacitorConfig } from '@capacitor/cli'; + +const config: CapacitorConfig = { + plugins: { + StatusBar: { + overlaysWebView: false, + style: "DARK", + backgroundColor: "#ffffffff", + }, + }, +}; + +export default config; +``` + + + ## API @@ -96,8 +144,6 @@ setBackgroundColor(options: BackgroundColorOptions) => Promise Set the background color of the status bar. -This method is only supported on Android. - | Param | Type | | ------------- | ------------------------------------------------------------------------- | | **`options`** | BackgroundColorOptions | @@ -169,8 +215,6 @@ setOverlaysWebView(options: SetOverlaysWebViewOptions) => Promise Set whether or not the status bar should overlay the webview to allow usage of the space underneath it. -This method is only supported on Android. - | Param | Type | | ------------- | ------------------------------------------------------------------------------- | | **`options`** | SetOverlaysWebViewOptions | @@ -192,9 +236,9 @@ This method is only supported on Android. #### BackgroundColorOptions -| Prop | Type | Description | Since | -| ----------- | ------------------- | ------------------------------------------------------------------------------------------- | ----- | -| **`color`** | string | A hex color to which the status bar color is set. This option is only supported on Android. | 1.0.0 | +| Prop | Type | Description | Since | +| ----------- | ------------------- | ------------------------------------------------- | ----- | +| **`color`** | string | A hex color to which the status bar color is set. | 1.0.0 | #### AnimationOptions @@ -206,12 +250,12 @@ This method is only supported on Android. #### StatusBarInfo -| Prop | Type | Description | Since | -| -------------- | --------------------------------------- | ----------------------------------------------------------------------------------- | ----- | -| **`visible`** | boolean | Whether the status bar is visible or not. | 1.0.0 | -| **`style`** | Style | The current status bar style. | 1.0.0 | -| **`color`** | string | The current status bar color. This option is only supported on Android. | 1.0.0 | -| **`overlays`** | boolean | Whether the statusbar is overlaid or not. This option is only supported on Android. | 1.0.0 | +| Prop | Type | Description | Since | +| -------------- | --------------------------------------- | ----------------------------------------- | ----- | +| **`visible`** | boolean | Whether the status bar is visible or not. | 1.0.0 | +| **`style`** | Style | The current status bar style. | 1.0.0 | +| **`color`** | string | The current status bar color. | 1.0.0 | +| **`overlays`** | boolean | Whether the statusbar is overlaid or not. | 1.0.0 | #### SetOverlaysWebViewOptions diff --git a/status-bar/android/build.gradle b/status-bar/android/build.gradle index 35489210f..9badef6c4 100644 --- a/status-bar/android/build.gradle +++ b/status-bar/android/build.gradle @@ -1,10 +1,10 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.12.0' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.15.0' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -16,7 +16,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -32,10 +32,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.statusbar" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -50,8 +50,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/status-bar/android/gradle/wrapper/gradle-wrapper.jar b/status-bar/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/status-bar/android/gradle/wrapper/gradle-wrapper.jar and b/status-bar/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/status-bar/android/gradle/wrapper/gradle-wrapper.properties b/status-bar/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/status-bar/android/gradle/wrapper/gradle-wrapper.properties +++ b/status-bar/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/status-bar/android/gradlew b/status-bar/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/status-bar/android/gradlew +++ b/status-bar/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/status-bar/android/gradlew.bat b/status-bar/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/status-bar/android/gradlew.bat +++ b/status-bar/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBar.java b/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBar.java index e8e15e1f0..48efee12b 100644 --- a/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBar.java +++ b/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBar.java @@ -2,8 +2,11 @@ import android.content.res.Configuration; import android.graphics.Color; +import android.os.Build; +import android.util.DisplayMetrics; import android.view.View; import android.view.Window; +import android.view.WindowInsets; import android.view.WindowManager; import androidx.appcompat.app.AppCompatActivity; import androidx.core.view.ViewCompat; @@ -13,15 +16,27 @@ public class StatusBar { + public static final String statusBarVisibilityChanged = "statusBarVisibilityChanged"; + public static final String statusBarOverlayChanged = "statusBarOverlayChanged"; + private int currentStatusBarColor; + private final ChangeListener listener; private final AppCompatActivity activity; private String currentStyle = "DEFAULT"; - public StatusBar(AppCompatActivity activity) { + public StatusBar(AppCompatActivity activity, StatusBarConfig config, ChangeListener listener) { // save initial color of the status bar this.activity = activity; this.currentStatusBarColor = activity.getWindow().getStatusBarColor(); - setStyle(this.currentStyle); + this.listener = listener; + this.defaultStyle = getStyle(); + + setBackgroundColor(config.getBackgroundColor()); + setStyle(config.getStyle()); + setOverlaysWebView(config.isOverlaysWebView()); + StatusBarInfo info = getInfo(); + info.setVisible(true); + listener.onChange(statusBarOverlayChanged, info); } public void setStyle(String style) { @@ -62,12 +77,18 @@ public void hide() { View decorView = activity.getWindow().getDecorView(); WindowInsetsControllerCompat windowInsetsControllerCompat = WindowCompat.getInsetsController(activity.getWindow(), decorView); windowInsetsControllerCompat.hide(WindowInsetsCompat.Type.statusBars()); + StatusBarInfo info = getInfo(); + info.setVisible(false); + listener.onChange(statusBarVisibilityChanged, info); } public void show() { View decorView = activity.getWindow().getDecorView(); WindowInsetsControllerCompat windowInsetsControllerCompat = WindowCompat.getInsetsController(activity.getWindow(), decorView); windowInsetsControllerCompat.show(WindowInsetsCompat.Type.statusBars()); + StatusBarInfo info = getInfo(); + info.setVisible(true); + listener.onChange(statusBarVisibilityChanged, info); } @SuppressWarnings("deprecation") @@ -87,6 +108,7 @@ public void setOverlaysWebView(Boolean overlays) { // recover the previous color of the status bar activity.getWindow().setStatusBarColor(currentStatusBarColor); } + listener.onChange(statusBarOverlayChanged, getInfo()); } @SuppressWarnings("deprecation") @@ -106,6 +128,7 @@ public StatusBarInfo getInfo() { info.setOverlays(getIsOverlaid()); info.setVisible(isVisible); info.setColor(String.format("#%06X", (0xFFFFFF & window.getStatusBarColor()))); + info.setHeight(getStatusBarHeight()); return info; } @@ -118,4 +141,25 @@ private String getStyle() { } return style; } + + private int getStatusBarHeight() { + DisplayMetrics metrics = activity.getResources().getDisplayMetrics(); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + WindowInsets insets = activity.getWindowManager().getCurrentWindowMetrics().getWindowInsets(); + return (int) (insets.getInsets(WindowInsets.Type.statusBars()).top / metrics.density); + } + + WindowInsets insets = activity.getWindow().getDecorView().getRootWindowInsets(); + if (insets != null) { + return (int) (insets.getSystemWindowInsetTop() / metrics.density); + } + + // Fallback if the insets are not available + return 0; + } + + public interface ChangeListener { + void onChange(String eventName, StatusBarInfo info); + } } diff --git a/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBarConfig.java b/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBarConfig.java new file mode 100644 index 000000000..6deed46db --- /dev/null +++ b/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBarConfig.java @@ -0,0 +1,34 @@ +package com.capacitorjs.plugins.statusbar; + +import com.getcapacitor.util.WebColor; + +public class StatusBarConfig { + + private boolean overlaysWebView = true; + private Integer backgroundColor = WebColor.parseColor("#000000"); + private String style = "DEFAULT"; + + public boolean isOverlaysWebView() { + return overlaysWebView; + } + + public void setOverlaysWebView(boolean overlaysWebView) { + this.overlaysWebView = overlaysWebView; + } + + public Integer getBackgroundColor() { + return backgroundColor; + } + + public void setBackgroundColor(Integer backgroundColor) { + this.backgroundColor = backgroundColor; + } + + public String getStyle() { + return style; + } + + public void setStyle(String style) { + this.style = style; + } +} diff --git a/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBarInfo.java b/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBarInfo.java index 0b4fd9467..1ca75cb16 100644 --- a/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBarInfo.java +++ b/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBarInfo.java @@ -1,11 +1,14 @@ package com.capacitorjs.plugins.statusbar; -public class StatusBarInfo { +import java.io.Serializable; + +public class StatusBarInfo implements Serializable { private boolean overlays; private boolean visible; private String style; private String color; + private int height; public boolean isOverlays() { return overlays; @@ -38,4 +41,12 @@ public String getColor() { public void setColor(String color) { this.color = color; } + + public int getHeight() { + return height; + } + + public void setHeight(int height) { + this.height = height; + } } diff --git a/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBarPlugin.java b/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBarPlugin.java index b5d1e835f..0491c0c01 100644 --- a/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBarPlugin.java +++ b/status-bar/android/src/main/java/com/capacitorjs/plugins/statusbar/StatusBarPlugin.java @@ -2,6 +2,7 @@ import android.content.res.Configuration; import com.getcapacitor.JSObject; +import com.getcapacitor.Logger; import com.getcapacitor.Plugin; import com.getcapacitor.PluginCall; import com.getcapacitor.PluginMethod; @@ -16,7 +17,37 @@ public class StatusBarPlugin extends Plugin { @Override public void load() { - implementation = new StatusBar(getActivity()); + StatusBarConfig config = getStatusBarConfig(); + implementation = new StatusBar(getActivity(), config, (eventName, info) -> notifyListeners(eventName, toJSObject(info), true)); + } + + private StatusBarConfig getStatusBarConfig() { + StatusBarConfig config = new StatusBarConfig(); + String backgroundColor = getConfig().getString("backgroundColor"); + if (backgroundColor != null) { + try { + config.setBackgroundColor(WebColor.parseColor(backgroundColor)); + } catch (IllegalArgumentException ex) { + Logger.debug("Background color not applied"); + } + } + config.setStyle(styleFromConfig(getConfig().getString("style", config.getStyle()))); + config.setOverlaysWebView(getConfig().getBoolean("overlaysWebView", config.isOverlaysWebView())); + return config; + } + + private String styleFromConfig(String style) { + switch (style.toLowerCase()) { + case "lightcontent": + case "dark": + return "DARK"; + case "darkcontent": + case "light": + return "LIGHT"; + case "default": + default: + return "DEFAULT"; + } } @Override @@ -91,24 +122,28 @@ public void show(final PluginCall call) { @PluginMethod public void getInfo(final PluginCall call) { StatusBarInfo info = implementation.getInfo(); - - JSObject data = new JSObject(); - data.put("visible", info.isVisible()); - data.put("style", info.getStyle()); - data.put("color", info.getColor()); - data.put("overlays", info.isOverlays()); - call.resolve(data); + call.resolve(toJSObject(info)); } @PluginMethod public void setOverlaysWebView(final PluginCall call) { - final Boolean overlays = call.getBoolean("overlay", true); + final Boolean overlay = call.getBoolean("overlay", true); getBridge() .executeOnMainThread( () -> { - implementation.setOverlaysWebView(overlays); + implementation.setOverlaysWebView(overlay); call.resolve(); } ); } + + private JSObject toJSObject(StatusBarInfo info) { + JSObject data = new JSObject(); + data.put("visible", info.isVisible()); + data.put("style", info.getStyle()); + data.put("color", info.getColor()); + data.put("overlays", info.isOverlays()); + data.put("height", info.getHeight()); + return data; + } } diff --git a/status-bar/ios/Sources/StatusBarPlugin/CAPBridgeViewController.swift b/status-bar/ios/Sources/StatusBarPlugin/CAPBridgeViewController.swift new file mode 100644 index 000000000..02cec24dd --- /dev/null +++ b/status-bar/ios/Sources/StatusBarPlugin/CAPBridgeViewController.swift @@ -0,0 +1,14 @@ +import Capacitor + +extension CAPBridgeViewController { + + override open func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + NotificationCenter.default.post(Notification(name: .capacitorViewDidAppear)) + } + + override open func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { + super.viewWillTransition(to: size, with: coordinator) + NotificationCenter.default.post(Notification(name: .capacitorViewWillTransition)) + } +} diff --git a/status-bar/ios/Sources/StatusBarPlugin/CAPNotifications.swift b/status-bar/ios/Sources/StatusBarPlugin/CAPNotifications.swift new file mode 100644 index 000000000..64a937fe9 --- /dev/null +++ b/status-bar/ios/Sources/StatusBarPlugin/CAPNotifications.swift @@ -0,0 +1,6 @@ +import Capacitor + +extension Notification.Name { + public static let capacitorViewDidAppear = Notification.Name(rawValue: "CapacitorViewDidAppear") + public static let capacitorViewWillTransition = Notification.Name(rawValue: "CapacitorViewWillTransition") +} diff --git a/status-bar/ios/Sources/StatusBarPlugin/StatusBar.swift b/status-bar/ios/Sources/StatusBarPlugin/StatusBar.swift new file mode 100644 index 000000000..0f203f3ad --- /dev/null +++ b/status-bar/ios/Sources/StatusBarPlugin/StatusBar.swift @@ -0,0 +1,166 @@ +import Foundation +import Capacitor + +public class StatusBar { + + private var bridge: CAPBridgeProtocol + private var isOverlayingWebview = true + private var backgroundColor = UIColor.black + private var backgroundView: UIView? + private var observers: [NSObjectProtocol] = [] + + init(bridge: CAPBridgeProtocol, config: StatusBarConfig) { + self.bridge = bridge + setupObservers(with: config) + } + + deinit { + observers.forEach { NotificationCenter.default.removeObserver($0) } + } + + private func setupObservers(with config: StatusBarConfig) { + observers.append(NotificationCenter.default.addObserver(forName: .capacitorViewDidAppear, object: .none, queue: .none) { [weak self] _ in + self?.handleViewDidAppear(config: config) + }) + observers.append(NotificationCenter.default.addObserver(forName: .capacitorStatusBarTapped, object: .none, queue: .none) { [weak self] _ in + self?.bridge.triggerJSEvent(eventName: "statusTap", target: "window") + }) + observers.append(NotificationCenter.default.addObserver(forName: .capacitorViewWillTransition, object: .none, queue: .none) { [weak self] _ in + self?.handleViewWillTransition() + }) + } + + private func handleViewDidAppear(config: StatusBarConfig) { + setStyle(config.style) + setBackgroundColor(config.backgroundColor) + setOverlaysWebView(config.overlaysWebView) + } + + private func handleViewWillTransition() { + DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in + self?.resizeStatusBarBackgroundView() + self?.resizeWebView() + } + } + + func setStyle(_ style: UIStatusBarStyle) { + bridge.statusBarStyle = style + } + + func setBackgroundColor(_ color: UIColor) { + backgroundColor = color + backgroundView?.backgroundColor = color + } + + func setAnimation(_ animation: String) { + if animation == "SLIDE" { + bridge.statusBarAnimation = .slide + } else if animation == "NONE" { + bridge.statusBarAnimation = .none + } else { + bridge.statusBarAnimation = .fade + } + } + + func hide(animation: String) { + setAnimation(animation) + if bridge.statusBarVisible { + bridge.statusBarVisible = false + DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in + self?.resizeWebView() + self?.backgroundView?.removeFromSuperview() + self?.backgroundView?.isHidden = true + } + } + } + + func show(animation: String) { + setAnimation(animation) + if !bridge.statusBarVisible { + bridge.statusBarVisible = true + DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [self] in + resizeWebView() + if !isOverlayingWebview { + resizeStatusBarBackgroundView() + bridge.webView?.superview?.addSubview(backgroundView!) + } + backgroundView?.isHidden = false + } + } + } + + func getInfo() -> StatusBarInfo { + let style: String + switch bridge.statusBarStyle { + case .default: + style = "DEFAULT" + case .lightContent: + style = "DARK" + case .darkContent: + style = "LIGHT" + @unknown default: + style = "DEFAULT" + } + + return StatusBarInfo( + overlays: isOverlayingWebview, + visible: bridge.statusBarVisible, + style: style, + color: UIColor.capacitor.hex(fromColor: backgroundColor), + height: getStatusBarFrame().size.height + ) + } + + func setOverlaysWebView(_ overlay: Bool) { + if overlay == isOverlayingWebview { return } + isOverlayingWebview = overlay + if overlay { + backgroundView?.removeFromSuperview() + } else { + initializeBackgroundViewIfNeeded() + bridge.webView?.superview?.addSubview(backgroundView!) + } + resizeWebView() + } + + private func resizeWebView() { + guard + let webView = bridge.webView, + let bounds = bridge.viewController?.view.window?.windowScene?.screen.bounds + else { return } + bridge.viewController?.view.frame = bounds + webView.frame = bounds + let statusBarHeight = getStatusBarFrame().size.height + var webViewFrame = webView.frame + + if isOverlayingWebview { + let safeAreaTop = webView.safeAreaInsets.top + if statusBarHeight >= safeAreaTop && safeAreaTop > 0 { + webViewFrame.origin.y = safeAreaTop == 40 ? 20 : statusBarHeight - safeAreaTop + } else { + webViewFrame.origin.y = 0 + } + } else { + webViewFrame.origin.y = statusBarHeight + } + webViewFrame.size.height -= webViewFrame.origin.y + webView.frame = webViewFrame + } + + private func resizeStatusBarBackgroundView() { + backgroundView?.frame = getStatusBarFrame() + } + + private func getStatusBarFrame() -> CGRect { + return UIApplication.shared.windows.first(where: { $0.isKeyWindow })?.windowScene?.statusBarManager?.statusBarFrame ?? .zero + } + + private func initializeBackgroundViewIfNeeded() { + if backgroundView == nil { + backgroundView = UIView(frame: getStatusBarFrame()) + backgroundView!.backgroundColor = backgroundColor + backgroundView!.autoresizingMask = [.flexibleWidth, .flexibleBottomMargin] + backgroundView!.isHidden = !bridge.statusBarVisible + } + } +} diff --git a/status-bar/ios/Sources/StatusBarPlugin/StatusBarConfig.swift b/status-bar/ios/Sources/StatusBarPlugin/StatusBarConfig.swift new file mode 100644 index 000000000..7e0bc4c53 --- /dev/null +++ b/status-bar/ios/Sources/StatusBarPlugin/StatusBarConfig.swift @@ -0,0 +1,7 @@ +import UIKit + +public struct StatusBarConfig { + var overlaysWebView = true + var backgroundColor: UIColor = .black + var style: UIStatusBarStyle = .default +} diff --git a/status-bar/ios/Sources/StatusBarPlugin/StatusBarInfo.swift b/status-bar/ios/Sources/StatusBarPlugin/StatusBarInfo.swift new file mode 100644 index 000000000..7e1b8b1a7 --- /dev/null +++ b/status-bar/ios/Sources/StatusBarPlugin/StatusBarInfo.swift @@ -0,0 +1,9 @@ +import Foundation + +public struct StatusBarInfo { + public var overlays: Bool? + public var visible: Bool? + public var style: String? + public var color: String? + public var height: CGFloat? +} diff --git a/status-bar/ios/Sources/StatusBarPlugin/StatusBarPlugin.swift b/status-bar/ios/Sources/StatusBarPlugin/StatusBarPlugin.swift index 6634d064c..1cadf1dd1 100644 --- a/status-bar/ios/Sources/StatusBarPlugin/StatusBarPlugin.swift +++ b/status-bar/ios/Sources/StatusBarPlugin/StatusBarPlugin.swift @@ -17,90 +17,118 @@ public class StatusBarPlugin: CAPPlugin, CAPBridgedPlugin { CAPPluginMethod(name: "getInfo", returnType: CAPPluginReturnPromise), CAPPluginMethod(name: "setOverlaysWebView", returnType: CAPPluginReturnPromise) ] - private var observer: NSObjectProtocol? + private var statusBar: StatusBar? + private let statusBarVisibilityChanged = "statusBarVisibilityChanged" + private let statusBarOverlayChanged = "statusBarOverlayChanged" override public func load() { - observer = NotificationCenter.default.addObserver(forName: Notification.Name.capacitorStatusBarTapped, object: .none, queue: .none) { [weak self] _ in - self?.bridge?.triggerJSEvent(eventName: "statusTap", target: "window") + guard let bridge = bridge else { return } + statusBar = StatusBar(bridge: bridge, config: statusBarConfig()) + } + + private func statusBarConfig() -> StatusBarConfig { + var config = StatusBarConfig() + config.overlaysWebView = getConfig().getBoolean("overlaysWebView", config.overlaysWebView) + if let colorConfig = getConfig().getString("backgroundColor"), let color = UIColor.capacitor.color(fromHex: colorConfig) { + config.backgroundColor = color + } + if let configStyle = getConfig().getString("style") { + config.style = style(fromString: configStyle) } + return config } - deinit { - if let observer = observer { - NotificationCenter.default.removeObserver(observer) + private func style(fromString: String) -> UIStatusBarStyle { + switch fromString.lowercased() { + case "dark", "lightcontent": + return .lightContent + case "light", "darkcontent": + return .darkContent + case "default": + return .default + default: + return .default } } @objc func setStyle(_ call: CAPPluginCall) { let options = call.options! - - if let style = options["style"] as? String { - if style == "DARK" { - bridge?.statusBarStyle = .lightContent - } else if style == "LIGHT" { - bridge?.statusBarStyle = .darkContent - } else if style == "DEFAULT" { - bridge?.statusBarStyle = .default - } + if let styleString = options["style"] as? String { + statusBar?.setStyle(style(fromString: styleString)) } - call.resolve([:]) } @objc func setBackgroundColor(_ call: CAPPluginCall) { - call.unimplemented() - } - - func setAnimation(_ call: CAPPluginCall) { - let animation = call.getString("animation", "FADE") - if animation == "SLIDE" { - bridge?.statusBarAnimation = .slide - } else if animation == "NONE" { - bridge?.statusBarAnimation = .none - } else { - bridge?.statusBarAnimation = .fade + guard + let hexString = call.options["color"] as? String, + let color = UIColor.capacitor.color(fromHex: hexString) + else { return } + DispatchQueue.main.async { [weak self] in + self?.statusBar?.setBackgroundColor(color) } + call.resolve() } @objc func hide(_ call: CAPPluginCall) { - setAnimation(call) - bridge?.statusBarVisible = false + let animation = call.getString("animation", "FADE") + DispatchQueue.main.async { [weak self] in + self?.statusBar?.hide(animation: animation) + guard + let info = self?.statusBar?.getInfo(), + let dict = self?.toDict(info), + let event = self?.statusBarVisibilityChanged + else { return } + self?.notifyListeners(event, data: dict) + } call.resolve() } @objc func show(_ call: CAPPluginCall) { - setAnimation(call) - bridge?.statusBarVisible = true + let animation = call.getString("animation", "FADE") + DispatchQueue.main.async { [weak self] in + self?.statusBar?.show(animation: animation) + guard + let info = self?.statusBar?.getInfo(), + let dict = self?.toDict(info), + let event = self?.statusBarVisibilityChanged + else { return } + self?.notifyListeners(event, data: dict) + } call.resolve() } @objc func getInfo(_ call: CAPPluginCall) { DispatchQueue.main.async { [weak self] in - guard let bridge = self?.bridge else { - return - } - let style: String - switch bridge.statusBarStyle { - case .default: - if bridge.userInterfaceStyle == UIUserInterfaceStyle.dark { - style = "DARK" - } else { - style = "LIGHT" - } - case .lightContent: - style = "DARK" - default: - style = "LIGHT" - } - - call.resolve([ - "visible": bridge.statusBarVisible, - "style": style - ]) + guard + let info = self?.statusBar?.getInfo(), + let dict = self?.toDict(info) + else { return } + call.resolve(dict) } } @objc func setOverlaysWebView(_ call: CAPPluginCall) { - call.unimplemented() + guard let overlay = call.options["overlay"] as? Bool else { return } + DispatchQueue.main.async { [weak self] in + self?.statusBar?.setOverlaysWebView(overlay) + guard + let info = self?.statusBar?.getInfo(), + let dict = self?.toDict(info), + let event = self?.statusBarOverlayChanged + else { return } + self?.notifyListeners(event, data: dict) + } + call.resolve() + } + + private func toDict(_ info: StatusBarInfo) -> [String: Any] { + return [ + "visible": info.visible!, + "style": info.style!, + "color": info.color!, + "overlays": info.overlays!, + "height": info.height! + ] } } diff --git a/status-bar/ios/Sources/StatusBarPlugin/UIColor.swift b/status-bar/ios/Sources/StatusBarPlugin/UIColor.swift new file mode 100644 index 000000000..2b509a0b4 --- /dev/null +++ b/status-bar/ios/Sources/StatusBarPlugin/UIColor.swift @@ -0,0 +1,40 @@ +import Capacitor + +public extension CapacitorExtensionTypeWrapper where T: UIColor { + + static func hex(fromColor: UIColor) -> String? { + var red: CGFloat = 0 + var green: CGFloat = 0 + var blue: CGFloat = 0 + var alpha: CGFloat = 0 + + guard fromColor.getRed(&red, green: &green, blue: &blue, alpha: &alpha) else { + assertionFailure("Failed to get RGBA components from UIColor") + return nil + } + + red = max(0, min(1, red)) + green = max(0, min(1, green)) + blue = max(0, min(1, blue)) + alpha = max(0, min(1, alpha)) + + if alpha == 1 { + // RGB + return String( + format: "#%02lX%02lX%02lX", + Int(round(red * 255)), + Int(round(green * 255)), + Int(round(blue * 255)) + ) + } else { + // RGBA + return String( + format: "#%02lX%02lX%02lX%02lX", + Int(round(red * 255)), + Int(round(green * 255)), + Int(round(blue * 255)), + Int(round(alpha * 255)) + ) + } + } +} diff --git a/status-bar/package.json b/status-bar/package.json index 3d9d60a7a..30969d2fd 100644 --- a/status-bar/package.json +++ b/status-bar/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/status-bar", - "version": "6.0.0", + "version": "7.0.0-alpha.2", "description": "The StatusBar API Provides methods for configuring the style of the Status Bar, along with showing or hiding it.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorStatusBar -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorStatusBar -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api StatusBarPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorStatusBar.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/status-bar/rollup.config.js b/status-bar/rollup.config.mjs similarity index 100% rename from status-bar/rollup.config.js rename to status-bar/rollup.config.mjs diff --git a/status-bar/src/definitions.ts b/status-bar/src/definitions.ts index 074aa4423..acefc6771 100644 --- a/status-bar/src/definitions.ts +++ b/status-bar/src/definitions.ts @@ -1,3 +1,46 @@ +/// + +declare module '@capacitor/cli' { + export interface PluginsConfig { + /** + * These config values are available: + */ + StatusBar?: { + /** + * Whether the statusbar is overlaid or not. + * For applications targeting Android 15, this property has no effect unless + * the property windowOptOutEdgeToEdgeEnforcement is added to the application layout file. + * Otherwise, the application assumes always overlays as true. + * More details in https://developer.android.com/reference/android/R.attr#windowOptOutEdgeToEdgeEnforcement + * + * @since 1.0.0 + * @default true + * @example false + */ + overlaysWebView?: boolean; + + /** + * Style of the text of the status bar. + * + * @since 1.0.0 + * @default default + * @example "DARK" + */ + style?: string; + + /** + * Color of the background of the statusbar in hex format, #RRGGBB. + * Doesn't work if `overlaysWebView` is true. + * + * @since 1.0.0 + * @default #000000 + * @example "#ffffffff" + */ + backgroundColor?: string; + }; + } +} + export interface StyleOptions { /** * Style of the text of the status bar. @@ -75,8 +118,6 @@ export interface BackgroundColorOptions { /** * A hex color to which the status bar color is set. * - * This option is only supported on Android. - * * @since 1.0.0 */ color: string; @@ -100,8 +141,6 @@ export interface StatusBarInfo { /** * The current status bar color. * - * This option is only supported on Android. - * * @since 1.0.0 */ color?: string; @@ -109,8 +148,6 @@ export interface StatusBarInfo { /** * Whether the statusbar is overlaid or not. * - * This option is only supported on Android. - * * @since 1.0.0 */ overlays?: boolean; @@ -136,8 +173,6 @@ export interface StatusBarPlugin { /** * Set the background color of the status bar. * - * This method is only supported on Android. - * * @since 1.0.0 */ setBackgroundColor(options: BackgroundColorOptions): Promise; @@ -171,8 +206,6 @@ export interface StatusBarPlugin { * Set whether or not the status bar should overlay the webview to allow usage * of the space underneath it. * - * This method is only supported on Android. - * * @since 1.0.0 */ setOverlaysWebView(options: SetOverlaysWebViewOptions): Promise; diff --git a/text-zoom/CHANGELOG.md b/text-zoom/CHANGELOG.md index 42ea9d04a..0afaa5fa7 100644 --- a/text-zoom/CHANGELOG.md +++ b/text-zoom/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/text-zoom@7.0.0-alpha.1...@capacitor/text-zoom@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/text-zoom + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/text-zoom@6.0.2...@capacitor/text-zoom@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/text-zoom + +## [6.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/text-zoom@6.0.1...@capacitor/text-zoom@6.0.2) (2024-08-08) + +**Note:** Version bump only for package @capacitor/text-zoom + ## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/text-zoom@6.0.0...@capacitor/text-zoom@6.0.1) (2024-06-13) **Note:** Version bump only for package @capacitor/text-zoom diff --git a/text-zoom/CapacitorTextZoom.podspec b/text-zoom/CapacitorTextZoom.podspec index 75e33c0d5..11f37c268 100644 --- a/text-zoom/CapacitorTextZoom.podspec +++ b/text-zoom/CapacitorTextZoom.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'text-zoom/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/text-zoom/Package.swift b/text-zoom/Package.swift index a4c22a639..758934ffb 100644 --- a/text-zoom/Package.swift +++ b/text-zoom/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorTextZoom", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorTextZoom", diff --git a/text-zoom/android/build.gradle b/text-zoom/android/build.gradle index 90c1cbc8c..98b05bc9c 100644 --- a/text-zoom/android/build.gradle +++ b/text-zoom/android/build.gradle @@ -1,9 +1,9 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -15,7 +15,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.textzoom" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -49,8 +49,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/text-zoom/android/gradle/wrapper/gradle-wrapper.jar b/text-zoom/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/text-zoom/android/gradle/wrapper/gradle-wrapper.jar and b/text-zoom/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/text-zoom/android/gradle/wrapper/gradle-wrapper.properties b/text-zoom/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/text-zoom/android/gradle/wrapper/gradle-wrapper.properties +++ b/text-zoom/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/text-zoom/android/gradlew b/text-zoom/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/text-zoom/android/gradlew +++ b/text-zoom/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/text-zoom/android/gradlew.bat b/text-zoom/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/text-zoom/android/gradlew.bat +++ b/text-zoom/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/text-zoom/package.json b/text-zoom/package.json index c7a7e86e6..30bd54d72 100644 --- a/text-zoom/package.json +++ b/text-zoom/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/text-zoom", - "version": "6.0.1", + "version": "7.0.0-alpha.2", "description": "The Text Zoom API provides the ability to change Web View text size for visual accessibility.", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorTextZoom -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorTextZoom -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api TextZoomPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorTextZoom.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/text-zoom/rollup.config.js b/text-zoom/rollup.config.mjs similarity index 100% rename from text-zoom/rollup.config.js rename to text-zoom/rollup.config.mjs diff --git a/text-zoom/src/ios.ts b/text-zoom/src/ios.ts index 6aa7ec0a5..3b307a244 100644 --- a/text-zoom/src/ios.ts +++ b/text-zoom/src/ios.ts @@ -1,11 +1,4 @@ -import { Plugins } from '@capacitor/core'; - -import type { - GetPreferredResult, - GetResult, - SetOptions, - TextZoomPlugin, -} from './definitions'; +import type { GetResult, SetOptions, TextZoomPlugin } from './definitions'; export class TextZoomIOS implements TextZoomPlugin { static readonly TEXT_SIZE_REGEX = /(\d+)%/; @@ -17,8 +10,8 @@ export class TextZoomIOS implements TextZoomPlugin { return { value }; } - async getPreferred(): Promise { - return Plugins.TextZoom.getPreferred(); + async getPreferred(): Promise { + throw 'Native implementation will be used'; } async set(options: SetOptions): Promise { diff --git a/toast/CHANGELOG.md b/toast/CHANGELOG.md index 9a68eb29a..fdebf50bf 100644 --- a/toast/CHANGELOG.md +++ b/toast/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/toast@7.0.0-alpha.1...@capacitor/toast@7.0.0-alpha.2) (2024-12-19) + +**Note:** Version bump only for package @capacitor/toast + +# [7.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/toast@6.0.2...@capacitor/toast@7.0.0-alpha.1) (2024-12-16) + +**Note:** Version bump only for package @capacitor/toast + +## [6.0.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/toast@6.0.1...@capacitor/toast@6.0.2) (2024-08-08) + +**Note:** Version bump only for package @capacitor/toast + ## [6.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/toast@6.0.0...@capacitor/toast@6.0.1) (2024-06-13) **Note:** Version bump only for package @capacitor/toast diff --git a/toast/CapacitorToast.podspec b/toast/CapacitorToast.podspec index 99e25e8cf..70d5be202 100644 --- a/toast/CapacitorToast.podspec +++ b/toast/CapacitorToast.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = package['author'] s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'toast/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '14.0' s.dependency 'Capacitor' s.swift_version = '5.1' end diff --git a/toast/Package.swift b/toast/Package.swift index f0d82da30..290ef399c 100644 --- a/toast/Package.swift +++ b/toast/Package.swift @@ -3,7 +3,7 @@ import PackageDescription let package = Package( name: "CapacitorToast", - platforms: [.iOS(.v13)], + platforms: [.iOS(.v14)], products: [ .library( name: "CapacitorToast", diff --git a/toast/android/build.gradle b/toast/android/build.gradle index 1a3b46d3c..d4822e630 100644 --- a/toast/android/build.gradle +++ b/toast/android/build.gradle @@ -1,9 +1,9 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1' } buildscript { @@ -15,7 +15,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' + classpath 'com.android.tools.build:gradle:8.7.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' } @@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { android { namespace "com.capacitorjs.plugins.toast" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -49,8 +49,8 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } publishing { singleVariant("release") diff --git a/toast/android/gradle/wrapper/gradle-wrapper.jar b/toast/android/gradle/wrapper/gradle-wrapper.jar index 033e24c4c..a4b76b953 100644 Binary files a/toast/android/gradle/wrapper/gradle-wrapper.jar and b/toast/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/toast/android/gradle/wrapper/gradle-wrapper.properties b/toast/android/gradle/wrapper/gradle-wrapper.properties index c747538fb..c1d5e0185 100644 --- a/toast/android/gradle/wrapper/gradle-wrapper.properties +++ b/toast/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/toast/android/gradlew b/toast/android/gradlew index fcb6fca14..f5feea6d6 100755 --- a/toast/android/gradlew +++ b/toast/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +205,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/toast/android/gradlew.bat b/toast/android/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/toast/android/gradlew.bat +++ b/toast/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/toast/package.json b/toast/package.json index 177b3e278..130e88ea0 100644 --- a/toast/package.json +++ b/toast/package.json @@ -1,6 +1,6 @@ { "name": "@capacitor/toast", - "version": "6.0.1", + "version": "7.0.0-alpha.2", "description": "The Toast API provides a notification pop up for displaying important information to a user. Just like real toast!", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "xcodebuild build -scheme CapacitorToast -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'", + "verify:ios": "xcodebuild build -scheme CapacitorToast -destination generic/platform=iOS", "verify:android": "cd android && ./gradlew clean build test && cd ..", "verify:web": "npm run build", "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", @@ -40,30 +40,30 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", "swiftlint": "node-swiftlint", "docgen": "docgen --api ToastPlugin --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js", + "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", "clean": "rimraf ./dist", "watch": "tsc --watch", "prepublishOnly": "npm run build", "publish:cocoapod": "pod trunk push ./CapacitorToast.podspec --allow-warnings" }, "devDependencies": { - "@capacitor/android": "^6.0.0", - "@capacitor/core": "^6.0.0", + "@capacitor/android": "next", + "@capacitor/core": "next", "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "^6.0.0", + "@capacitor/ios": "next", "@ionic/eslint-config": "^0.4.0", "@ionic/prettier-config": "~1.0.1", "@ionic/swiftlint-config": "^1.1.2", "eslint": "^8.57.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.0", - "rollup": "^2.29.0", + "rimraf": "^6.0.1", + "rollup": "^4.26.0", "swiftlint": "^1.0.1", "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^6.0.0" + "@capacitor/core": "next" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/toast/rollup.config.js b/toast/rollup.config.mjs similarity index 100% rename from toast/rollup.config.js rename to toast/rollup.config.mjs