4. Content
● Why a build tool is needed for CI ?
● Why Grunt.js ?
● Demo
● Why Yeoman perfects Grunt.js
5. Supports Development
Continuous integration
aims to improve the quality of software,
and to reduce the time taken to deliver it,
by replacing the traditional practice of
applying quality control after completing all
development.
15. Basic Grunt.js tasks
● concat
Concatenate files
● init
Generate project scaffolding from a predefined template
● lint
Validate files with JSHint
● min
Minify files with UglifyJS.
16. Basic Grunt.js tasks
● init
Generate project scaffolding from a predefined template
● lint
Validate files with JSHint
● min
Minify files with UglifyJS.
● server
Start a static node web server
● test
Run unit tests with nodeunit. (Jasmine support)
● qunit
Run QUnit unit tests in a headless PhantomJS instance.
● watch
Run predefined tasks whenever watched files change.
● concat
Concatenate files
17. Ant
<target name="js-compile-all" description="What does it do?" unless="skip-js-compile">
<echo>Executing my JS files in ${input.scripts.dir} ...</echo>
<apply executable="java" dest="${output.scripts.dir}">
<arg value="-jar"/>
<arg path="${jar.lib.dir}/closure-compiler.jar"/>
<arg lmaxine="--js"/>
<srcfile/>
<arg line="--js_output_file"/>
<targetfile/>
<fileset dir="${output.scripts.dir}" includes="**/*-main.debug.js"/>
<mapper type="glob" from="*-main.debug.js" to="*-main.min.js"/>
</apply>
<echo>Finished manipulating mx JS files</echo>
</target>
18. Rake - Ruby
def uglify(script_file)
output = `uglifyjs #{script_file}`
#Did it work?
if !$?.success?
puts "Uglify Failed"
Process.abort
end
output
end
32. Yeoman
Yeoman is a robust and opinionated
set of tools, libraries
and a workflow
that can help developers to build
beautiful, compelling web apps.
@By Paul Irish, Addy Osmani,
Sindre Sorhus, Mickael Daniel,
Eric Bidelman ...
33. Yeoman builds on top
of Grunt.js
● package management like apt-get
34. DRY (Don't repeat yourself)
● Scaffolding & Prototyping
Coding by convention
Forcing
to best practices
CommonJS Module
http://dl.dropbox.com/u/39519/talks/io-tooling/index.html#21
38. Any Questions ?
● Against Grunt.js as a build system
http://blog.millermedeiros.com/node-js-ant-grunt-and-other-build-tools/
● Reply : Why Grunt.js
http://benalman.com/news/2012/08/why-grunt/
david.amend@it-amend.de
39. Articles
Google IO, Better web app development
through tooling
http://dl.dropbox.com/u/39519/talks/io-tooling/index.html#21
Blog about last commit comments
http://www.commitlogsfromlastnight.com/
Grunt-modernizr, builder which runs in TravisCI
https://github.com/doctyper/grunt-modernizr
Continous Integration in general
http://www.slideshare.net/bhavinjavia/continuous-integration-and-builds
Example of grunt usage
http://mechanics.flite.com/blog/2012/06/19/why-we-use-node-dot-js-and-grunt-to-build-javascript/
46. Tools to unify development
"I wrote a README the other day for a project ... and as I was writing it,
I realized that it was the sort of thing that might have intimidated the
hell out of me a couple of years ago, what with its casual mentions of
Node, npm, Homebrew, git, tests, and development and
production builds."...
Many members of the community – myself included – lacked
traditional programming experience. HTML, CSS, and JavaScript –
usually in the form of jQuery – were self-taught skills.
...here’s a new set of baseline skills required in order to be
successful as a front-end developer, and developers who don’t meet
this baseline are going to start feeling more and more left behind as
those who are sharing their knowledge start to assume that certain
things go without saying.
by Rebecca Murphy (+Paul Irish, Mike Taylor, Angus Croll, and Vlad Filippov)
http://rmurphey.com/blog/2012/04/12/a-baseline-for-front-end-developers/
48. Community rules
Grunt uses async for asynchronous function queue processing, dateformat for formatting dates and temporary for creating temporary files.
But on the other hand, I wanted synchronous globbing, and the excellent glob was async-only at the time… so I wrote my own. I even called it
glob-whatev so that people wouldn’t take it too seriously. Of course, I’d love to switch to glob now that it supports synchronous globbing, but
there’s at least one issue that’s blocking me from using it.
58. XXX aims to improve the
quality of software, and to
reduce the time taken to deliver it, by
replacing the traditional practice
of applying quality control after completing all
development.
http://en.wikipedia.org/
59. XXX aims to improve the
quality of software, and to
reduce the time taken to deliver it, by replacing
applying
the traditional practice of
quality control after
completing all development.
60. The process of
Continous Integration
Developer
Developer
Business/
-Customer
Code
CI-Webserver
QA-Employee