         background: true
         browsers: ['Chrome']
 
-    shell:
-      options:
-        stderr : true
-        stdout : true
-        failOnError : true
-      semver:
-        command: './node_modules/semver-sync/bin/semver-sync -v'
-      hooks:
-        command: 'cp -R ./hooks ./.git/'
-
-    watch:
-      options:
-        livereload: true
-      grunt:
-        files: '<%= coffeelint.gruntfile.files.src %>'
-      demo:
-        files: "#{MODULES_DIR}/**/*.html"
-      tests:
-        files: "#{MODULES_DIR}/*/*/test/*.coffee"
-        tasks: ['coffee:tests', 'karma:unit:run']
-      coffee:
-        files: "#{MODULES_DIR}/*/*/*.coffee"
-        tasks: ['coffee', 'karma:unit:run']
-      less:
-        files: "#{MODULES_DIR}/**/*.less"
-        tasks: ['cssbuild']
-
-    # internal tasks don't use by hand
-    less: all:
-      dest: "#{DIST_DIR}/bradypodion.css"
-      src: ['<%= clean.tmp %>/bradypodion.less']
-
   grunt.registerTask 'cssbuild', ->
     # config
-    template = 'modules/bradypodion.less'
-    configs  = "#{MODULES_DIR}/_less/*.less"
-    modules  = "#{MODULES_DIR}/*/*/less/*.less"
+    PLATFORMS = grunt.config.get('bp').platforms
+    styles = grunt.template.process '<%=bp.app%>/styles'
+    template = "#{styles}/bradypodion.less"
+    configs  = "#{styles}/variables/*.less"
+    modules  = "#{styles}/*/*/*.less"
 
     # parse task flags
     platforms = []

        PLATFORMS.splice index, 1
    else
      platforms = PLATFORMS
      lessTask = 'less:all'

    toBeNamespaced = platforms.length > 1
    fileContent    = grunt.file.read template

'use strict'

module.exports = (grunt) ->
  require('load-grunt-tasks') grunt
  require('time-grunt') grunt
  grunt.initConfig
    bp:
      app: 'modules'
      dist: 'dist'
      tmp: '.tmp'
      platforms: ['android', 'ios', 'ios7']

    watch:
      coffee:
        files: [
          '<%=bp.app%>/scripts/bradypodion.coffee'
          '<%=bp.app%>/scripts/*/**/*.coffee'
        ]
        tasks: ['coffeelint:build', 'coffee:dist', 'karma:unit:run']

      coffeeTest:
        files: ['test/spec/**/*.coffee']
        tasks: ['coffeelint:test', 'coffee:test', 'karma:unit:run']

      gruntfile:
        files: ['Gruntfile.coffee']
        tasks: ['coffeelint:gruntfile']

      styles:
        files: ['<%=bp.app%>/styles/**/*.less']
        tasks: ['cssbuild']

      livereload:
        options:
          livereload: '<%= connect.options.livereload %>'

        files: [
          '{<%=bp.tmp%>,<%=bp.app%>}/**/*.html'
          '{<%=bp.tmp%>,<%=bp.app%>}/**/*.css'
          '{<%=bp.tmp%>,<%=bp.app%>}/**/*.js'
        ]

    connect:
      options:
        port: 9000
        hostname: '*'
        livereload: 35729

      livereload:
        options:
          open: 'http://localhost:9000/'
          base: ['<%=bp.tmp%>', '<%=bp.app%>', '<%=bp.dist%>']

      dist:
        options:
          base: '<%=bp.dist%>'

    shell:
      options:
        stderr : true
        stdout : true
        failOnError : true
      semver:
        command: './node_modules/semver-sync/bin/semver-sync -v'
      hooks:
        command: 'cp -R ./hooks ./.git/'

    clean:
      dist:
        files: [
          dot: true
          src: [
            '<%=bp.tmp%>/scripts/'
            '<%=bp.tmp%>/styles/'
            '<%=bp.dist%>/*'
            '!<%=bp.dist%>/.git*'
          ]
        ]

      server: '<%=bp.tmp%>/test'

    coffee:
      options:
        sourceMap: true
        sourceRoot: ''

      dist:
        options:
          join: yes
        src: [
          '<%=bp.app%>/scripts/bradypodion.coffee'
          '<%=bp.app%>/scripts/*/**/*.coffee'
        ]
        dest: '<%=bp.dist%>/bradypodion.js'

      test:
        options:
          join: yes
        src: [ 'test/spec/**/*.coffee' ]
        dest: '<%=bp.tmp%>/test/tests.js'

    coffeelint:
      options:
