Skip to content

Commit 9ee0000

Browse files
author
Adrian Marquez
committed
feat: reenable and update examples generation script
1 parent 179b52e commit 9ee0000

File tree

11 files changed

+7
-554
lines changed

11 files changed

+7
-554
lines changed

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@
2323
}
2424
],
2525
"scripts": {
26-
"commitmsg": "echo 'validate commit messages'; commitlint -e $GIT_PARAMS",
27-
"precommit": "echo 'run prettier on commit'; lint-staged",
28-
"prettier": "echo 'run prettier'; prettier --write './{src,testbed,tests}/**/*.js'",
29-
"lint": "echo 'run code linter'; eslint --ext=js --fix ./src"
26+
"commitmsg": " echo 'validate commit messages'; commitlint -e $GIT_PARAMS",
27+
"precommit": " echo 'run prettier on commit'; lint-staged",
28+
"prettier": " echo 'run prettier'; prettier --write './{src,testbed,tests}/**/*.js'",
29+
"lint": " echo 'run code linter'; eslint --ext=js --fix ./src",
30+
"examples": " echo 'generate examples'; node ./src/scripts/examples"
3031
},
3132
"eslintConfig": {
3233
"extends": [

src/scripts/examples/index.js

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// yarn examples
66
// cd examples/cordova1
77
// (plug in devices)
8-
// (ionic build if ionic 3)
98
// cordova run ios
109
// cordova run android
1110

@@ -15,8 +14,6 @@ const DIR = "examples";
1514
const TMP = "tmp";
1615
const CORDOVA1 = "cordova1";
1716
const PHONEGAP1 = "phonegap1";
18-
const IONIC1 = "ionic1";
19-
const IONIC3 = "ionic3";
2017

2118
// promisfy bash execution with stout streaming
2219
const run = (args, dir = undefined) =>
@@ -78,58 +75,6 @@ const buildPhoneGap1 = async () => {
7875
await run(`phonegap platform add ios android`, `${DIR}/${PHONEGAP1}`);
7976
};
8077

81-
const buildIonic1 = async () => {
82-
await run(`ionic start ${IONIC1} tabs --cordova --type ionic1`, `${DIR}`);
83-
await run(
84-
`cp ./src/scripts/examples/templates/${IONIC1}/index.xml ./${DIR}/${IONIC1}/config.xml`
85-
);
86-
await run(
87-
`cp ./src/scripts/examples/templates/${IONIC1}/index.html ./${DIR}/${IONIC1}/www/templates/tab-dash.html`
88-
);
89-
await run(
90-
`cp ./src/scripts/examples/templates/${IONIC1}/app.js ./${DIR}/${IONIC1}/www/js/app.js`
91-
);
92-
await run(
93-
`cp ./src/scripts/examples/templates/${IONIC1}/controllers.js ./${DIR}/${IONIC1}/www/js/controllers.js`
94-
);
95-
await run(`rm -rf ./${DIR}/${IONIC1}/.git`);
96-
await run(`mkdir -p plugins/branch-cordova-sdk`, `${DIR}/${IONIC1}`);
97-
await run(
98-
`rsync -a ../../${TMP}/ plugins/branch-cordova-sdk`,
99-
`${DIR}/${IONIC1}`
100-
);
101-
await run(`ionic cordova platform add ios`, `${DIR}/${IONIC1}`);
102-
await run(`ionic cordova platform add android`, `${DIR}/${IONIC1}`);
103-
};
104-
105-
const buildIonic3 = async () => {
106-
await run(`ionic start ${IONIC3} tabs --cordova`, `${DIR}`);
107-
await run(`mkdir -p plugins/branch-cordova-sdk`, `${DIR}/${IONIC3}`);
108-
await run(
109-
`cp ./src/scripts/examples/templates/${IONIC3}/index.xml ./${DIR}/${IONIC3}/config.xml`
110-
);
111-
await run(
112-
`cp ./src/scripts/examples/templates/${IONIC3}/index.html ./${DIR}/${IONIC3}/src/pages/home/home.html`
113-
);
114-
await run(
115-
`cp ./src/scripts/examples/templates/${IONIC3}/app.js ./${DIR}/${IONIC3}/src/app/app.component.ts`
116-
);
117-
await run(
118-
`cp ./src/scripts/examples/templates/${IONIC3}/controllers.js ./${DIR}/${IONIC3}/src/pages/home/home.ts`
119-
);
120-
await run(`rm -rf ./${DIR}/${IONIC3}/.git`);
121-
await run(
122-
`rsync -a ../../${TMP}/ plugins/branch-cordova-sdk`,
123-
`${DIR}/${IONIC3}`
124-
);
125-
await run(`ionic cordova platform add ios`, `${DIR}/${IONIC3}`);
126-
await run(`ionic cordova platform add android`, `${DIR}/${IONIC3}`);
127-
};
128-
129-
const installDependencies = async () => {
130-
await run("yarn add -g cordova ionic phonegap");
131-
};
132-
13378
const copySdk = async () => {
13479
await run(
13580
`rsync -a ./ ./${TMP} --exclude node_modules --exclude .git --exclude ${DIR} --exclude ${TMP}`
@@ -142,12 +87,9 @@ const removeCopySdk = async () => {
14287

14388
const main = async () => {
14489
await cleanDirectory();
145-
// await installDependencies();
14690
await copySdk();
14791
await buildCordova1();
14892
await buildPhoneGap1();
149-
await buildIonic1();
150-
await buildIonic3();
15193
await removeCopySdk();
15294
};
15395

src/scripts/examples/templates/cordova1/index.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
<branch-key value="key_live_ndqptlgXNE4LHqIahH1WIpbiyFlb62J3" />
55
<uri-scheme value="branchcordova" />
66
<link-domain value="cordova.app.link" />
7+
<link-domain value="cordova-alternate.app.link" />
78
<ios-team-release value="PW4Q8885U7" />
89
</branch-config>
9-
<preference name="android-minSdkVersion" value="16" />
10+
<preference name="android-minSdkVersion" value="19" />
1011
<name>Cordova1</name>
1112
<description>Testing App For Branch Cordova</description>
1213
<author email="[email protected]" href="https://support.branch.io/support/tickets/new">Branch Support</author>
1314
<content src="index.html" />
14-
<plugin name="cordova-plugin-console" />
1515
<plugin name="cordova-plugin-whitelist" spec="1" />
1616
<access origin="*" />
1717
<allow-intent href="http://*/*" />

src/scripts/examples/templates/ionic1/app.js

Lines changed: 0 additions & 104 deletions
This file was deleted.

src/scripts/examples/templates/ionic1/controllers.js

Lines changed: 0 additions & 73 deletions
This file was deleted.

src/scripts/examples/templates/ionic1/index.html

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)