Skip to content
Snippets Groups Projects
Unverified Commit 8ea48886 authored by Jack Reed's avatar Jack Reed Committed by GitHub
Browse files

Merge pull request #1502 from ProjectMirador/fix_packages

Fix packages
parents b61257d1 c6cbfc67
No related branches found
No related tags found
No related merge requests found
module.exports = function(grunt) { module.exports = function(grunt) {
// ---------- // ----------
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks("gruntify-eslint"); grunt.loadNpmTasks("gruntify-eslint");
...@@ -185,25 +184,6 @@ module.exports = function(grunt) { ...@@ -185,25 +184,6 @@ module.exports = function(grunt) {
} }
}, },
compress: {
zip: {
options: {
archive: 'build/mirador.zip'
},
files: [
{ expand: true, cwd: 'build/', src: ['mirador/**'] }
]
},
tar: {
options: {
archive: 'build/mirador.tar'
},
files: [
{ expand: true, cwd: 'build/', src: [ 'mirador/**' ] }
]
}
},
connect: { connect: {
server: { server: {
options: { options: {
...@@ -289,28 +269,18 @@ module.exports = function(grunt) { ...@@ -289,28 +269,18 @@ module.exports = function(grunt) {
}); });
// ---------- // ----------
// Lint task // Lint task
grunt.registerTask('lint', ['jshint', 'eslint']) grunt.registerTask('lint', ['jshint', 'eslint']);
// ---------- // ----------
// Build task. // Build task.
// Cleans out the build folder and builds the code and images into it, checking lint. // Cleans out the build folder and builds the code and images into it, checking lint.
grunt.registerTask('build', [ 'clean:build', 'git-describe', 'lint', 'less', 'concat:css', 'uglify', 'cssmin', 'copy']); grunt.registerTask('build', [ 'clean:build', 'git-describe', 'lint', 'less', 'concat', 'uglify', 'cssmin', 'copy']);
// ---------- // ----------
// Dev Build task. // Dev Build task.
// Build, but skip the time-consuming and obscurantist minification and uglification. // Build, but skip the time-consuming and obscurantist minification and uglification.
grunt.registerTask('dev_build', [ 'clean:build', 'git-describe', 'lint', 'less', 'concat', 'copy']); grunt.registerTask('dev_build', [ 'clean:build', 'git-describe', 'lint', 'less', 'concat', 'copy']);
// ----------
// Package task.
// Builds and creates the .zip and .tar files.
grunt.registerTask('package', ['build', 'compress']);
// ----------
// Publish task.
// Cleans the built files out of the release folder and copies newly built ones over.
grunt.registerTask('publish', ['package', 'clean:release', 'copy:release']);
// ---------- // ----------
// Default task. // Default task.
// Does a normal build. // Does a normal build.
......
# remove previous packages # remove previous packages
rm -rf build/mirador* rm -rf build dist
# build package # build package
node_modules/.bin/grunt package node_modules/.bin/grunt build
# mk tmp release dir # mk tmp release dir
mkdir -p build/tmp/build/mirador mkdir -p build/tmp/build/mirador
# unzip build # copy mirador build into tmp folder
unzip build/mirador.zip -d build/tmp/build cp -r build/mirador/* build/tmp/build/mirador
# add example # add example(s)
cp examples/example.html build/tmp/build cp examples/example.html build/tmp/build
cd build/tmp cd build/tmp
...@@ -22,4 +22,10 @@ mv build/build.zip ../ ...@@ -22,4 +22,10 @@ mv build/build.zip ../
tar -czvf build/build.tar.gz build/ tar -czvf build/build.tar.gz build/
mv build/build.tar.gz ../ mv build/build.tar.gz ../
cd - # remove temporary files
cd .. && rm -rf tmp
# make npm dist directory
cd ..
mkdir dist
cp -r build/mirador/* dist
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
rm -rf build/mirador* rm -rf build/mirador*
# build package # build package
node_modules/.bin/grunt package node_modules/.bin/grunt build
# mk tmp release dir # mk tmp release dir
mkdir build/tmp mkdir build/tmp
...@@ -27,6 +27,7 @@ cp -R build/tmp/mirador/themes demo ...@@ -27,6 +27,7 @@ cp -R build/tmp/mirador/themes demo
# Copy over files # Copy over files
cp build/tmp/mirador/mirador.min.js demo cp build/tmp/mirador/mirador.min.js demo
cp build/tmp/mirador/mirador.js demo
cp build/tmp/mirador/ZeroClipboard.swf demo cp build/tmp/mirador/ZeroClipboard.swf demo
# Clean up extra files # Clean up extra files
......
{ {
"name": "mirador", "name": "mirador",
"version": "2.5.1", "version": "2.6.1",
"description": "Multi-window image viewer, a web-based tool to support researcher goals", "description": "Multi-window image viewer, a web-based tool to support researcher goals",
"files": ["dist/*"],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/ProjectMirador/mirador" "url": "https://github.com/ProjectMirador/mirador"
...@@ -52,6 +53,7 @@ ...@@ -52,6 +53,7 @@
"test": "./node_modules/.bin/karma start ./karma.conf.js", "test": "./node_modules/.bin/karma start ./karma.conf.js",
"travis": "./node_modules/.bin/grunt ci --verbose --force & npm run test", "travis": "./node_modules/.bin/grunt ci --verbose --force & npm run test",
"update_demo": "./bin/update_demo.sh", "update_demo": "./bin/update_demo.sh",
"release": "./bin/create_release.sh",
"lint": "./node_modules/.bin/eslint js/src" "lint": "./node_modules/.bin/eslint js/src"
}, },
"dependencies": { "dependencies": {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment