From 12e2a91a28067bf36ec8bbc43e0c8c0d4872216c Mon Sep 17 00:00:00 2001
From: Mathias Chouet <mathias.chouet@irstea.fr>
Date: Thu, 26 Mar 2020 15:23:31 +0100
Subject: [PATCH] Fix #383 - update Cordova config.xml

---
 config.xml                      | 8 ++++----
 package.json                    | 4 ++--
 scripts/bump-cordova-version.js | 9 +++++++++
 3 files changed, 15 insertions(+), 6 deletions(-)
 create mode 100644 scripts/bump-cordova-version.js

diff --git a/config.xml b/config.xml
index 7f07f6690..7e9e138ab 100644
--- a/config.xml
+++ b/config.xml
@@ -1,11 +1,11 @@
 <?xml version='1.0' encoding='utf-8'?>
-<widget id="fr.irstea.cassiopee" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="fr.irstea.cassiopee" version="4.10.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
     <name>Cassiopée</name>
     <description>
-        A sample Apache Cordova application that responds to the deviceready event.
+        Hydraulic calculators / Modules de calcul d'hydraulique
     </description>
-    <author email="dev@cordova.apache.org" href="http://cordova.io">
-        Apache Cordova Team
+    <author email="bug@cassiopee.g-eau.fr" href="https://cassiopee.g-eau.fr">
+        UMR G-EAU
     </author>
     <content src="index.html" />
     <icon src="src/android-chrome-512x512.png" />
diff --git a/package.json b/package.json
index 9f6a0c0e4..4aba95fc5 100644
--- a/package.json
+++ b/package.json
@@ -21,7 +21,7 @@
     "build": "npm run preprocess && npm run mkdocs2pdf && npm run ng build -- --prod",
     "update-dist-index-mimetypes": "node scripts/update-dist-index-mimetypes.js",
     "build-cordova": "npm run build-no-pdf && npm run update-dist-index-mimetypes && node scripts/add-cordova-script.js",
-    "release-android": "npm run build-cordova && \"node_modules/.bin/cordova\" platform add android; node scripts/remove-duplicate-sitemap.js && \"node_modules/.bin/cordova\" build android && node scripts/move-cordova-release.js",
+    "release-android": "node scripts/bump-cordova-version.js && npm run build-cordova && \"node_modules/.bin/cordova\" platform add android; node scripts/remove-duplicate-sitemap.js && \"node_modules/.bin/cordova\" build android && node scripts/move-cordova-release.js",
     "electron": "npm run update-dist-index-mimetypes && \"node_modules/.bin/electron\" .",
     "release-linux-nocompile": "npm run update-dist-index-mimetypes && \"node_modules/.bin/electron-builder\"",
     "release-linux": "npm run build-no-pdf && npm run release-linux-nocompile",
@@ -120,4 +120,4 @@
       "android"
     ]
   }
-}
+}
\ No newline at end of file
diff --git a/scripts/bump-cordova-version.js b/scripts/bump-cordova-version.js
new file mode 100644
index 000000000..e54a3f038
--- /dev/null
+++ b/scripts/bump-cordova-version.js
@@ -0,0 +1,9 @@
+'use strict';
+
+const fs = require('fs');
+
+const path = "./config.xml";
+const version = require("../package.json").version;
+const contents = fs.readFileSync(path, "utf-8");
+
+fs.writeFileSync(path, contents.replace(/version="[0-9]+\.[0-9]+\.[0-9]+"/, 'version="' + version + '"'));
-- 
GitLab