20. JavaScript Unit testing
Jasmine is a behavior-driven development framework for
testing your JavaScript code. It does not depend on any other
JavaScript frameworks. It does not require a DOM. And it has
a clean, obvious syntax so that you can easily write tests.
20
38. Why do I need automatic assembly
and deploy?
Sooner or later any JS project
grows, the amount and
frequency of commits
increase, and the
solution is already out
dozen JS files that need to be
collect, and to minimize for
the load on the server.
38
39. What is a Gradle?
System assembly
which tries
to combine
all the advantages of Ant,
Maven, Ivy, and
present what
come out with Groovy.
39
40. I have a plan!
1. Briefly about install Gradle
2. Creating a build - a script that:
● connect the selected files and JS
minimize them with Closure Compiler;
● flood min version of the FTP;
● Check the script on the practice;
40
41. How to install?
1. Downloading a fresh package
http://gradle.org/downloads
2. Unpack the disk and add
subdirectory bin in path
3. Check the installation by entering gradle to
the console
41
42. JS plug-in for Gradle
There exists an Gradle two plug-in, both based
for GCC, but differ in the rules of the assembly:
https://launchpad.net/gradle-jsli
https://github.com/eriwen/gradle-js-plugin
42
43. Writing gradle script
In the root folder, create a new project
file and call it core.gradle
It is assumed that the working directory script
($ {projectDir}) is a subfolder SRP
43
44. Check the availability of plug-in set out in
the Maven repository
If there is no
buildscript {
repositories {
mavenCentral()
}
dependencies {
//Install plugin from Maven Repo
classpath 'com.eriwen:gradle-js-plugin:0.3'
}
}
And use it
apply plugin: 'js'
44
47. Upload to FTP
To use the Ant deploy TASK, which
describe in a separate file - deploycore.xml.
Content you might deploycore.xml
view / copy of the articles
pixelscommander.com
In gradle script call Ant TASK:
ant.importBuild 'deploycore.xml'
47
48. Finally, call the script gradle
from the console
gradle -b= core.gradle combineJs minifyJs
Questions?
48
49. Thank you for your attention!
Presenter:
Zakharchenko Artem
49