forked from butterproject/butter-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7dd514f
commit c8f8458
Showing
4 changed files
with
66 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,36 @@ | ||
cache/ | ||
lib-cov | ||
*.seed | ||
*.log | ||
*.csv | ||
*.dat | ||
*.out | ||
*.pid | ||
*.gz | ||
|
||
.idea/ | ||
*.iml | ||
|
||
# build files | ||
node_modules/ | ||
src/app/vendor | ||
src/app/themes | ||
build/ | ||
cache/ | ||
dist/windows/*-Setup.exe | ||
dist/windows/update.exe | ||
dist/linux/linux-installer | ||
dist/linux/*.deb | ||
src/app/css/app.css | ||
*git.json | ||
|
||
# temp files | ||
pids | ||
logs | ||
results | ||
|
||
npm-debug.log | ||
|
||
app.nw | ||
|
||
.sass-cache | ||
*-ck.js | ||
*.srt | ||
*.DS_Store | ||
|
||
# vim swap files | ||
lib-cov | ||
.idea/ | ||
*.swp | ||
|
||
src/app/css/app.css | ||
*.sublime-* | ||
dist/windows/*-Setup.exe | ||
dist/windows/update.exe | ||
dist/linux/linux-installer | ||
dist/linux/*.deb | ||
*.bat | ||
*.db | ||
*git.json | ||
*openvpn* | ||
*.seed | ||
*.log | ||
*.csv | ||
*.dat | ||
*.out | ||
*.pid | ||
*.gz | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,63 @@ | ||
var availablePlatforms = [ | ||
'linux32', | ||
'linux64', | ||
'win32', | ||
'osx64' | ||
]; | ||
|
||
/* variables */ | ||
var nwVersion = '0.12.3'; | ||
|
||
var availablePlatforms = ['linux32', 'linux64', 'win32', 'osx64']; | ||
|
||
/* gulpfile */ | ||
var gulp = require('gulp'), | ||
nwBuilder = require('nw-builder'), | ||
yargs = require('yargs'), | ||
nib = require('nib'), | ||
stylus = require('gulp-stylus'), | ||
currentPlatform = require('nw-builder/lib/detectCurrentPlatform.js'), | ||
argv = require('yargs').argv, | ||
pkJson = require('./package.json'), | ||
parsePlatforms = function () { | ||
var req = argv.platforms.split(','), avail = []; | ||
var req = yargs.argv.platforms.split(','), avail = []; | ||
for (var pl in req) { | ||
if (availablePlatforms.indexOf(req[pl]) !== -1) { | ||
avail.push(req[pl]); | ||
} | ||
} | ||
return avail; | ||
return req[0] === 'all' ? availablePlatforms : avail; | ||
}; | ||
|
||
var nw = new nwBuilder({ | ||
files: [], | ||
version: nwVersion, | ||
platforms: argv.platforms ? parsePlatforms() : [currentPlatform()], | ||
buildType: 'versioned', | ||
zip: false, | ||
macIcns: './src/app/images/butter.icns', | ||
quiet: true | ||
version: nwVersion, | ||
platforms: yargs.argv.platforms ? parsePlatforms() : [currentPlatform()], | ||
}).on('log', console.log); | ||
|
||
// link default task to 'build' | ||
gulp.task('default', ['build']); | ||
/* gulp tasks */ | ||
gulp.task('default', ['run']); | ||
gulp.task('build', ['css', 'nwjs']); | ||
|
||
gulp.task('nwjs', function () { // download and compile nwjs | ||
// required files | ||
nw.options.files = ['./src/**', '!./src/app/styl/**', './node_modules/**', '!./node_modules/**/*.bin', './package.json', './README.md', './CHANGELOG.md', './LICENSE.txt', './.git.json']; | ||
// remove junk files | ||
nw.options.files = nw.options.files.concat(['!./node_modules/**/*.c', '!./node_modules/**/*.h', '!./node_modules/**/Makefile', '!./node_modules/**/*.h', '!./**/test*/**', '!./**/doc*/**', '!./**/example*/**', '!./**/demo*/**', '!./**/bin/**', '!./**/build/**', '!./**/.*/**']); | ||
// remove devdeps | ||
for (var dep in pkJson.devDependencies) { | ||
nw.options.files = nw.options.files.concat(['!./node_modules/'+dep+'/**']); | ||
} | ||
|
||
gulp.task('build', function () { | ||
nw.options.files = ['./src/**', '!./src/app/styl/**', | ||
'./node_modules/**', '!./node_modules/bower/**', | ||
'!./node_modules/*grunt*/**', '!./node_modules/stylus/**', | ||
'!./node_modules/nw-gyp/**', '!./node_modules/**/*.bin', | ||
'!./node_modules/**/*.c', '!./node_modules/**/*.h', | ||
'!./node_modules/**/Makefile', '!./node_modules/**/*.h', | ||
'!./**/test*/**', '!./**/doc*/**', '!./**/example*/**', | ||
'!./**/demo*/**', '!./**/bin/**', '!./**/build/**', '!./**/.*/**', | ||
'./package.json', './README.md', './CHANGELOG.md', './LICENSE.txt', | ||
'./.git.json' | ||
]; | ||
return nw.build().catch(function(error) { | ||
console.error(error); | ||
}); | ||
}); | ||
|
||
gulp.task('run', function () { | ||
gulp.task('run', function () { // run nwjs | ||
nw.options.files = './**'; | ||
return nw.run().catch(function(error) { | ||
console.error(error); | ||
}); | ||
}); | ||
|
||
gulp.task('css', function () { // compile styl | ||
return gulp.src('src/app/styl/*.styl') | ||
.pipe(stylus({ | ||
use: nib() | ||
})) | ||
.pipe(gulp.dest('src/app/themes/')); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters