bb198fc6c9c7a5ecf200e5001a82902bb3fbe44d
[Packages/TYPO3.CMS.git] / Build / Gruntfile.js
1 /*
2 * This file is part of the TYPO3 CMS project.
3 *
4 * It is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License, either version 2
6 * of the License, or any later version.
7 *
8 * For the full copyright and license information, please read the
9 * LICENSE.txt file that was distributed with this source code.
10 *
11 * The TYPO3 project - inspiring people to share!
12 */
13
14 module.exports = function(grunt) {
15
16 // Project configuration.
17 grunt.initConfig({
18 pkg: grunt.file.readJSON('package.json'),
19 paths: {
20 root : "../",
21 t3skin : "<%= paths.root %>typo3/sysext/t3skin/Resources/",
22 core : "<%= paths.root %>typo3/sysext/core/Resources/"
23 },
24 less: {
25 t3skin: {
26 options: {
27 outputSourceFiles: true
28 },
29 src : '<%= paths.t3skin %>Private/Styles/t3skin.less',
30 dest: '<%= paths.t3skin %>Public/Css/visual/t3skin.css'
31 }
32 },
33 watch: {
34 less: {
35 files: '<%= paths.t3skin %>Private/Styles/**/*.less',
36 tasks: 'less'
37 }
38 },
39 bowercopy: {
40 options: {
41 clean: false,
42 report: false,
43 runBower: false,
44 srcPrefix: "<%= paths.core %>Contrib/components/"
45 },
46 all: {
47 files: {
48 '<%= paths.core %>Public/JavaScript/Contrib/nprogress.js': '/nprogress/nprogress.js',
49 '<%= paths.core %>Public/JavaScript/Contrib/jquery.dataTables.js': '/datatables/media/js/jquery.dataTables.min.js',
50 '<%= paths.core %>Public/JavaScript/Contrib/requirejs/': '/requirejs/require.js',
51 '<%= paths.core %>Public/JavaScript/Contrib/moment/': '/moment/moment.js',
52 '<%= paths.core %>Public/JavaScript/Contrib/bootstrap-datetimepicker.js': '/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js',
53 /**
54 * copy needed files of scriptaculous
55 */
56 '<%= paths.core %>Public/JavaScript/Contrib/scriptaculous/builder.js': '/scriptaculous-bower/builder.js',
57 '<%= paths.core %>Public/JavaScript/Contrib/scriptaculous/controls.js': '/scriptaculous-bower/controls.js',
58 '<%= paths.core %>Public/JavaScript/Contrib/scriptaculous/dragdrop.js': '/scriptaculous-bower/dragdrop.js',
59 '<%= paths.core %>Public/JavaScript/Contrib/scriptaculous/effects.js': '/scriptaculous-bower/effects.js',
60 '<%= paths.core %>Public/JavaScript/Contrib/scriptaculous/scriptaculous.js': '/scriptaculous-bower/scriptaculous.js',
61 '<%= paths.core %>Public/JavaScript/Contrib/scriptaculous/slider.js': '/scriptaculous-bower/slider.js',
62 '<%= paths.core %>Public/JavaScript/Contrib/scriptaculous/sound.js': '/scriptaculous-bower/sound.js',
63 '<%= paths.core %>Public/JavaScript/Contrib/scriptaculous/unittest.js': '/scriptaculous-bower/unittest.js',
64 /**
65 * copy needed parts of jquery-ui
66 */
67 '<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/core.js': '/jquery-ui/ui/core.js',
68 '<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/draggable.js': '/jquery-ui/ui/draggable.js',
69 '<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/droppable.js': '/jquery-ui/ui/droppable.js',
70 '<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/mouse.js': '/jquery-ui/ui/mouse.js',
71 '<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/position.js': '/jquery-ui/ui/position.js',
72 '<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/resizable.js': '/jquery-ui/ui/resizable.js',
73 '<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/selectable.js': '/jquery-ui/ui/selectable.js',
74 '<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/sortable.js': '/jquery-ui/ui/sortable.js',
75 '<%= paths.core %>Public/JavaScript/Contrib/jquery-ui/widget.js': '/jquery-ui/ui/widget.js'
76 }
77 }
78 }
79 });
80
81 // Register tasks
82 grunt.loadNpmTasks('grunt-contrib-less');
83 grunt.loadNpmTasks('grunt-contrib-watch');
84 grunt.loadNpmTasks('grunt-bowercopy');
85 grunt.loadNpmTasks('grunt-npm-install');
86 grunt.loadNpmTasks('grunt-bower-just-install');
87
88 /**
89 * grunt default task
90 *
91 * call "$ grunt"
92 *
93 * this will trigger the less build
94 */
95 grunt.registerTask('default', ['less']);
96
97 /**
98 * grunt update task
99 *
100 * call "$ grunt update"
101 *
102 * this task does the following things:
103 * - npn install
104 * - bower install
105 * - copy some bower components to a specific destinations because they need to be included via PHP
106 */
107 grunt.registerTask('update', ['npm-install', 'bower_install', 'bowercopy']);
108 };