Skip to content
This repository was archived by the owner on Mar 26, 2022. It is now read-only.

Commit 2c96f8a

Browse files
committed
Added all housekeeping and build tools
1 parent 0227d19 commit 2c96f8a

13 files changed

+267
-249
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ package-lock.json
66
# Our dist directory for app builds
77
dist/
88

9+
# Our project-level picoDeployConfig.json, since it is being replaced with copyConfig
10+
picoDeployConfig.json
11+
912
*~
1013
*.sw[mnpcod]
1114
*.log

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,35 @@ Generating Resources and icons: https://ionicframework.com/docs/cli/cordova/reso
1414

1515
crosswalk for performance: https://www.techiediaries.com/mobiledev/boosting-ionic2-apps-performance-with-crosswalk/
1616

17+
Using Greenworks: https://github.com/greenheartgames/greenworks
18+
19+
Install Greenworks with: https://github.com/greenheartgames/greenworks/blob/master/docs/build-instructions-electron.md#building-with-electron-rebuild and skip to step 4
20+
21+
Also will require steamworks sdk: https://github.com/greenheartgames/greenworks/blob/master/docs/get-steamworks-sdk.md
22+
23+
May need to manually add releases for each distro greenworks for electron .node files to `node_modules/greenworks/lib`
24+
25+
doign some funny stuff with the files key for electron builder to keep our build size small, and not include node modules, since they are included with the vendor on ionic.
26+
27+
may actually want to follow the NW.js for greenworks. NW.js is just a browserify/webpack thing that used to exist. Which we will have due to electron and all that
28+
29+
see how I am copy steam_app id for builds and stuff in main.js. and follow greenworks directory structure.
30+
31+
32 bit linux for steam not supported because names are same in [this guide](https://github.com/greenheartgames/greenworks/blob/master/docs/quick-start-nwjs.md)
32+
33+
Must Use Correct [electron](https://github.com/electron/electron/releases/tag/v1.8.1) AND [node](https://github.com/electron/electron/blob/04430c6dda80c25d24b7752f38f87003ac7ab3aa/.node-version) version, and then [do some cleanup](https://stackoverflow.com/questions/19996312/should-i-backup-the-npm-and-node-gyp-folder), or else will get a NODE_MODULE_VERSION (which Electron has its own compared to NOde :p), if going to use [prebuilt .node addons for greenworks](https://github.com/greenheartgames/greenworks/releases/tag/v0.11.0).
34+
35+
Linux AppIMage doesn't work for greenworks testing because [appImage directory is read-only](https://github.com/AppImage/AppImages/issues/80), thus we can't copy over the steam appId.
36+
37+
Used this for google play games: https://github.com/artberri/cordova-plugin-play-games-services
38+
39+
NOTE: Will only work if installed from google play store after you have it built. So will have a long testing process :p Currently have it installed under aaron@aaronthedev
40+
41+
Maybe? Used this to add neccessary android manifest stuff: https://cordova.apache.org/docs/en/latest/plugin_ref/spec.html#edit-config
42+
43+
may need to this to build for all: https://github.com/electron-userland/electron-builder/issues/2204
44+
Also, need to make sure we have `resources/icons/` folder, with an app icon named `512x512.png` [for linux icon](https://www.electron.build/icons)
45+
1746

1847
This is a starter template for [Ionic](http://ionicframework.com/docs/) projects.
1948

cart/jelpi.html

-141
This file was deleted.

config.xml

+11-9
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<preference name="webviewbounce" value="false" />
1919
<preference name="UIWebViewBounce" value="false" />
2020
<preference name="DisallowOverscroll" value="true" />
21-
<preference name="android-minSdkVersion" value="20" />
21+
<preference name="android-minSdkVersion" value="25" />
2222
<preference name="BackupWebStorage" value="none" />
2323
<preference name="SplashMaintainAspectRatio" value="true" />
2424
<preference name="SplashShowOnlyFirstTime" value="false" />
@@ -82,20 +82,22 @@
8282
</platform>
8383
<allow-navigation href="http://192.168.86.100:8100" />
8484
<allow-navigation href="http://192.168.86.108:8100" />
85-
<engine name="android" spec="^6.2.3" />
85+
<allow-navigation href="http://192.168.86.205:8100" />
86+
<allow-navigation href="http://192.168.86.225:8100" />
8687
<plugin name="cordova-plugin-console" spec="^1.0.5" />
87-
<plugin name="cordova-plugin-crosswalk-webview" spec="^2.3.0">
88-
<variable name="XWALK_VERSION" value="23+" />
89-
<variable name="XWALK_LITEVERSION" value="xwalk_core_library_canary:17+" />
90-
<variable name="XWALK_COMMANDLINE" value="--disable-pull-to-refresh-effect" />
91-
<variable name="XWALK_MODE" value="embedded" />
92-
<variable name="XWALK_MULTIPLEAPK" value="true" />
93-
</plugin>
9488
<plugin name="cordova-plugin-device" spec="^1.1.4" />
9589
<plugin name="cordova-plugin-screen-orientation" spec="^2.0.1" />
9690
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
9791
<plugin name="cordova-plugin-statusbar" spec="^2.2.2" />
9892
<plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
9993
<plugin name="cordova-sqlite-storage" spec="^2.0.4" />
10094
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
95+
<plugin name="cordova-plugin-crosswalk-webview" spec="^2.3.0">
96+
<variable name="XWALK_VERSION" value="23+" />
97+
<variable name="XWALK_LITEVERSION" value="xwalk_core_library_canary:17+" />
98+
<variable name="XWALK_COMMANDLINE" value="--disable-pull-to-refresh-effect" />
99+
<variable name="XWALK_MODE" value="embedded" />
100+
<variable name="XWALK_MULTIPLEAPK" value="true" />
101+
</plugin>
102+
<engine name="android" spec="6.3.0" />
101103
</widget>

config/copyConfig.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env node
2+
3+
var fs = require('fs');
4+
5+
function copyConfig(configFileName) {
6+
fs.createReadStream(`./config/${configFileName}`).pipe(fs.createWriteStream('picoDeployConfig.json'));
7+
}
8+
9+
let consoleMsg = 'Using the following config: ';
10+
11+
//If tou have multiple configs for the same cart
12+
// if (process.env.MOBILE && process.env.MOBILE !== "false") {
13+
// const mobileConfig = 'picoDeployConfig.mobile.json';
14+
// copyConfig(mobileConfig);
15+
// consoleMsg += mobileConfig;
16+
// }
17+
18+
// Include the Jelpi Config
19+
const jelpiConfig = 'picoDeployConfig.jelpi.json';
20+
copyConfig(jelpiConfig);
21+
consoleMsg += jelpiConfig;
22+
23+
console.log(consoleMsg);

config/picoDeployConfig.jelpi.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"cart": {
3+
"cartName": "jelpi.js"
4+
},
5+
"picosplash": {
6+
"enable": true,
7+
"splashMedia": "assets/picomedia/splash.mp4"
8+
},
9+
"backgroundMedia": false,
10+
"inactiveToExitDelayInMilli": 300000,
11+
"defaultSettings": {
12+
"fullscreen": true,
13+
"sound": true,
14+
"backgroundColor": "#272727",
15+
"gamepadColor": "#FFFFFF",
16+
"stretch": false
17+
},
18+
"dbWatcher": {
19+
"enable": false,
20+
"cartDataName": "nocomplygames_letsgetdismoney_v1"
21+
}
22+
}

ionic-android-deploy.sh

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
3+
# Commands to run sign and zipalign all ionic android output files
4+
if [ $# -ne 4 ]; then
5+
# Print Help
6+
echo " "
7+
echo "Wrong number of commands. Printing Help..."
8+
echo " "
9+
echo "Ionic Android Deploy. Simply follows commands from: http://ionicframework.com/docs/v1/guide/publishing.html"
10+
echo " "
11+
echo "Keystore can be created by following the keytool command in the above link"
12+
echo " "
13+
echo "USAGE:"
14+
echo " "
15+
echo "./ionic-android-deploy.sh [Path to keystore] [Keystore Password] [Output directory (No Trailing slash)] [apk file name (without trailing .apk)]"
16+
echo " "
17+
else
18+
19+
# Sign files with passed keystore
20+
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 \
21+
-keystore $1 -storepass $2 \
22+
platforms/android/build/outputs/apk/android-armv7-release-unsigned.apk getdismoney
23+
24+
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 \
25+
-keystore $1 -storepass $2 \
26+
platforms/android/build/outputs/apk/android-x86-release-unsigned.apk getdismoney
27+
28+
# Make our passed output directory/clean out already existing apks
29+
mkdir -p $3
30+
rm $3/$4-armv7.apk
31+
rm $3/$4-x86.apk
32+
33+
# Zip align apks. Using crazy ls to get the zipalign tool
34+
~/Library/Android/sdk/build-tools/$(ls ~/Library/Android/sdk/build-tools | head -n 1)/zipalign \
35+
-v 4 \
36+
platforms/android/build/outputs/apk/android-armv7-release-unsigned.apk \
37+
$3/$4-armv7.apk
38+
39+
~/Library/Android/sdk/build-tools/$(ls ~/Library/Android/sdk/build-tools | head -n 1)/zipalign \
40+
-v 4 \
41+
platforms/android/build/outputs/apk/android-x86-release-unsigned.apk \
42+
$3/$4-x86.apk
43+
fi

main.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
const {app, BrowserWindow} = require('electron')
2-
const path = require('path')
3-
const url = require('url')
1+
const {app, BrowserWindow} = require('electron');
2+
const path = require('path');
3+
const url = require('url');
4+
const fs = require('fs');
5+
const picoDeployConfig = require('./picoDeployConfig.json');
46

57
// Keep a global reference of the window object, if you don't, the window will
68
// be closed automatically when the JavaScript object is garbage collected.
@@ -11,8 +13,8 @@ function createWindow () {
1113
win = new BrowserWindow({
1214
width: 800,
1315
height: 600,
14-
title: "picoDeploy",
15-
})
16+
title: "picoDeploy"
17+
});
1618

1719
// and load the index.html of the app.
1820
win.loadURL(url.format({
@@ -26,6 +28,7 @@ function createWindow () {
2628
win.webContents.openDevTools();
2729
}
2830

31+
2932
// Emitted when the window is closed.
3033
win.on('closed', () => {
3134
// Dereference the window object, usually you would store windows

0 commit comments

Comments
 (0)