Skip to content

Commit a3994b0

Browse files
committed
cordova: Fix build
- Make 'cordova' a regular (non-dev) dependency. Before this change, `cordova prepare` would result in the package getting removed. - Try `cordova prepare` twice. It sometimes fails on the first attempt but works on the second.
1 parent 4175b57 commit a3994b0

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

cordova/package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"dist": "./build.sh"
1010
},
1111
"dependencies": {
12+
"cordova": "^8.1.2",
1213
"cordova-android": "^7.1.4",
1314
"cordova-plugin-badge": "^0.8.8",
1415
"cordova-plugin-customurlscheme": "^5.0.2",
@@ -35,8 +36,5 @@
3536
"platforms": [
3637
"android"
3738
]
38-
},
39-
"devDependencies": {
40-
"cordova": "^8.1.2"
4139
}
42-
}
40+
}

scripts/builder.Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ COPY cordova/package.json cordova/npm-shrinkwrap.json cordova/config.xml ./
5555
COPY cordova/res ./res
5656
RUN npm install && cordova telemetry off
5757
# build a dummy cordova app to download required artifacts in docker build time
58-
RUN mkdir www && cordova prepare && cordova build && rm -r www platforms/android/app/build
58+
# `electron prepare` sometimes fails on the first attempt but works on the second. this appears related to https://github.com/apache/cordova-plugin-screen-orientation/issues/55
59+
RUN mkdir www && (cordova prepare || cordova prepare) && cordova build && rm -r www platforms/android/app/build
5960

6061
# Spark client
6162
WORKDIR /opt/spark/client

0 commit comments

Comments
 (0)