summaryrefslogtreecommitdiffstats
path: root/apps/comments/js/vendor/Caret.js/Gruntfile.coffee
blob: a645110b59bf680cc22ffa47112677893b4c38c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
module.exports = (grunt) ->
  grunt.initConfig
    pkg: grunt.file.readJSON 'package.json'
    bower_path: 'bower_components'

    jasmine:
      src: 'src/*.js'
      options:
        vendor: [
          '<%= bower_path %>/jquery/dist/jquery.min.js',
          '<%= bower_path %>/jasmine-jquery/lib/jasmine-jquery.js'
          ]
        specs: 'spec/javascripts/*.js'
        # keepRunner: true

    uglify:
      options:
        banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      build:
        files:
          'dist/<%= pkg.name %>.min.js': ['src/<%= pkg.name %>.js']

    coffee:
      withMaps:
        options:
          bare: true
          sourceMap: true
        files:
          'src/<%= pkg.name %>.js': 'src/<%= pkg.name %>.coffee'
      withoutMaps:
        options:
          bare: true
          sourceMap: false
        files:
          'dist/<%= pkg.name %>.js': 'src/<%= pkg.name %>.coffee'

    watch:
      scripts:
        files: ['src/*.coffee']
        tasks: ['coffee', 'umd']

    umd:
      options:
        template: 'umd'
        deps:
          'default': ['$']
          amd: ['jquery']
          cjs: ['jquery']
          global:
            items: ['jQuery']
            prefix: ''
      src:
        src: 'src/<%= pkg.name %>.js'
      dist:
        src: 'dist/<%= pkg.name %>.js'


    'json-replace':
      options:
        space: "  ",
        replace:
          version: "<%= pkg.version %>"
      'update-version':
        files:[{
          'bower.json': 'bower.json',
          'component.json': 'component.json'
        }]

  grunt.loadNpmTasks 'grunt-contrib-coffee'
  grunt.loadNpmTasks 'grunt-contrib-uglify'
  grunt.loadNpmTasks 'grunt-contrib-jasmine'
  grunt.loadNpmTasks 'grunt-json-replace'
  grunt.loadNpmTasks 'grunt-contrib-watch'
  grunt.loadNpmTasks 'grunt-umd'

  grunt.registerTask 'update-version', 'json-replace'

  grunt.registerTask 'default', ['coffee', 'umd', 'jasmine','update-version', 'uglify', 'watch']
  grunt.registerTask 'test', ['coffee', 'umd', 'jasmine']