|
1 | 1 | module.exports = function(grunt) {
|
2 | 2 |
|
3 |
| - "use strict"; |
| 3 | + "use strict"; |
4 | 4 |
|
5 |
| - grunt.initConfig({ |
| 5 | + grunt.initConfig({ |
| 6 | + |
| 7 | + libFiles: [ |
| 8 | + "src/**/*.purs", |
| 9 | + "bower_components/purescript-*/src/**/*.purs*" |
| 10 | + ], |
| 11 | + |
| 12 | + clean: ["output", "tmp"], |
6 | 13 |
|
7 |
| - clean: ["externs", "js"], |
8 |
| - |
9 |
| - "purescript-make": { |
10 |
| - options: { |
11 |
| - tco: true, |
12 |
| - magicDo: true |
13 |
| - }, |
14 |
| - lib: { |
15 |
| - options: { make: true }, |
16 |
| - files: { _: ["src/**/*.purs", "bower_components/purescript-*/src/**/*.purs"] } |
17 |
| - } |
18 |
| - }, |
19 |
| - |
20 |
| - purescript: { |
21 |
| - options: { |
22 |
| - main: true |
23 |
| - }, |
24 |
| - exampleReader: { |
25 |
| - files: { |
26 |
| - "js/_examples/Reader.js": ["examples/Reader.purs", "src/**/*.purs", "bower_components/purescript-*/src/**/*.purs"] |
27 |
| - } |
28 |
| - }, |
29 |
| - exampleState: { |
30 |
| - files: { |
31 |
| - "js/_examples/State.js": ["examples/State.purs", "src/**/*.purs", "bower_components/purescript-*/src/**/*.purs"] |
32 |
| - } |
33 |
| - }, |
34 |
| - exampleWriter: { |
35 |
| - files: { |
36 |
| - "js/_examples/Writer.js": ["examples/Writer.purs", "src/**/*.purs", "bower_components/purescript-*/src/**/*.purs"] |
37 |
| - } |
38 |
| - }, |
39 |
| - exampleCont: { |
40 |
| - files: { |
41 |
| - "js/_examples/Cont.js": ["examples/Cont.purs", "src/**/*.purs", "bower_components/purescript-*/src/**/*.purs"] |
42 |
| - } |
43 |
| - } |
| 14 | + pscMake: ["<%=libFiles%>"], |
| 15 | + dotPsci: ["<%=libFiles%>"], |
| 16 | + docgen: { |
| 17 | + readme: { |
| 18 | + src: "src/**/*.purs", |
| 19 | + dest: "README.md" |
44 | 20 | }
|
45 |
| - |
46 |
| - }); |
| 21 | + }, |
| 22 | + |
| 23 | + psc: { |
| 24 | + options: { |
| 25 | + main: true |
| 26 | + }, |
| 27 | + exampleReader: { |
| 28 | + src: ["examples/Reader.purs", "<%=libFiles%>"], |
| 29 | + dest: "tmp/Reader.js" |
| 30 | + }, |
| 31 | + exampleState: { |
| 32 | + src: ["examples/State.purs", "<%=libFiles%>"], |
| 33 | + dest: "tmp/State.js" |
| 34 | + }, |
| 35 | + exampleWriter: { |
| 36 | + src: ["examples/Writer.purs", "<%=libFiles%>"], |
| 37 | + dest: "tmp/Writer.js" |
| 38 | + }, |
| 39 | + exampleCont: { |
| 40 | + src: ["examples/Cont.purs", "<%=libFiles%>"], |
| 41 | + dest: "tmp/Cont.js" |
| 42 | + } |
| 43 | + }, |
| 44 | + |
| 45 | + execute: { |
| 46 | + exampleReader: { |
| 47 | + src: "tmp/Reader.js" |
| 48 | + }, |
| 49 | + exampleState: { |
| 50 | + src: "tmp/State.js" |
| 51 | + }, |
| 52 | + exampleWriter: { |
| 53 | + src: "tmp/Writer.js" |
| 54 | + }, |
| 55 | + exampleCont: { |
| 56 | + src: "tmp/Cont.js" |
| 57 | + } |
| 58 | + } |
| 59 | + |
| 60 | + }); |
47 | 61 |
|
48 |
| - grunt.loadNpmTasks("grunt-purescript"); |
49 |
| - grunt.loadNpmTasks("grunt-contrib-clean"); |
| 62 | + grunt.loadNpmTasks("grunt-purescript"); |
| 63 | + grunt.loadNpmTasks("grunt-execute"); |
| 64 | + grunt.loadNpmTasks("grunt-contrib-clean"); |
50 | 65 |
|
51 |
| - grunt.registerTask("default", ["purescript-make:lib"]); |
| 66 | + grunt.registerTask("exampleReader", ["psc:exampleReader", "execute:exampleReader"]); |
| 67 | + grunt.registerTask("exampleState", ["psc:exampleState", "execute:exampleState"]); |
| 68 | + grunt.registerTask("exampleWriter", ["psc:exampleWriter", "execute:exampleWriter"]); |
| 69 | + grunt.registerTask("exampleCont", ["psc:exampleCont", "execute:exampleCont"]); |
| 70 | + grunt.registerTask("examples", ["psc", "execute"]); |
| 71 | + grunt.registerTask("make", ["pscMake", "dotPsci", "docgen"]); |
| 72 | + grunt.registerTask("default", ["make"]); |
52 | 73 | };
|
0 commit comments