Skip to content

Commit

Permalink
plugin: fix to work with cordova@10.0.0 (JaneaSystems#13)
Browse files Browse the repository at this point in the history
* Patched to work with cordova-android@9.0.0

JaneaSystems/nodejs-mobile#239 (comment)

* Patched to work with cordova-android@9.0.0

JaneaSystems/nodejs-mobile#239 (comment)

* 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..
  • Loading branch information
iMrDJAi authored Jul 30, 2021
1 parent 71ca967 commit 80ba48c
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 8 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build-android.yaml
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions .github/workflows/build-ios.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</config-file>

<edit-config file="AndroidManifest.xml" target="/manifest/uses-sdk" mode="merge">
<uses-sdk android:minSdkVersion="21" />
</edit-config>

<source-file src="src/android/java/com/janeasystems/cdvnodejsmobile/NodeJS.java" target-dir="src/com/janeasystems/cdvnodejsmobile/" />

<source-file src="src/common/cordova-bridge/cordova-bridge.h" target-dir="libs/cdvnodejsmobile/" />
Expand Down
8 changes: 8 additions & 0 deletions src/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ext.cdvMinSdkVersion = 22

buildscript {
repositories {
Expand All @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions testapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -26,4 +26,4 @@
"ios"
]
}
}
}

0 comments on commit 80ba48c

Please sign in to comment.