jenny
11 years ago
2 changed files with 0 additions and 115 deletions
@ -1,103 +0,0 @@
|
||||
'use strict'; |
||||
|
||||
// Variables
|
||||
var path = require('path'); |
||||
|
||||
module.exports = function(grunt) { |
||||
|
||||
// Project configuration
|
||||
grunt.initConfig({ |
||||
pkg: grunt.file.readJSON('package.json'), |
||||
|
||||
// timeline configuration
|
||||
timeline: { |
||||
compiled: 'compiled', |
||||
website: '../timeline.knightlab.com' |
||||
}, |
||||
|
||||
// cdn configuation
|
||||
cdn: { |
||||
repo: '../cdn.knightlab.com', |
||||
path: path.join('..', 'cdn.knightlab.com', 'apps', 'libs', 'timeline') |
||||
}, |
||||
|
||||
// Banner for the top of CSS and JS files
|
||||
// Note: The existing Timeline repo has its own banner, so we'll ignore this for now
|
||||
banner: '/* <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' + |
||||
' * <%= pkg.homepage %>\n' + |
||||
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;\n' + |
||||
' */\n', |
||||
|
||||
// Clean
|
||||
clean: { |
||||
stg: { |
||||
options: { force: true }, |
||||
src: path.join('<%= cdn.path %>', '<%= pkg.version %>') |
||||
}, |
||||
stgLatest: { |
||||
options: { force: true }, |
||||
src: path.join('<%= cdn.path %>', 'latest') |
||||
} |
||||
}, |
||||
|
||||
// Copy
|
||||
copy: { |
||||
website: { |
||||
files: [ |
||||
// Styles/Themes
|
||||
{ expand: true, cwd: '<%= timeline.compiled %>/css', src: ['*.css', 'themes/**'], dest: '<%= timeline.website %>/static/css'},
|
||||
// Scripts
|
||||
{ expand: true, cwd: '<%= timeline.compiled %>/js', src: ['**/*.js'], dest: '<%= timeline.website %>/static/js'}, |
||||
// Images
|
||||
{ expand: true, cwd: '<%= timeline.compiled %>/css', src: ['*.{png,gif,jpg}'], dest: '<%= timeline.website %>/static/img'} |
||||
] |
||||
}, |
||||
stg: { |
||||
files: [ |
||||
{
|
||||
expand: true,
|
||||
cwd: '<%= timeline.compiled %>',
|
||||
src: ['css/**', 'js/**', 'lib/**'],
|
||||
dest: path.join('<%= cdn.path %>', '<%= pkg.version %>') |
||||
} |
||||
] |
||||
}, |
||||
stgLatest: { |
||||
files: [ |
||||
{
|
||||
expand: true,
|
||||
cwd: '<%= timeline.compiled %>',
|
||||
src: ['css/**', 'js/**', 'lib/**'],
|
||||
dest: path.join('<%= cdn.path %>', '<%= latest %>') |
||||
} |
||||
] |
||||
} |
||||
} |
||||
}); |
||||
|
||||
// Load all Grunt tasks
|
||||
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); |
||||
|
||||
// Task aliases
|
||||
grunt.registerTask('check-for-website', 'Check for the website repository', function() { |
||||
// Make sure CDN repo exists
|
||||
if(!grunt.file.exists(grunt.config.get('timeline.website'))) { |
||||
grunt.fatal('Could not find local website repository.') |
||||
} |
||||
}); |
||||
grunt.registerTask('check-for-cdn', 'Check for the cdn.knightlab.com repository', function() { |
||||
// Make sure CDN repo exists
|
||||
if(!grunt.file.exists(grunt.config.get('cdn.repo'))) { |
||||
grunt.fatal('Could not find local cdn repository.') |
||||
} |
||||
}); |
||||
|
||||
// Define complex tasks
|
||||
grunt.registerTask('website', "Copy select files to the timeline.knightlab.com website repository",
|
||||
['check-for-website', 'copy:website']); |
||||
grunt.registerTask('stage', "Stage the release for deployment to the CDN",
|
||||
['check-for-cdn', 'clean:stg', 'copy:stg']); |
||||
grunt.registerTask('stage-latest', "Stage the release for deployment to the CDN, and copy it to the latest directory",
|
||||
['stage', 'clean:stgLatest', 'copy:stgLatest']); |
||||
|
||||
}; |
@ -1,12 +0,0 @@
|
||||
{ |
||||
"name": "TimelineJS", |
||||
"version": "2.22.0", |
||||
"author": "Zach Wise", |
||||
"homepage": "https://github.com/NUKnightLab/TimelineJS", |
||||
"devDependencies": { |
||||
"grunt": "~0.4.1", |
||||
"grunt-contrib-clean": "0.4.0", |
||||
"grunt-contrib-copy": "~0.4.0", |
||||
"matchdep": "~0.1.1" |
||||
} |
||||
} |
Loading…
Reference in new issue