Skip to content

Commit

Permalink
Restore build-native.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders Knutsson authored and Anders Knutsson committed Sep 29, 2018
1 parent eeca865 commit b9d3952
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 0 deletions.
111 changes: 111 additions & 0 deletions publish/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions src/scripts/build-native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const { exec } = require('child_process');
const semver = require('semver');

exec('tns --version', (err, stdout, stderr) => {
if (err) {
// node couldn't execute the command
console.log(`tns --version err: ${err}`);
return;
}

const tnsVersion = semver.major(stdout);

// execute 'tns plugin build' for {N} version > 4. This command builds .aar in platforms/android folder.
if (tnsVersion >= 4) {
console.log(`executing 'tns plugin build'`);
exec('tns plugin build', (err, stdout, stderr) => {
if (err) {
// node couldn't execute the command
console.log(`${err}`);
return;
}
});
}
});

0 comments on commit b9d3952

Please sign in to comment.