Hook up the android kotlin code to the send js code (#860)

This commit is contained in:
Donovan Preston 2018-07-27 09:11:46 -04:00 committed by GitHub
parent 5c7b4ace9a
commit a80d007e0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 317 additions and 222 deletions

View file

@ -0,0 +1,21 @@
const child_process = require('child_process');
const fs = require('fs');
const path = require('path');
child_process.execSync('npm run build');
const prefix = path.join('..', '..', 'dist');
const json_string = fs.readFileSync(path.join(prefix, 'manifest.json'));
const manifest = JSON.parse(json_string);
const android_filename = manifest['android.js'];
fs.writeFileSync(
'src/main/assets/android.js',
fs.readFileSync(`${prefix}${android_filename}`)
);
const vendor_filename = manifest['vendor.js'];
fs.writeFileSync(
'src/main/assets/vendor.js',
fs.readFileSync(`${prefix}${vendor_filename}`)
);