Skip to content
This repository has been archived by the owner on Nov 23, 2018. It is now read-only.

Configuration

raveN1 edited this page Apr 19, 2013 · 8 revisions

This page outlines basic configuration options.

##Configuring files and folders

You can override what folders and files you want to operate on in project.properties. All the default configuration is in default.properties which you can use as a template for your configuration work on your own projects.

Adding new 'pages' (html, php, etc) is handled by adding files to the file.pages property

##Script concatenation This is mentioned elsewhere, but it's important so we're going to repeat it.

You must wrap any scripts to concatenate in a pair of specially constructed comments. These look like this:

legacy version (pre 1.0) (What version are you running?)

    <!-- scripts concatenated and minified via build script -->
    <script src="js/plugins.js"></script>
    <script src="js/main.js"></script>
    <!-- end scripts -->

1.0 and greater

  <!-- //-beg- concat_js -->
  <script src="js/plugins.js"></script>
  <script src="js/main.js"></script>
  <!-- //-end- concat_js -->

If you do not wish a script file to be concatenated and minimized, you should link to it outside of those two lines.

Moving and renaming folders

For something as simple as changing the name of the CSS directory from "css" to "styles" add the following to the "Directory Structure" section

     # Directory Structure
     #
     # Override any directory paths specific to this project
     #
     dir.css	= styles

Some folks like to park static assets in a separate folder to segregate them out from the rest of the application code. If, for example, you wanted to move all of your static files to a folder named "_assets", your Directory Structure section would look something like this:

     # Directory Structure
     #
     # Override any directory paths specific to this project
     #
     dir.js = _assets/js
     dir.css = _assets/css
     dir.images = _assets/images

Configure deeply nested files

There is a special syntax one could use to include or exclude deep nested files in config.

For example, if you put compass source files inside css/src/ folder. but if you are using a setting like the one below, the build script still includes scss files in the build result.

file.exclude = *.scss

To solve this issue, you could use the syntax below:

file.exclude = **/*.scss

Easy VCS-based deployment

Check out the entire repo including the build/ folder onto your server.

Then go into build/ and run ant build (or your target of choice.)

Then drop this into the top of your .htaccess:

RewriteEngine On
RewriteCond $1 !^yourapp/publish/
RewriteRule ^(.*)$ yourapp/publish/$1 [L]
# where 'yourapp' is your actual checkout folder name

This allows you to serve a subfolder as if its the root of your site.

To update production you would do something like git pull && cd build && ant build to update from your repo, change into your build folder and run ant to update production.