fix(build): run and build for desktop

This commit is contained in:
Ayushman Chhabra 2022-06-04 23:16:58 -04:00
parent 0706b86e2f
commit b1a5f6c17f
2 changed files with 17 additions and 31 deletions

View File

@ -219,6 +219,7 @@ module.exports = function(grunt) {
{src: ['dest/tmp/index.html'], dest: 'dest/prod/index.html'}, {src: ['dest/tmp/index.html'], dest: 'dest/prod/index.html'},
{src: ['src/logo.png'], dest: 'dest/prod/logo.png'}, {src: ['src/logo.png'], dest: 'dest/prod/logo.png'},
{src: ['src/js/lib/gif/gif.ie.worker.js'], dest: 'dest/prod/js/lib/gif/gif.ie.worker.js'}, {src: ['src/js/lib/gif/gif.ie.worker.js'], dest: 'dest/prod/js/lib/gif/gif.ie.worker.js'},
{src: ['./package.json'], dest: 'dest/prod/package.json'},
{expand: true, src: ['img/**'], cwd: 'src/', dest: 'dest/prod/', filter: 'isFile'}, {expand: true, src: ['img/**'], cwd: 'src/', dest: 'dest/prod/', filter: 'isFile'},
{expand: true, src: ['css/fonts/**'], cwd: 'src/', dest: 'dest/prod/', filter: 'isFile'} {expand: true, src: ['css/fonts/**'], cwd: 'src/', dest: 'dest/prod/', filter: 'isFile'}
] ]
@ -270,38 +271,24 @@ module.exports = function(grunt) {
*/ */
nwjs: { nwjs: {
windows : { run : {
options: { options: {
downloadUrl: 'https://dl.nwjs.io/', version : "0.65.0",
version : "0.49.1", buildDir: './dest/desktop/', // destination folder of releases.
build_dir: './dest/desktop/', // destination folder of releases.
win: true,
linux32: true,
linux64: true,
flavor: "normal", flavor: "normal",
mode: "run",
files: './dest/prod/**/*',
}, },
src: ['./dest/prod/**/*', "./package.json", "!./dest/desktop/"]
}, },
macos : { build : {
options: { options: {
downloadUrl: 'https://dl.nwjs.io/', version : "0.65.0",
osx64: true, buildDir: './dest/desktop/', // destination folder of releases.
version : "0.63.1",
build_dir: './dest/desktop/',
flavor: "normal", flavor: "normal",
platforms: ['linux', 'osx', 'win'],
files: './dest/prod/**/*',
}, },
src: ['./dest/prod/**/*', "./package.json", "!./dest/desktop/"]
}, },
macos_old : {
options: {
downloadUrl: 'https://dl.nwjs.io/',
osx64: true,
version : "0.12.3",
build_dir: './dest/desktop/old',
flavor: "normal",
},
src: ['./dest/prod/**/*', "./package.json", "!./dest/desktop/"]
}
} }
}); });
@ -328,9 +315,8 @@ module.exports = function(grunt) {
grunt.registerTask('merge-statics', ['concat:js', 'concat:css', 'uglify']); grunt.registerTask('merge-statics', ['concat:js', 'concat:css', 'uglify']);
grunt.registerTask('build', ['clean:prod', 'sprite', 'merge-statics', 'build-index.html', 'replace:mainPartial', 'replace:css', 'copy:prod']); grunt.registerTask('build', ['clean:prod', 'sprite', 'merge-statics', 'build-index.html', 'replace:mainPartial', 'replace:css', 'copy:prod']);
grunt.registerTask('build-dev', ['clean:dev', 'sprite', 'build-index.html', 'copy:dev']); grunt.registerTask('build-dev', ['clean:dev', 'sprite', 'build-index.html', 'copy:dev']);
grunt.registerTask('desktop-win', ['clean:desktop', 'default', 'nwjs:windows']); grunt.registerTask('desktop-run', ['clean:desktop', 'default', 'nwjs:run']);
grunt.registerTask('desktop-mac', ['clean:desktop', 'default', 'nwjs:macos']); grunt.registerTask('desktop-build', ['clean:desktop', 'default', 'nwjs:build']);
grunt.registerTask('desktop-mac-old', ['clean:desktop', 'default', 'replace:desktop', 'nwjs:macos_old']);
// SERVER TASKS // SERVER TASKS
// Start webserver and watch for changes // Start webserver and watch for changes

View File

@ -20,7 +20,7 @@
"piskel-root": "./misc/scripts/piskel-root", "piskel-root": "./misc/scripts/piskel-root",
"piskel-cli": "./cli/index.js" "piskel-cli": "./cli/index.js"
}, },
"main": "./dest/prod/index.html", "main": "./index.html",
"scripts": { "scripts": {
"test": "grunt test", "test": "grunt test",
"dev": "grunt play", "dev": "grunt play",
@ -28,8 +28,8 @@
"preversion": "grunt test build", "preversion": "grunt test build",
"postversion": "git push && git push --tags && npm publish", "postversion": "git push && git push --tags && npm publish",
"release": "grunt && node ./bin/copy-to-piskel-website", "release": "grunt && node ./bin/copy-to-piskel-website",
"build:win": "grunt desktop-win", "desktop:run": "grunt desktop-run",
"build:mac": "grunt desktop-mac", "desktop:build": "grunt desktop-build",
"format": "grunt eslint --fix" "format": "grunt eslint --fix"
}, },
"devDependencies": { "devDependencies": {
@ -51,7 +51,7 @@
"grunt-jscs": "3.0.1", "grunt-jscs": "3.0.1",
"grunt-karma": "4.0.2", "grunt-karma": "4.0.2",
"grunt-leading-indent": "0.2.0", "grunt-leading-indent": "0.2.0",
"grunt-nw-builder": "3.7.3", "grunt-nw-builder": "3.7.3-beta.1",
"grunt-replace": "2.0.2", "grunt-replace": "2.0.2",
"grunt-spritesmith": "6.10.0", "grunt-spritesmith": "6.10.0",
"jasmine-core": "4.1.1", "jasmine-core": "4.1.1",