Skip to content

Commit d3c0f41

Browse files
committed
feat(release-build): Adding build app helper with debug option (still WIP!)
1 parent ae0df83 commit d3c0f41

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

lib/release.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env node
2+
import { exec } from 'child_process';
3+
4+
5+
6+
7+
/**
8+
* Builds the current app
9+
* @param release set to true if a release build is needed, involves the correct code signing
10+
* @param keyStorePath path to Android KeyStore
11+
* @param keyStorePassword KeyStore password
12+
* @param keyStoreAlias KeyStore alias
13+
* @param keyStoreAliasPassword KeyStore alias password
14+
* @param debug set to true to build a version of the app for debugging purposes
15+
*
16+
*/
17+
export function buildApp(release: boolean, keyStorePath: string, keyStorePassword: string, keyStoreAlias: string, keyStoreAliasPassword: string, debug = false): Promise<any> {
18+
let promise = new Promise((resolve, reject) => {
19+
// Adding debug AAR if needed
20+
if (debug) {
21+
exec('cd platforms/android/libs/runtime-libs/ && rm -r nativescript-optimized.aar && mv nativescript-regular.aar nativescript-optimized.aar', (err) => {
22+
if (err) {
23+
throw err;
24+
}
25+
});
26+
}
27+
// TODO trigger normal build
28+
});
29+
return promise;
30+
}

0 commit comments

Comments
 (0)