Home page Forum Wiki Mail Jabber Devel NIX-FILES

AltLUG Git

Git-repositories of Altai Linux User Group

Add build-git task for CDN deployment
[qunit.git] / grunt.js
1 /*global config:true, task:true*/
2 module.exports = function( grunt ) {
3
4 grunt.loadNpmTasks( "grunt-git-authors" );
5
6 grunt.initConfig({
7         pkg: '<json:package.json>',
8         qunit: {
9                 // TODO include 'test/logs.html' as well
10                 qunit: 'test/index.html',
11                 addons: [
12                         'addons/canvas/canvas.html',
13                         'addons/close-enough/close-enough.html',
14                         'addons/composite/composite-demo-test.html'
15                 ]
16         },
17         lint: {
18                 qunit: 'qunit/qunit.js',
19                 // addons: 'addons/**/*.js',
20                 grunt: 'grunt.js'
21                 // TODO need to figure out which warnings to fix and which to disable
22                 // tests: 'test/test.js'
23         },
24         jshint: {
25                 qunit: {
26                         options: {
27                                 onevar: true,
28                                 browser: true,
29                                 bitwise: true,
30                                 curly: true,
31                                 trailing: true,
32                                 immed: true,
33                                 latedef: false,
34                                 newcap: true,
35                                 noarg: false,
36                                 noempty: true,
37                                 nonew: true,
38                                 sub: true,
39                                 undef: true,
40                                 eqnull: true,
41                                 proto: true,
42                                 smarttabs: true
43                         },
44                         globals: {
45                                 jQuery: true,
46                                 exports: true
47                         }
48                 },
49                 addons: {
50                         options: {
51                                 browser: true,
52                                 curly: true,
53                                 eqnull: true,
54                                 eqeqeq: true,
55                                 expr: true,
56                                 evil: true,
57                                 jquery: true,
58                                 latedef: true,
59                                 noarg: true,
60                                 onevar: true,
61                                 smarttabs: true,
62                                 trailing: true,
63                                 undef: true
64                         },
65                         globals: {
66                                 module: true,
67                                 test: true,
68                                 asyncTest: true,
69                                 expect: true,
70                                 start: true,
71                                 stop: true,
72                                 QUnit: true
73                         }
74                 },
75                 tests: {
76                 }
77         }
78 });
79
80 grunt.registerTask( "build-git", function( sha ) {
81         function processor( content ) {
82                 var tagline = " - A JavaScript Unit Testing Framework";
83                 return content.replace( tagline, "-" + sha + " " + grunt.template.today('isoDate') + tagline );
84         }
85         grunt.file.copy( "qunit/qunit.css", "dist/qunit-git.css", {
86                 process: processor
87         });
88         grunt.file.copy( "qunit/qunit.js", "dist/qunit-git.js", {
89                 process: processor
90         });
91 });
92
93 grunt.registerTask( "testswarm", function( commit, configFile ) {
94         var testswarm = require( "testswarm" ),
95                 config = grunt.file.readJSON( configFile ).qunit;
96         testswarm({
97                 url: config.swarmUrl,
98                 pollInterval: 10000,
99                 timeout: 1000 * 60 * 30,
100                 done: this.async()
101         }, {
102                 authUsername: "qunit",
103                 authToken: config.authToken,
104                 jobName: 'QUnit commit #<a href="https://github.com/jquery/qunit/commit/' + commit + '">' + commit.substr( 0, 10 ) + '</a>',
105                 runMax: config.runMax,
106                 "runNames[]": "QUnit",
107                 "runUrls[]": config.testUrl + commit + "/test/index.html",
108                 "browserSets[]": ["popular"]
109         });
110 });
111
112 grunt.registerTask('default', 'lint qunit');
113
114 };

Hosting is provided AltSPAHow to use Git
Please direct any questions on jabber alex.wolf@jabber.ru

Valid HTML 4.0 Transitional Valid CSS!

Designer Alexander Wolf