forked from openkraken/kraken
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_android_sdk.js
41 lines (37 loc) · 976 Bytes
/
build_android_sdk.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* Build script for iOS
*/
const { paths, pkgVersion } = require('./tasks');
const chalk = require('chalk');
const path = require('path');
const fs = require('fs');
const archiver = require('archiver');
const { series, task } = require('gulp');
task('pack-android-sdk', done => {
const filename = `com.openkraken.kraken.sdk.${pkgVersion}.zip`;
const filepath = path.join(paths.sdk, 'build/' + filename);
const output = fs.createWriteStream(filepath);
const archive = archiver('zip', {
zlib: { level: 9 } // Sets the compression level.
});
archive.pipe(output);
archive.directory(path.join(paths.sdk, 'build/host'), false);
archive.finalize();
output.on('close', function() {
done();
});
});
// Run tasks
series(
'android-so-clean',
'compile-polyfill',
'build-android-kraken-lib',
'build-android-sdk',
'pack-android-sdk'
)((err) => {
if (err) {
console.log(err);
} else {
console.log(chalk.green('Success.'));
}
});