Use grunt-cson for compilation

This commit is contained in:
Kevin Sawicki
2013-06-15 22:09:38 -07:00
parent f3b3c291b9
commit 91f18df917
2 changed files with 4 additions and 17 deletions

View File

@@ -2,7 +2,6 @@
fs = require 'fs'
path = require 'path'
_ = require 'underscore'
CSON = require 'season'
BUILD_DIR = '/tmp/atom-build/atom-shell'
APP_NAME = 'Atom.app'
@@ -94,6 +93,8 @@ module.exports = (grunt) ->
ext: '.css'
cson:
options:
rootObject: true
glob_to_multiple:
expand: true
src: [
@@ -154,26 +155,11 @@ module.exports = (grunt) ->
grunt.loadNpmTasks('grunt-coffeelint')
grunt.loadNpmTasks('grunt-lesslint')
grunt.loadNpmTasks('grunt-cson')
grunt.loadNpmTasks('grunt-contrib-csslint')
grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-contrib-less')
grunt.registerMultiTask 'cson', 'Compile CSON files to JSON', ->
for mapping in @files
source = mapping.src[0]
destination = mapping.dest
try
object = CSON.readFileSync(source)
if !_.isObject(object) or _.isArray(object)
grunt.log.error("#{source} does not contain a root object")
return false
mkdir path.dirname(destination)
CSON.writeFileSync(destination, object)
grunt.log.writeln("File #{destination.cyan} created.")
catch e
grunt.log.error("Parsing #{source} failed: #{e.message}")
return false
grunt.registerTask 'postbuild', 'Run postbuild scripts', ->
done = @async()

View File

@@ -72,6 +72,7 @@
"grunt-cli": "~0.1.9",
"grunt-coffeelint": "0.0.6",
"grunt-lesslint": "0.4.0",
"grunt-cson": "0.2.0",
"grunt-contrib-csslint": "~0.1.2",
"grunt-contrib-coffee": "~0.7.0",
"grunt-contrib-less": "~0.5.2"