aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucifer <[email protected]>2019-12-17 19:32:07 +0530
committerLucifer <[email protected]>2019-12-17 19:32:07 +0530
commite06cb3e91ff9d910265fe7efb5eb6b47d97d3c9d (patch)
treef883abb609548042972d594e72fc1afd7f999cc7
parent746615a1e21c8c44c4d735d3db373fc1b7db69a4 (diff)
downloadnativekit-e06cb3e91ff9d910265fe7efb5eb6b47d97d3c9d.tar.xz
nativekit-e06cb3e91ff9d910265fe7efb5eb6b47d97d3c9d.zip
Added functions for building for mac, windows and both
-rw-r--r--index.js67
1 files changed, 67 insertions, 0 deletions
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..524be13
--- /dev/null
+++ b/index.js
@@ -0,0 +1,67 @@
+const makeDir = require('make-dir');
+var ncp = require('ncp').ncp;
+
+function buildForMac() {
+ (async () => {
+ const path = await makeDir('build');
+
+ console.log('Created directory \'build\' at path: ' + path);
+ })();
+
+ ncp('dist/mac/', 'build', function (err) {
+ if (err) {
+ return console.error(err);
+ }
+ console.log('Native Kit is built for macOS now. You can use the \'build\' directory directly to your project. \n\nFiles you need to include in your project are:\n\n1. build => css => all.css\n2. build => scripts => nativekit.js\nDon\'t delete the fonts directory.\n\nDon\'t forget to support the project if you like it! Go ahead contribute to it or star it on Github or better if you can spare some change, then donate at the following URL: \nhttps://www.paypal.me/kumarpriyansh\n\nVisit the Native Kit website for documentation at: \nhttps://www.nativekit.co.\n\nThank you for using Native Kit.');
+ });
+}
+
+function buildForWin() {
+ (async () => {
+ const path = await makeDir('build');
+
+ console.log('Created directory \'build\' at path: ' + path);
+ })();
+
+ ncp('dist/windows/', 'build', function (err) {
+ if (err) {
+ return console.error(err);
+ }
+ console.log('Native Kit is built for Windows 10 now. You can use the \'build\' directory directly to your project. \n\nFiles you need to include in your project are:\n\n1. build => css => all.css\n2. build => scripts => nativekit.js\nDon\'t delete the fonts directory.\n\nDon\'t forget to support the project if you like it! Go ahead contribute to it or star it on Github or better if you can spare some change, then donate at the following URL: \nhttps://www.paypal.me/kumarpriyansh\n\nVisit the Native Kit website for documentation at: \nhttps://www.nativekit.co.\n\nThank you for using Native Kit.');
+ });
+}
+
+function build() {
+ (async () => {
+ const path = await makeDir('build');
+
+ console.log('Created directory \'build\' at path: ' + path);
+ })();
+
+ ncp('dist/', 'build', function (err) {
+ if (err) {
+ return console.error(err);
+ }
+ console.log('Native Kit is built for both macOS and Windows 10 now. You can use the \'build\' directory directly to your project. \n\nFiles you need to include in your project are:\n\n1. build => (mac/windows) => css => all.css\n2. build => (mac/windows) => scripts => nativekit.js\nDon\'t delete the fonts directory.\n\nDon\'t forget to support the project if you like it! Go ahead contribute to it or star it on Github or better if you can spare some change, then donate at the following URL: \nhttps://www.paypal.me/kumarpriyansh\n\nVisit the Native Kit website for documentation at: \nhttps://www.nativekit.co.\n\nThank you for using Native Kit.');
+ });
+}
+
+for (var i=0; i<process.argv.length;i++) {
+ switch (process.argv[i]) {
+ case 'buildForMac':
+ buildForMac();
+ break;
+
+ case 'buildForWin':
+ buildForWin();
+ break;
+
+ case 'build':
+ build();
+ break;
+ }
+}
+
+module.exports.buildForMac = buildForMac;
+module.exports.buildForWin = buildForWin;
+module.exports.build = build; \ No newline at end of file