Fabric
is a task management tool written in Python
, quite similar to make
.
Joshfire use it to process recurrent processes
fabfile.py
is the equivalent of a Makefile
in Fabric
.
To run tasks:
$ fab name_of_the_task
To install Fabric
: http://docs.fabfile.org/en/1.0.1/installation.html
The following actions are avalaible in the home directory of the framework :
bootstraps
fab bootstraps
every time you modify an adapter.
optimize
. It will take the compiled export/samsungtv.js
and export/samsungtv.css
and generate the files needed to test your application in the Samsung emulator or the real device. By default, all files are put in export/build
.
gjslint
gjslint
from Closure Linter
.
fixjsstyle
or fix
fixjsstyle
.
Reindents and rewrites code to fix errors detected by gjslint
.
Should be run before every commit of the framework.
jslint
jslint
.
jshint
http://jshint.com/
, a fork of jslint
.
Thoses tasks are available in joshfabric
module, located in build
directory.
You can have access to those tasks in your application by creating a fabfile.py
file at the application's root, that will contain the following code :
from fabric.api import *
import os,sys
sys.path.append("../../build")
from joshfabric import *
build/build.js
. Here is an example :
var build = {
// root of the application that contains the css/ and src/ folders
baseUrl: '../',
// used to differentiate the build.js files
name: 'exampleVideoList',
// final directory
dir: '../export/',
modules: [
{
// used in the final file name
name: 'web',
// adapter ID used internally for further optimizations
adapter: 'browser',
// reference JavaScript files
js: {
include: [
// the requireJS class ID
'src/app.web',
'joshfire/adapters/browser/uielements/video.youtube.swf'
]
},
//
css: {
// if this array exists, will simply concatenate the CSS files
/*'include': [
'css/samsungtv.css'
],*/
// if this property exists, it is the entry point of the sass compiler
scss:'css/web.scss'
}
},
// you can declare other versions of the app
]
};
compile
uglifyJs
and Closure Compiler
.
prod
optimize
and compile
.
Available in the tests
directory.
test_all
selenium
uglifyJs
and Closure Compiler
.