Skip to content

Commit

Permalink
More fixes to gruntfile for sass integration
Browse files Browse the repository at this point in the history
  • Loading branch information
atruskie committed Sep 23, 2013
1 parent 12dc61a commit f35551d
Show file tree
Hide file tree
Showing 35 changed files with 77 additions and 33,287 deletions.
95 changes: 50 additions & 45 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function ( grunt ) {
grunt.loadNpmTasks('grunt-conventional-changelog');
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-coffeelint');
grunt.loadNpmTasks('grunt-recess');
/*grunt.loadNpmTasks('grunt-recess');*/
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-ngmin');
Expand Down Expand Up @@ -160,14 +160,14 @@ module.exports = function ( grunt ) {
* The `build_css` target concatenates compiled CSS and vendor CSS
* together.
*/
// build_css: {
// src: [
// '<%= vendor_files.css %>',
// /*'<%= recess.build.dest %>',*/
// /*'<%= compass.build.dest %>'*/
// ],
// dest: '<%= compass.cssDir %>'
// },
build_css: {
src: [
'<%= vendor_files.css %>',
/*'<%= recess.build.dest %>',*/
'<%= compass.build.options.cssDir%>/application.css'
],
dest: '<%= compass.build.options.cssDir %>/<%= pkg.name %>-<%= pkg.version %>.css'
},
/**
* The `compile_js` target is the concatenation of our application source
* code and all specified vendor source code into a single file.
Expand Down Expand Up @@ -244,47 +244,47 @@ module.exports = function ( grunt ) {
* Only our `main.less` file is included in compilation; all other files
* must be imported from this file.
*/
recess: {
build: {
src: [ '<%= app_files.less %>' ],
dest: '<%= build_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>.css',
options: {
compile: true,
compress: false,
noUnderscores: false,
noIDs: false,
zeroUnits: false
}
},
compile: {
src: [ '<%= recess.build.dest %>' ],
dest: '<%= recess.build.dest %>',
options: {
compile: true,
compress: true,
noUnderscores: false,
noIDs: false,
zeroUnits: false
}
}
},
//recess: {
// build: {
// src: [ '<%= app_files.less %>' ],
// dest: '<%= build_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>.css',
// options: {
// compile: true,
// compress: false,
// noUnderscores: false,
// noIDs: false,
// zeroUnits: false
// }
// },
// compile: {
// src: [ '<%= recess.build.dest %>' ],
// dest: '<%= recess.build.dest %>',
// options: {
// compile: true,
// compress: true,
// noUnderscores: false,
// noIDs: false,
// zeroUnits: false
// }
// }
//},

compass: {
compile: {
build: {
options: {
outputStyle: 'compact',
sassDir: 'src/sass',
cssDir: '<%= build_dir %>/assets/styles/<%= pkg.name %>-<%= pkg.version %>.css',
environment: 'production',
cssDir: '<%= build_dir %>/assets/styles/',
environment: 'development',
raw: "preferred_syntax = :scss\n"
}
},

build: {
compile: {
options: {
outputStyle: 'compact',
sassDir: 'src/sass',
cssDir: '<%= build_dir %>/assets/styles/<%= pkg.name %>-<%= pkg.version %>.css',
environment: 'development',
cssDir: '<%= build_dir %>/assets/styles/',
environment: 'production',
raw: "preferred_syntax = :scss\n"
}
}
Expand Down Expand Up @@ -315,7 +315,9 @@ module.exports = function ( grunt ) {
noarg: true,
sub: true,
boss: true,
eqnull: true
eqnull: true,
/* HACK: At some point this should be turned off!" */
force: true
},
globals: {}
},
Expand Down Expand Up @@ -405,7 +407,7 @@ module.exports = function ( grunt ) {
'<%= html2js.app.dest %>',
'<%= vendor_files.css %>',
/*'<%= recess.build.dest %>',*/
/*'<%= compass.dist %>'*/
'<%= compass.build.options.cssDir %>/*'
]
},

Expand All @@ -419,8 +421,8 @@ module.exports = function ( grunt ) {
src: [
'<%= concat.compile_js.dest %>',
'<%= vendor_files.css %>',
'<%= recess.compile.dest %>',
'<%= compass.build.dest %>'
/*'<%= recess.compile.dest %>',*/
'<%= compass.build.options.cssDir %>'
]
}
},
Expand Down Expand Up @@ -591,7 +593,7 @@ module.exports = function ( grunt ) {
*/
grunt.registerTask( 'build', [
'clean', 'html2js', 'jshint', 'coffeelint', 'coffee', /*'recess:build',*/ 'compass:build',
/*'concat:build_css',*/ 'copy:build_app_assets', 'copy:build_vendor_assets',
'concat:build_css', 'copy:build_app_assets', 'copy:build_vendor_assets',
'copy:build_appjs', 'copy:build_vendorjs', 'index:build', 'karmaconfig',
'karma:continuous'
]);
Expand Down Expand Up @@ -636,13 +638,16 @@ module.exports = function ( grunt ) {
var cssFiles = filterForCSS( this.filesSrc ).map( function ( file ) {
return file.replace( dirRE, '' );
});
var mainCss = (grunt.config('compass.build.options.cssDir') +
grunt.config('pkg.name') + '-' + grunt.config('pkg.version') + '.css').replace(dirRE, '');

grunt.file.copy('src/index.html', this.data.dir + '/index.html', {
process: function ( contents, path ) {
return grunt.template.process( contents, {
data: {
scripts: jsFiles,
styles: cssFiles,
mainStyle: mainCss,
version: grunt.config( 'pkg.version' )
}
});
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ baw-client
The AngularJS client for the bioacoustic workbench


# Install instructions
## Install instructions
$ npm -g install grunt-cli karma bower

cd to your cloned directory and then
Expand All @@ -15,17 +15,18 @@ cd to your cloned directory and then

To add new bower packages

$ bower install
$ bower install xxxx --save-dep

You'll also have to configure `build.config.js` when adding any new packages to vendor directory.


To develop:
## To develop:

$ grunt watch

and browse to `localhost:8080`

To build:
## To build:

$ grunt compile

Expand Down
9 changes: 4 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{
"name": "ng-boilerplate",
"version": "0.3.1",
"version": "0.0.3",
"devDependencies": {
"angular": "~1.0.7",
"angular-mocks": "~1.0.7",
"angular-bootstrap": "~0.3.0",
"angular-ui-router": "~0.0.1",
"angular-ui-utils": "latest",
"sass-bootstrap": "~3.0.0",
"hint.css": "~1.3.0"
"hint.css": "~1.3.0",
"underscore": "~1.5.2"
},
"dependencies": {

}
"dependencies": {}
}
8 changes: 6 additions & 2 deletions build.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,19 @@ module.exports = {
*/
vendor_files: {
js: [
'vendor/jquery/jquery.js',
'vendor/angular/angular.js',
'vendor/angular-bootstrap/ui-bootstrap-tpls.min.js',
'vendor/placeholders/angular-placeholders-0.0.1-SNAPSHOT.min.js',
'vendor/angular-ui-router/release/angular-ui-router.js',
'vendor/angular-ui-utils/modules/route/route.js'
'vendor/angular-ui-utils/modules/route/route.js',
'vendor/modernizr-latest.js',
'vendor/underscore/underscore.js'
],
css: [
'vendor/hint.css/hint.css'
],
assets: [
]
},
}
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Anthony Truskinger",
"name": "baw-client",
"version": "",
"version": "0.0.3",
"description": "The AngularJS client for the QUT Bioacoustics server",
"licenses": {
"type": "Apache",
Expand All @@ -28,6 +28,7 @@
"grunt-coffeelint": "0.0.6",
"grunt-conventional-changelog": "~0.1.1",
"grunt-bump": "0.0.6"

},
"private": true
}
2 changes: 1 addition & 1 deletion src/components/services/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
}
}
else {
console.error("Unable to start Persona authentication binding. This is usually caused by a lack of internet.")
console.error("Unable to start Persona authentication binding. This is usually caused by a lack of internet.");
}

function openIdLogin(url) {
Expand Down
14 changes: 9 additions & 5 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@
<html ng-app="baw">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><%= content_for?(:title) ? yield(:title) : "Baw Site" %></title>
<title>Bioacoustics Workbench</title>
<meta name="description" content="" />

<!-- todo add back in assets -->
<!-- compiled CSS --><% styles.forEach( function ( file ) { %>
<link rel="stylesheet" type="text/css" href="<%= file %>" /><% }); %>
<!-- compiled CSS -->
<% styles.forEach( function ( file ) { %>
<!--<link rel="stylesheet" type="text/css" href="<%= file %>" />-->
<% }); %>
<link rel="stylesheet" type="text/css" href="<%= mainStyle %>" />

<!-- compiled JavaScript --><% scripts.forEach( function ( file ) { %>
<script type="text/javascript" src="<%= file %>"></script><% }); %>
<script type="text/javascript" src="<%= file %>"></script>
<% }); %>

<!--<script src="https://login.persona.org/include.js"></script>-->
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAWT_qg_GDQVSlQB9O_1CEQf8l4bErP5Ek&sensor=false"></script>
<!--<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAWT_qg_GDQVSlQB9O_1CEQf8l4bErP5Ek&sensor=false"></script>-->



Expand Down
Empty file removed vendor/assets/javascripts/.gitkeep
Empty file.
Loading

0 comments on commit f35551d

Please sign in to comment.