Put build scripts in /scripts, add them as Cordova hooks

master
Skylar Ittner 4 år sedan
förälder 4159a58cce
incheckning 5539240793

@ -51,4 +51,7 @@
<plugin name="cordova-plugin-app-version" spec="^0.1.9" />
<plugin name="cordova-plugin-inappbrowser" spec="^3.0.0" />
<engine name="browser" spec="^5.0.4" />
<hook src="scripts/www_npm_install.sh" type="before_prepare"/>
<hook src="scripts/generate_credits.sh" type="before_prepare"/>
<hook src="scripts/remove_bloat.sh" type="before_prepare"/>
</widget>

@ -0,0 +1,7 @@
cd www
yarn licenses generate-disclaimer > ../license-credits.md
cd ..
yarn licenses generate-disclaimer >> license-credits.md
cp www/pages/credits.template.html www/pages/credits.html
sed -e "/{{credits}}/r license-credits.md" -e "/{{credits}}/d" -i www/pages/credits.html

@ -1,6 +1,7 @@
#!/bin/sh
#!/bin/bash
# This script removes some stuff in `www/node_modules` that the app doesn't need to run.
# It removes about 6MB from the build size.
echo "Removing bloat in node_modules..."
cd www/node_modules
rm -rf array-parallel
@ -66,4 +67,4 @@ rm -rf sprites
rm -rf toggle
cd ..
echo "Cleanup finished"
echo "Cleanup finished"

Filskillnaden har hållits tillbaka eftersom den är för stor Load Diff

@ -0,0 +1,40 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<div class="page" data-name="credits">
<div class="navbar">
<div class="navbar-bg"></div>
<div class="navbar-inner">
<div class="left">
<a href="#" class="link icon-only back">
<i class="icon icon-back"></i>
</a>
</div>
<div class="title">Open Source</div>
</div>
</div>
<div class="page-content">
<div class="block">
<p>This program is licensed under the Mozilla Public License 2.0.
To get the source code, visit https://source.netsyms.com/Apps/NotePostApp.
<br>
This application relies on and is bundled with third-party code.
See below for the their licenses and where to find source code.
It is likely that not all of the listed third-party code is present
on your system; some of it is platform-specific and not included
in all builds.
</div>
<div class="block">
<h2>Third Party Code and Assets</h2>
<pre style="white-space: pre-line; overflow-wrap: break-word;">
{{credits}}
</pre>
</div>
</div>
</div>
Laddar…
Avbryt
Spara