File: Gruntfile.coffee

package info (click to toggle)
node-opentip 2.4.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 2,580 kB
  • sloc: makefile: 28
file content (98 lines) | stat: -rw-r--r-- 3,091 bytes parent folder | download | duplicates (2)
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
module.exports = (grunt) ->

  grunt.initConfig
    pkg: grunt.file.readJSON "package.json"


    stylus:
      options:
        compress: false
      default:
        files: [
          "css/opentip.css": "css/stylus/opentip.styl"
        ]

    coffee:
      default:
        expand: true
        options:
          bare: true
        cwd: "src/"
        src: [ "*.coffee" ]
        dest: "lib/"
        ext: ".js"

      test:
        files:
          "test/test.js": "test/src/*.coffee"

    watch:
      css:
        files: "css/stylus/*.styl"
        tasks: [ "css" ]
        options: nospawn: on
      js:
        files: "src/*.coffee"
        tasks: [ "js" ]
        options: nospawn: on
      test:
        files: [
          "test/src/*.coffee"
        ]
        tasks: [ "coffee:test" ]
        options: nospawn: on


    curl:
      ".tmp-excanvas.js": "https://raw.github.com/enyo/excanvas/master/index.js"
      ".tmp-classlist.js": "https://raw.github.com/eligrey/classList.js/master/classList.js"
      ".tmp-addeventlistener.js": "https://gist.github.com/raw/4684216/c58a272ef9d9e0f55ea5e90ac313e3a3b2f2b7b3/eventListener.polyfill.js"

    clean:
      tmp: ".tmp-*"

    concat:
      js:
        files:
          "downloads/opentip-jquery.js": [ "lib/opentip.js", "lib/adapter-jquery.js" ]
          "downloads/opentip-jquery-excanvas.js": [ "downloads/opentip-jquery.js", "/usr/share/javascript/excanvas/excanvas.js" ]

          "downloads/opentip-prototype.js": [ "lib/opentip.js", "lib/adapter-prototype.js" ]
          "downloads/opentip-prototype-excanvas.js": [ "downloads/opentip-prototype.js", "/usr/share/javascript/excanvas/excanvas.js" ]

          "downloads/opentip-native.js": [ "lib/opentip.js", "lib/adapter-native.js" ]
          "downloads/opentip-native-excanvas.js": [ "downloads/opentip-native.js", "/usr/share/javascript/excanvas/excanvas.js" ]


    uglify:
      options:
        banner: """
                // Opentip v2.4.6
                // Copyright (c) 2009-2012
                // www.opentip.org
                // MIT Licensed

                """
      js:
        files: [
          "downloads/opentip-jquery.min.js": "downloads/opentip-jquery.js"
          "downloads/opentip-jquery-excanvas.min.js": "downloads/opentip-jquery-excanvas.js"
          "downloads/opentip-prototype.min.js": "downloads/opentip-prototype.js"
          "downloads/opentip-prototype-excanvas.min.js": "downloads/opentip-prototype-excanvas.js"
          "downloads/opentip-native.min.js": "downloads/opentip-native.js"
          "downloads/opentip-native-excanvas.min.js": "downloads/opentip-native-excanvas.js"
        ]


  grunt.loadNpmTasks "grunt-contrib-coffee"
  grunt.loadNpmTasks "grunt-contrib-concat"
  grunt.loadNpmTasks "grunt-contrib-uglify"

  # Default tasks
  grunt.registerTask "default", [ "downloads" ]

  grunt.registerTask "css", "Compile the stylus files to css", [ "stylus" ]

  grunt.registerTask "js", "Compile coffeescript and create all download files", [ "coffee" ]

  grunt.registerTask "downloads", [ "js", "concat", "uglify" ]