Skip to content

Commit

Permalink
Dramatically simplify config.xml
Browse files Browse the repository at this point in the history
- Any plugins defined in config.xml are now ignored
    - TESTING DONE: Ran `npx cordova prepare` multiple times and no plugins were added
    - it looks like `package.json` is the only source of truth
    - so removed all plugins from `config.cordovabuild.xml`.

`config.cordovabuild.xml` and `config.serve.xml` are now almost identical except for the `<edit_config>` bits and the native hooks

- Remove preferences related to obsolete features
    - splashscreen
    - crosswalk

- Upgrade the `minSdkVersion` to 22 to be consistent with [email protected]
  • Loading branch information
shankari committed Jul 15, 2020
1 parent d4a184b commit 30e999a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 59 deletions.
48 changes: 2 additions & 46 deletions config.cordovabuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,8 @@
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="21" />
<preference name="android-minSdkVersion" value="22" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="100" />
<preference name="xwalkVersion" value="19+" />
<preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect" />
<preference name="xwalkMode" value="embedded" />
<preference name="xwalkMultipleApk" value="true" />
<preference name="emSensorDataCollectionProtocolApprovalDate" value="2016-07-14" />
<config-file parent="/manifest/application" target="AndroidManifest.xml">
<meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" />
Expand Down Expand Up @@ -80,7 +74,7 @@
</platform>
<platform name="android">
<hook src="hooks/before_build/android/android_copy_locales.js" type="before_build" />
<preference name="android-minSdkVersion" value="21" />
<preference name="android-minSdkVersion" value="22" />
<preference name="android-targetSdkVersion" value="28" />
<resource-file src="google-services.json" target="app/google-services.json" />
<hook src="hooks/before_build/android/android_set_provider.js" type="before_build" />
Expand All @@ -107,44 +101,6 @@
</config-file>
</platform>
<icon src="resources/android/icon/drawable-xhdpi-icon.png" />
<plugin name="phonegap-plugin-push" spec="=2.3.0">
<variable name="FCM_VERSION" value="11.0.1" />
</plugin>
<plugin name="ionic-plugin-keyboard" spec="~2.2.1" />
<plugin name="cordova-plugin-app-version" spec="0.1.9" />
<plugin name="cordova-plugin-file" spec="6.0.2" />
<plugin name="cordova-plugin-device" spec="2.0.1" />
<plugin name="cordova-plugin-whitelist" spec="~1.3.3" />
<plugin name="cordova-plugin-customurlscheme" spec="5.0.1">
<variable name="URL_SCHEME" value="emission" />
</plugin>
<plugin name="cordova-plugin-email-composer" spec="0.9.2" />
<plugin name="cordova-plugin-x-socialsharing" spec="6.0.0" />
<plugin name="cordova-plugin-inappbrowser" spec="4.0.0" />
<plugin name="cordova-plugin-local-notification" spec="0.9.0-beta.3" />
<plugin name="cordova-plugin-ionic-webview" spec="5.0.0">
<variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
</plugin>
<plugin name="cordova-plugin-ionic" spec="5.4.7">
<variable name="APP_ID" value="e0d8cdec" />
<variable name="CHANNEL_NAME" value="Production" />
<variable name="UPDATE_METHOD" value="none" />
<variable name="UPDATE_API" value="https://api.ionicjs.com" />
<variable name="MAX_STORE" value="2" />
</plugin>
<plugin name="cordova-plugin-advanced-http" spec="3.0.0">
</plugin>
<preference name="SplashShowOnlyFirstTime" value="false" />
<plugin name="edu.berkeley.eecs.emission.cordova.auth" spec="https://github.com/e-mission/cordova-jwt-auth.git#v1.6.2-alpha1" />
<plugin name="edu.berkeley.eecs.emission.cordova.comm" spec="https://github.com/e-mission/cordova-server-communication.git#v1.2.2" />
<plugin name="edu.berkeley.eecs.emission.cordova.datacollection" spec="https://github.com/e-mission/e-mission-data-collection.git#v1.4.3">
<variable name="LOCATION_VERSION" value="11.0.1" />
</plugin>
<plugin name="edu.berkeley.eecs.emission.cordova.serversync" spec="https://github.com/e-mission/cordova-server-sync.git#v1.2.3" />
<plugin name="edu.berkeley.eecs.emission.cordova.settings" spec="https://github.com/e-mission/cordova-connection-settings.git#v1.2.1" />
<plugin name="edu.berkeley.eecs.emission.cordova.transitionnotify" spec="https://github.com/e-mission/e-mission-transition-notify.git#v1.2.5" />
<plugin name="edu.berkeley.eecs.emission.cordova.unifiedlogger" spec="https://github.com/e-mission/cordova-unified-logger.git#v1.3.2" />
<plugin name="edu.berkeley.eecs.emission.cordova.usercache" spec="https://github.com/e-mission/cordova-usercache.git#v1.1.2" />
<engine name="ios" spec="6.1.0" />
<engine name="android" spec="9.0.0" />
</widget>
20 changes: 7 additions & 13 deletions config.serve.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="35" id="edu.berkeley.eecs.emission" ios-CFBundleVersion="35" version="2.6.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget android-versionCode="39" id="edu.berkeley.eecs.emission" ios-CFBundleVersion="39" version="2.8.1" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>emission</name>
<description>
A commute pattern tracker and carbon footprint estimator.
Expand All @@ -9,24 +9,19 @@
</author>
<content src="index.html" />
<access origin="*" />
<allow-navigation href="https://em-game.eecs.berkeley.edu/*" />
<hook src="package-hooks/ios9_allow_http.sh" type="after_prepare" />
<hook src="hooks/before_prepare/download_translation.js" type="before_prepare" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="18" />
<preference name="android-minSdkVersion" value="22" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="100" />
<preference name="xwalkVersion" value="19+" />
<preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect" />
<preference name="xwalkMode" value="embedded" />
<preference name="xwalkMultipleApk" value="true" />
<preference name="emSensorDataCollectionProtocolApprovalDate" value="2016-07-14" />
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<platform name="ios">
<preference name="WKWebViewOnly" value="true" />
<preference name="WKSuspendInBackground" value="false" />
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
<icon height="114" src="resources/ios/icon/[email protected]" width="114" />
<icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
Expand Down Expand Up @@ -61,8 +56,8 @@
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
</platform>
<platform name="android">
<preference name="android-minSdkVersion" value="18" />
<preference name="android-targetSdkVersion" value="21" />
<preference name="android-minSdkVersion" value="22" />
<preference name="android-targetSdkVersion" value="28" />
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
Expand All @@ -83,5 +78,4 @@
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
</platform>
<icon src="resources/android/icon/drawable-xhdpi-icon.png" />
<preference name="SplashShowOnlyFirstTime" value="false" />
</widget>

0 comments on commit 30e999a

Please sign in to comment.