-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrates the build from Rake to grunt #16
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e0eaa0d
WIP migration of build to grunt
ryanackley 4b961f7
Removing unnecessary files
ryanackley 7fe84c7
merge
ryanackley 1bea84b
Grunt build works locally. Needs to be tested in Travis
ryanackley 413cf26
Remove rake and ruby stuff
ryanackley 0b61e47
fixed a typo
ryanackley b39311d
Added correct branch name
ryanackley ca18cac
Move env variables to see if travis will now see them
ryanackley f580b3b
Move env variables to see if travis will now see them
ryanackley 275ded2
Move env variables to see if travis will now see them
ryanackley a43c753
Remove encryption for testing purposes
ryanackley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.DS_Store | ||
Issues.txt | ||
epub_cfi.js | ||
epub_cfi.js | ||
node_modules |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
branches: | ||
only: | ||
- grunt-migration | ||
language: node_js | ||
node_js: | ||
- '0.10' | ||
env: | ||
global: | ||
- SAUCE_USERNAME=readium | ||
- SAUCE_ACCESS_KEY=a36ebc10-e514-4da6-924c-307aec513550 | ||
before_install: | ||
- npm install -g grunt-cli | ||
install: | ||
- npm install | ||
script: | ||
- grunt travis |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
module.exports = function(grunt) { | ||
|
||
//grunt.template.addDelimiters('erb-like-delimiters', '<%= ', ' %>') | ||
var fs = require('fs'); | ||
|
||
// Project configuration. | ||
grunt.initConfig({ | ||
peg: { | ||
cfi:{ | ||
src: "cfi_grammar/epubcfi.pegjs", | ||
dest: "src/models/epubcfi.js", | ||
options: { exportVar: "EPUBcfi.Parser" } | ||
}, | ||
|
||
}, | ||
template: { | ||
libraryTemplate: { | ||
options: { | ||
data: { | ||
'cfi_parser': fs.readFileSync('src/models/epubcfi.js', {encoding:'utf8'}), | ||
'cfi_interpreter' : fs.readFileSync('src/models/cfi_instructions.js', {encoding:'utf8'}), | ||
'cfi_instructions' : fs.readFileSync('src/models/cfi_interpreter.js', {encoding:'utf8'}), | ||
'cfi_generator' : fs.readFileSync('src/models/cfi_generator.js', {encoding:'utf8'}), | ||
'runtime_errors' : fs.readFileSync('src/models/runtime_errors.js', {encoding:'utf8'}) | ||
} | ||
}, | ||
files: { | ||
'dist/epub_cfi.js': ['src/templates/cfi_library_template.js.erb'], | ||
} | ||
} | ||
}, | ||
karma: { | ||
local: { | ||
configFile: 'karma.conf.js' | ||
}, | ||
travis:{ | ||
configFile: 'karma.travis.conf.js' | ||
} | ||
} | ||
}); | ||
|
||
grunt.loadNpmTasks('grunt-peg'); | ||
grunt.loadNpmTasks('grunt-template'); | ||
grunt.loadNpmTasks('grunt-karma'); | ||
|
||
grunt.registerTask('compile', ['peg', 'template']); | ||
grunt.registerTask('default', ['compile', 'karma:local']); | ||
grunt.registerTask('travis', ['compile', 'karma:travis']); | ||
|
||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Karma configuration | ||
// Generated on Tue Oct 07 2014 15:09:42 GMT-0400 (EDT) | ||
|
||
module.exports = function(config) { | ||
|
||
config.set({ | ||
|
||
// base path that will be used to resolve all patterns (eg. files, exclude) | ||
basePath: '', | ||
|
||
|
||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: ['jasmine'], | ||
|
||
|
||
// list of files / patterns to load in the browser | ||
files: [ | ||
{pattern: 'spec/javascripts/fixtures/*.*', included: false, served: true}, | ||
'spec/javascripts/vendor/**/*.js', | ||
'dist/*.js', | ||
'spec/javascripts/helpers/**/*.js', | ||
'spec/javascripts/models/**/*.js' | ||
|
||
], | ||
|
||
|
||
// list of files to exclude | ||
exclude: [ | ||
], | ||
|
||
|
||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: { | ||
}, | ||
|
||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['dots'], | ||
|
||
|
||
// web server port | ||
port: 9876, | ||
|
||
|
||
// enable / disable colors in the output (reporters and logs) | ||
colors: true, | ||
|
||
|
||
// level of logging | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
|
||
|
||
// enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: false, | ||
|
||
|
||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
//browsers: ['Chrome'], | ||
browsers: ['Chrome'], | ||
|
||
|
||
// Continuous Integration mode | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: true | ||
}); | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend switching this to PhantomJS instead as not all build machines have Chrome installed (Travis comes to mind).
Edit: just noticed the karma file for travis... in that case, why bother with the two of them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vilmosioo Thanks for the recommendation. For mysterious reasons, some tests consistently fail only on PhantomJS. Therefore, as a team we decided not to use PhantomJS to run the tests.
The travis CI build uses https://saucelabs.com to run the unit tests in a browser since we don't want to use PhantomJS. We want to limit the use of sauce to our CI builds since we are on a free plan and have limited access. Therefore, there is a local config for running the build locally using your installed version of Chrome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" For mysterious reasons, some tests consistently fail only on PhantomJS. Therefore, as a team we decided not to use PhantomJS to run the tests." Oddly enough, that sounds very familiar to me.
The decision makes sense. Just a quick suggestion though. Have you considered using only one karma file and override some settings from Gruntfile? It would avoid redundancy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the browser config is less straightforward for using sauce and I didn't want to spend a lot of time trying to make it work. If you're interested in doing this. I would be happy to accept a pull request (after this one is merged)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a big fan of grunt, would be happy to do it!