From 80ba48c4b0010a30a431db0ab957ce470bcfa286 Mon Sep 17 00:00:00 2001 From: "${Mr.DJA}" <42304709+iMrDJAi@users.noreply.github.com> Date: Fri, 30 Jul 2021 15:12:57 +0100 Subject: [PATCH] plugin: fix to work with cordova@10.0.0 (#13) * Patched to work with cordova-android@9.0.0 https://github.com/JaneaSystems/nodejs-mobile/issues/239#issue-548915419 * Patched to work with cordova-android@9.0.0 https://github.com/JaneaSystems/nodejs-mobile/issues/239#issue-548915419 * Updated build.gradle * Removed copy-build-extras-gradle hook * Delete build-extras.gradle * Delete copy-build-extras-gradle.js * Create build-apk.yaml * Fixed a typo * Delete build-apk.yaml * Added "Build Android Project" test * Added "Build IOS Project" test * Update package.json * Update build-ios.yaml * Tabs.. --- .github/workflows/build-android.yaml | 37 ++++++++++++++++++++++++++++ .github/workflows/build-ios.yaml | 32 ++++++++++++++++++++++++ plugin.xml | 4 --- src/android/build.gradle | 8 ++++++ testapp/package.json | 8 +++--- 5 files changed, 81 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/build-android.yaml create mode 100644 .github/workflows/build-ios.yaml diff --git a/.github/workflows/build-android.yaml b/.github/workflows/build-android.yaml new file mode 100644 index 0000000..9d2ad65 --- /dev/null +++ b/.github/workflows/build-android.yaml @@ -0,0 +1,37 @@ +name: Build Android Project +on: + push: + branches: [ unstable ] + pull_request: + branches: [ unstable ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Clone repo + uses: actions/checkout@v2 + - name: Installing JDK 8 + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: '8' + - name: Installing Cordova! + run: | + sudo npm i cordova@10.0.0 -g + - name: Installing the npm dependencies! + run: | + cd testapp + npm i + - name: Copying nodejs-mobile-cordova plugin + run: | + cd testapp + npm run copy-module + - name: Preparing the Android project! + run: | + cd testapp + cordova prepare android + - name: Building the Android project! + run: | + cd testapp + cordova build android diff --git a/.github/workflows/build-ios.yaml b/.github/workflows/build-ios.yaml new file mode 100644 index 0000000..8d91f3f --- /dev/null +++ b/.github/workflows/build-ios.yaml @@ -0,0 +1,32 @@ +name: Build IOS Project +on: + push: + branches: [ unstable ] + pull_request: + branches: [ unstable ] + +jobs: + build: + runs-on: macOS-latest + steps: + - name: Clone repo + uses: actions/checkout@v2 + - name: Installing Cordova! + run: | + sudo npm i cordova@10.0.0 -g + - name: Installing the npm dependencies! + run: | + cd testapp + npm i + - name: Copying nodejs-mobile-cordova plugin + run: | + cd testapp + npm run copy-module + - name: Preparing the IOS project! + run: | + cd testapp + cordova prepare ios + - name: Building the ISO project! + run: | + cd testapp + cordova build ios diff --git a/plugin.xml b/plugin.xml index 2128c31..227f1ff 100644 --- a/plugin.xml +++ b/plugin.xml @@ -74,10 +74,6 @@ - - - - diff --git a/src/android/build.gradle b/src/android/build.gradle index 8cd92c8..3f6f73c 100644 --- a/src/android/build.gradle +++ b/src/android/build.gradle @@ -1,3 +1,4 @@ +ext.cdvMinSdkVersion = 22 buildscript { repositories { @@ -24,6 +25,13 @@ android { lintOptions { abortOnError false } + + packagingOptions { + pickFirst 'lib/x86/libnode.so' + pickFirst 'lib/armeabi-v7a/libnode.so' + pickFirst 'lib/arm64-v8a/libnode.so' + pickFirst 'lib/x86_64/libnode.so' + } } import org.gradle.internal.os.OperatingSystem; diff --git a/testapp/package.json b/testapp/package.json index dae76ba..5685622 100644 --- a/testapp/package.json +++ b/testapp/package.json @@ -10,9 +10,9 @@ "copy-module": "node copy-module-from-parent.js" }, "dependencies": { - "cordova-android": "^7.1.4", - "cordova-ios": "^4.5.5", - "cordova-plugin-whitelist": "^1.3.3", + "cordova-android": "^9.0.0", + "cordova-ios": "^6.2.0", + "cordova-plugin-whitelist": "^1.3.4", "recursive-copy": "^2.0.9" }, "cordova": { @@ -26,4 +26,4 @@ "ios" ] } -} \ No newline at end of file +}