Skip to content

Commit

Permalink
fix build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
poliha committed Apr 21, 2020
1 parent dd5b443 commit 519d72a
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ UserInterfaceState.xcuserstate
.todo

out
*.apk
*.apk
.env*
3 changes: 1 addition & 2 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<name>Saza</name>
<description>A wallet that supports Stellar Lumens(XLM) and assets issued on the Stellar network.</description>
<author email="[email protected]" href="https://saza.io/">Peter Oliha</author>
<content original-src="index.html" src="http://localhost:8100" />
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
Expand Down Expand Up @@ -110,5 +110,4 @@
<plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
<plugin name="cordova-plugin-ionic-webview" spec="^4.0.0" />
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
<allow-navigation href="http://localhost:8100" sessionid="433d1cd8" />
</widget>
19 changes: 18 additions & 1 deletion forge.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
const fs = require('fs');
const path = require('path');

module.exports = {
packagerConfig: {
"dir": "./www"
Expand All @@ -9,7 +12,21 @@ module.exports = {
],
hooks: {
postMake: (_, results) => {
results.map(({ artifacts }) => artifacts).flat().forEach(result => console.log(result));

const builds = results.map(({ artifacts }) => artifacts).flat();
try {
for (const b of builds) {
const destination = path.resolve('./dist', path.basename(b))
fs.copyFileSync(b, destination)
console.log(`copied: ${b} => ${destination}`);
}

console.log('All files copied to ./dist');

} catch (error) {
console.log(error)
}

}
}
}
4 changes: 3 additions & 1 deletion scripts/android-build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#! /bin/bash
set -e

source .env

UNSIGNED_APK="platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk"
VERSION=`node -pe "require('./package.json').version"`
RELEASE_FILE=saza-v$VERSION.apk
Expand All @@ -18,7 +20,7 @@ echo "Signing apk ..."
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore $SAZA_KEYSTORE $UNSIGNED_APK $SAZA_KEYSTORE_ALIAS

echo "Run zipalign on apk ..."
~/Android/Sdk/build-tools/28.0.3/zipalign -v 4 $UNSIGNED_APK $RELEASE_FILE
~/Android/Sdk/build-tools/29.0.3/zipalign -f -v 4 $UNSIGNED_APK $RELEASE_FILE

echo "Android production build completed..."
ls -alh $RELEASE_FILE
10 changes: 9 additions & 1 deletion scripts/electron-build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#! /bin/bash
set -e

if [ -d "./dist" ]
then
echo "Removing dist directory from previous build ..."
rm -rf dist
fi

echo "Making dist directory ..."
mkdir dist


echo "Building production release ..."
ng build --prod --base-href ./
#ng build --prod --base-href ./

echo "Making electron build ..."
electron-forge make
2 changes: 1 addition & 1 deletion src/app/pages/login/login.page.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<app-header [title]="pageTitle" [helpUrl]="helpUrl" [subTitle]="subTitle"></app-header>
<app-header [title]="pageTitle" [helpUrl]="helpUrl"></app-header>

<ion-content>
<form [formGroup]="loginForm" (submit)="formSubmit()">
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/saza-setup/saza-setup.page.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<app-header [title]="pageTitle" [helpUrl]="helpUrl" [subTitle]="subTitle"></app-header>
<app-header [title]="pageTitle" [helpUrl]="helpUrl"></app-header>

<ion-content>
<form [formGroup]="passwordForm">
Expand Down

0 comments on commit 519d72a

Please sign in to comment.