client/gruntfile.js
author ymh <ymh.work@gmail.com>
Fri, 19 Jun 2015 15:02:15 +0200
changeset 490 8b05c7322e93
parent 480 a5da9a586297
child 497 3ba7920facf4
permissions -rw-r--r--
correct grunt file for dist version
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
295
bcac9ea07d04 add simple-persist in grunt connect
ymh <ymh.work@gmail.com>
parents: 294
diff changeset
     1
var simplePersist = require('./data/simple-persist');
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
module.exports = function(grunt) {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
  'use strict';
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
  var renkan_src = [
425
823e8f1d26f7 generate template before laoding the main
rougeronj
parents: 423
diff changeset
     8
      'dist/js/templates.js',
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
      'js/main.js',
476
7e9495eb3cb0 add router file to the list of file to concatenate during building
rougeronj
parents: 444
diff changeset
    10
      'js/router.js',
444
19f0b7803aed add schema version + dataloaders to ensure data migrations + small correction for php server exmple + a readme for the php server example
ymh <ymh.work@gmail.com>
parents: 442
diff changeset
    11
      'js/dataloader.js',
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
      'js/models.js',
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
      'js/defaults.js',
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
      'js/i18n.js',
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
      'js/full-json.js',
320
154b121a43f1 enhance save on click (snapshot mode) and update django app
cavaliet
parents: 297
diff changeset
    16
      'js/save-once.js',
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
      'js/ldtjson-bin.js',
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
      'js/list-bin.js',
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
      'js/wikipedia-bin.js',
423
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
    20
      'dist/js/paper-renderer.js',
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
  ];
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
  var renkan_banner = grunt.file.read('js/header.js').toString() +
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
      '\n/*! <%= pkg.name %> - v<%= pkg.version %> - Copyright © IRI ' +
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
      '<%= grunt.template.today("yyyy") %> */\n\n';
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
  // Project configuration.
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
  grunt.initConfig({
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
    pkg: grunt.file.readJSON('package.json'),
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
    requirejs: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
      renderer: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
        options: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
          baseUrl: "js/",
294
d9247696a257 rename build-renderer in main-renderer
ymh <ymh.work@gmail.com>
parents: 293
diff changeset
    34
          name: "main-renderer",
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
          out: "dist/js/paper-renderer.js",
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
          optimize: "none",
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
          beautify: true,
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
          paths: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
            requtils: "require-utils",
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
            jquery: "empty:",
297
7de2652f7ee8 SaveAs project client side
ymh <ymh.work@gmail.com>
parents: 295
diff changeset
    41
            underscore: "empty:",
468
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
    42
            filesaver: "empty:",
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
    43
            'ckeditor-core': "empty:",
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
    44
            'ckeditor-jquery': "empty:"
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
          }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
        }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
      }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    48
    },
416
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
    49
    jst: {
468
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
    50
        compile: {
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
    51
            options: {
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
    52
                namespace: 'renkanJST',
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
    53
                //amd: true
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
    54
            },
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
    55
            files: {
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
    56
                "dist/js/templates.js": ["templates/**/*.html"]
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
    57
            }
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
    58
        }
416
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
    59
    },
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
    uglify: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
      options: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
        banner: renkan_banner,
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
        sourceMap: true,
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
        sourceMapIncludeSources: true
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
      },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
      renkan: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
        files : {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
          'dist/js/renkan.min.js' : renkan_src
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
        }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
      }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
    },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
    concat: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
      options: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
        banner: renkan_banner
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
      },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    76
      renkan: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    77
        files : {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    78
          'dist/js/renkan.js' : renkan_src
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
        }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    80
      }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
    },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    82
    clean: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
      options: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    84
        force: true
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    85
      },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    86
      renderer: ["dist/js/paper-renderer.js"],
416
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
    87
      jst:["dist/js/templates.js"],
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    88
      renkan: ["dist/"],
345
cb5c0007c9f9 continue bower integration
ymh <ymh.work@gmail.com>
parents: 344
diff changeset
    89
      lib: ["lib/"],
468
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
    90
      bower: ["bower_components/"]
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    91
    },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    92
    cssmin: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    93
      options: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    94
        banner: renkan_banner
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    95
      },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    96
      renkan: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    97
        expand: true,
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    98
        cwd: 'css/',
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    99
        src: ['*.css'],
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   100
        dest: 'dist/css',
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
        ext: '.min.css'
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   102
      }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   103
    },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   104
    copy: {
468
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   105
      vendors: {
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   106
          files: [{expand: true, cwd: 'vendors/', src: ['**'], dest: 'lib/'}],
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   107
      },
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   108
      renkan: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   109
        files: [
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   110
          {expand: true, cwd: '', src: ['img/*'], dest: 'dist/', filter: 'isFile'},
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   111
          {expand: true, cwd: '', src: ['data/properties.json'], dest: 'dist/', filter: 'isFile'},
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   112
          {expand: true, cwd: '', src: ['lib/**'], dest: 'dist/'}
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   113
         ]
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   114
       },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   115
       renkan_css: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   116
         options: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   117
           process: function (content, srcpath) {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   118
             return grunt.template.process(renkan_banner) + content;
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   119
           }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   120
         },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   121
         files: [{expand: true, cwd: '', src: ['css/*'], dest: 'dist/', filter: 'isFile'}]
342
2306317213a1 publish a new version of renkan in django server part and add a grunt target to do it
ymh <ymh.work@gmail.com>
parents: 320
diff changeset
   122
       },
2306317213a1 publish a new version of renkan in django server part and add a grunt target to do it
ymh <ymh.work@gmail.com>
parents: 320
diff changeset
   123
       renkan_server: {
347
7a5905153e66 extend copy-server task in grunt to copy lib folder to the right directory on the server
rougeronj
parents: 345
diff changeset
   124
         files: [
442
adb907bba956 add server php example
ymh <ymh.work@gmail.com>
parents: 425
diff changeset
   125
           {expand: true, cwd: 'dist', src: ['**', '!data/*', '!lib/**'], dest: '../server/python/django/renkanmanager/static/renkanmanager/lib/renkan/', filter: 'isFile'},
adb907bba956 add server php example
ymh <ymh.work@gmail.com>
parents: 425
diff changeset
   126
           {expand: true, cwd: 'dist/lib', src: ['**'], dest: '../server/python/django/renkanmanager/static/renkanmanager/lib/', filter: 'isFile'},
adb907bba956 add server php example
ymh <ymh.work@gmail.com>
parents: 425
diff changeset
   127
           {expand: true, cwd: 'dist', src: ['**', '!data/*', '!lib/**'], dest: '../server/php/basic/public_html/static/lib/renkan/', filter: 'isFile'},
adb907bba956 add server php example
ymh <ymh.work@gmail.com>
parents: 425
diff changeset
   128
           {expand: true, cwd: 'dist/lib', src: ['**'], dest: '../server/php/basic/public_html/static/lib/', filter: 'isFile'}
347
7a5905153e66 extend copy-server task in grunt to copy lib folder to the right directory on the server
rougeronj
parents: 345
diff changeset
   129
         ]
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   130
       }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   131
    },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   132
    jshint: {
293
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   133
      options: {
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   134
        curly: true,
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   135
        eqeqeq: true,
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   136
        eqnull: true,
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   137
        browser: true,
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   138
        globals: {
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   139
          jQuery: true
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   140
        },
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   141
      },
295
bcac9ea07d04 add simple-persist in grunt connect
ymh <ymh.work@gmail.com>
parents: 294
diff changeset
   142
      all: ['Gruntfile.js', 'js/**/*.js', 'data/simple-persist.js']
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   143
    },
344
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   144
    bower: {
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   145
        install: {
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   146
            options: {
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   147
                targetDir: './lib',
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   148
                layout: 'byComponent',
345
cb5c0007c9f9 continue bower integration
ymh <ymh.work@gmail.com>
parents: 344
diff changeset
   149
                install: true,
344
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   150
                verbose: false,
468
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   151
                cleanTargetDir: true,
344
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   152
                cleanBowerDir: false,
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   153
                bowerOptions: {}
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   154
            }
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   155
        }
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   156
    },
423
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   157
    watch: {
468
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   158
        css:{
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   159
            files: ['css/**/*.css'],
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   160
            tasks: ['cssmin', 'copy:renkan_css'],
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   161
        },
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   162
        js:{
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   163
            files: ['js/**/*.js', 'templates/**/*.html'],
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   164
            tasks: ['jshint', 'requirejs', 'jst', 'concat', 'uglify', 'copy:renkan', 'clean:renderer'],
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   165
        },
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   166
        lib:{
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   167
            files: ['bower.json'],
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   168
            tasks: ['bower:install', 'copy:vendors', 'copy:renkan'],
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   169
        },
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   170
        vendors: {
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   171
            files: ['vendors/**'],
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   172
            tasks: ['copy:vendors', 'copy:renkan'],
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   173
        },
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   174
        options: {
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   175
            interrupt: true,
364c367df7fc add rich text editor for description
ymh <ymh.work@gmail.com>
parents: 444
diff changeset
   176
        },
423
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   177
    },
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   178
    connect: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   179
        server: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   180
          options: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   181
            port: 9001,
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   182
            base: '.',
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   183
            useAvailablePort: true,
295
bcac9ea07d04 add simple-persist in grunt connect
ymh <ymh.work@gmail.com>
parents: 294
diff changeset
   184
            debug: true,
bcac9ea07d04 add simple-persist in grunt connect
ymh <ymh.work@gmail.com>
parents: 294
diff changeset
   185
            middleware: function(connect, options, middlewares) {
bcac9ea07d04 add simple-persist in grunt connect
ymh <ymh.work@gmail.com>
parents: 294
diff changeset
   186
              middlewares.push(simplePersist.middleware);
bcac9ea07d04 add simple-persist in grunt connect
ymh <ymh.work@gmail.com>
parents: 294
diff changeset
   187
              return middlewares;
bcac9ea07d04 add simple-persist in grunt connect
ymh <ymh.work@gmail.com>
parents: 294
diff changeset
   188
            }
bcac9ea07d04 add simple-persist in grunt connect
ymh <ymh.work@gmail.com>
parents: 294
diff changeset
   189
          },
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   190
        }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   191
    }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   192
  });
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   193
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   194
  // Load the plugin that provides the "uglify" task.
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   195
  grunt.loadNpmTasks('grunt-contrib-requirejs');
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   196
  grunt.loadNpmTasks('grunt-contrib-uglify');
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   197
  grunt.loadNpmTasks('grunt-contrib-concat');
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   198
  grunt.loadNpmTasks('grunt-contrib-clean');
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   199
  grunt.loadNpmTasks('grunt-contrib-cssmin');
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   200
  grunt.loadNpmTasks('grunt-contrib-copy');
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   201
  grunt.loadNpmTasks('grunt-contrib-jshint');
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   202
  grunt.loadNpmTasks('grunt-contrib-connect');
344
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   203
  grunt.loadNpmTasks('grunt-bower-task');
416
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
   204
  grunt.loadNpmTasks('grunt-contrib-jst');
423
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   205
  grunt.loadNpmTasks('grunt-contrib-watch');
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   206
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   207
  // Default task(s).
490
8b05c7322e93 correct grunt file for dist version
ymh <ymh.work@gmail.com>
parents: 480
diff changeset
   208
  grunt.registerTask('base', ['jshint', 'bower:install', 'copy:vendors', 'clean:renkan', 'requirejs', 'jst', 'concat', 'uglify', 'cssmin', 'copy:renkan', 'copy:renkan_css', 'clean:renderer']);
470
47308aa6ce94 correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents: 468
diff changeset
   209
  grunt.registerTask('default', ['base', 'clean:jst']);
342
2306317213a1 publish a new version of renkan in django server part and add a grunt target to do it
ymh <ymh.work@gmail.com>
parents: 320
diff changeset
   210
  grunt.registerTask('copy-server', 'copy files to server part', function(){
2306317213a1 publish a new version of renkan in django server part and add a grunt target to do it
ymh <ymh.work@gmail.com>
parents: 320
diff changeset
   211
      grunt.task.run(['copy:renkan_server']);
2306317213a1 publish a new version of renkan in django server part and add a grunt target to do it
ymh <ymh.work@gmail.com>
parents: 320
diff changeset
   212
  });
470
47308aa6ce94 correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents: 468
diff changeset
   213
  grunt.registerTask('dev', [ 'base', 'connect:server', 'watch']);
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   214
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   215
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   216
};