Skip to content
This repository has been archived by the owner on Mar 11, 2020. It is now read-only.

Commit

Permalink
XD-1229 + XD-1230 Create build infrastructure for AngularJS based UI
Browse files Browse the repository at this point in the history
The Grunt-based build infrastructure is based on Yeoman's AngularJS support and then further customized. As part of `XD-1230`, this build process is then further integrated into the larger Spring XD Gradle build. Please see `README.md` for further details.

* Add AngularUI Router dependency
* Add UI-Router routes
* Add LESS support + UI Admin Styles
* Instead of customizing Bootstrap's `variables.less`, we instead import its styles into `main.less` and customize only the variables that changed. That way we can easily upgrade Bootstrap in the future
* Fix a `grunt-usemin` issue with images in CSS files
  - Use fix as detailed here: yeoman/yeoman#824 (comment)
  - See also issue: yeoman/grunt-usemin#242
* Exclude vendor CSS, we already import the Bootstrap CSS via `main.less`
* Don't use port 8080 for Karma tests in order to minimize conflicts with Tomcat
* Add "Loading Indicator" support using `angular-busy`
* Add Job launch support + Growl support + define XD Server URL globally
* Use Bootstrap fonts from the distribution
* Improve Job launch support
* Update `.gitignore`
* Update Nodejs dependencies, fix test dependencies
  - Running `npm install` should install all relevant dependencies from `package.json`
* Add Gradle build support
* Import CSS files as LESS resources in `main.less`
  - Otherwise you run into minification issues as Grunt's nsmin does not consider those CSS files
* Remove old `admin-ui`
* Improve resolving of the admin-ui URLs
  - http://localhost:9393/admin-ui --> http://localhost:9393/admin-ui/#/jobs/definitions
  - http://localhost:9393/admin-ui/ --> http://localhost:9393/admin-ui/#/jobs/definitions
* Add task `cleanDist`
* Improve Gradle build - Depend on `spring-xd-dirt:backgroundAdminServer`
* Fix `xd.ui.home` in `application.yml`
  - `xd.ui.home` in `application.yml` should contain a trailing slash
* Add `grunt-bower-task` to Grunt build
  - Allow Bower to be called via Grunt
* Test that the UI builds with `gradle npmInstall installGrunt build`
* Update Node dependency versions
* Fix "Required config property "bower-install.app.src" missing"
  - Bower Install - In `Gruntfile.js`, change config `html: '<%= yeoman.app %>/index.html',` to `src: '<%= yeoman.app %>/index.html',`
* Add Proxying to XD Admin Server via Grunt build
  - Add https://github.com/drewzboto/grunt-connect-proxy
* Better error messages when pulling Job Definitions
* Add `.bower_cache` directory local to project dir
* Add Karma shell scripts
  - I find these shell scripts quite useful when writing unit and e2e tests as you can configure Karma to keep running as a daemon (automatically re-running the tests of code-changes do occur)
* Add Grunt task `testfiles` - useful to prepare Spring XD test files
* Add Karma Safari launcher
* Add Unit and E2E tests
* Remove unnecessary files
  - .gitattributes
  - app/.buildignore
  - app/robots.txt
* Remove old loading Gif `loading.gif`
  - Remove unused related CSS
* Ensure we use only single quotes in JS files
* Improve Favicon support including mobile
* Remove main.css + main.css.map (autogenerated)
* Make sure LESS creates CSS files when executing `grunt serve`
* Update `.gitignore`
* Change Grunt Server Port to 8000
  - Port 9000 conflicts with Sonar
* Improve Gradle Build - `gradle build` will:
  - Install (if needed) node
  - Install (if needed) grunt
  - Download node dependencies for XD UI
  - Run the Grunt build
* `gradle clean` will remove all unnecessary spring-xd-ui folders (e.g. local node modules, bower files etc)
* Run Spring XD UI Grunt build on Eclipse STS import
  - Add task `afterEclipseImport`
  - See for details: https://issuetracker.springsource.com/browse/STS-2059
* Add `README.md`
* Fix live-reloading of Html files
* Fix copying of images in `Gruntfile.js`

XD-1229 Code Review changes

* Remove `.htaccess`
* Run E2E as part of the Gradle test task
* For distribution, copy Admin UI to `spring-xd-ui/dist`
  • Loading branch information
ghillert authored and Ilayaperumal Gopinathan committed Feb 4, 2014
1 parent d98835e commit 5b5e7cb
Show file tree
Hide file tree
Showing 341 changed files with 1,679 additions and 87,074 deletions.
6 changes: 6 additions & 0 deletions .bowerrc
@@ -0,0 +1,6 @@
{
"directory": "app/bower_components",
"storage": {
"packages": ".bower_cache"
}
}
9 changes: 9 additions & 0 deletions .gitignore
@@ -0,0 +1,9 @@
node_modules
dist
.tmp
.sass-cache
app/bower_components
.editorconfig
.bower_cache
app/styles/main.css
app/styles/main.css.map
94 changes: 22 additions & 72 deletions .jshintrc
@@ -1,74 +1,24 @@
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 20, // Maximum error before stopping.


// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.

"node" : true,
"rhino" : false,
"couch" : false,
"wsh" : false, // Windows Scripting Host.

"jquery" : false,
"prototypejs" : false,
"mootools" : false,
"dojo" : false,

"predef" : [ // Custom globals.
"define",
"module",
"$"
],


// Development.
"debug" : false, // Allow debugger statements e.g. browser breakpoints.
"devel" : false, // Allow developments statements e.g. `console.log();`.


// ECMAScript 5.
"es5" : false, // Allow ECMAScript 5 syntax.
"strict" : false, // Require `use strict` pragma in every file.
"globalstrict" : false, // Allow global "use strict" (also enables 'strict').


// The Good Parts.
"asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons).
"laxbreak" : true, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
"bitwise" : false, // Prohibit bitwise operators (&, |, ^, etc.).
"boss" : true, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
"curly" : true, // Require {} for every new block or scope.
"eqeqeq" : false, // Require triple equals i.e. `===`.
"eqnull" : true, // Tolerate use of `== null`.
"evil" : false, // Tolerate use of `eval`.
"expr" : true, // Tolerate `ExpressionStatement` as Programs.
"forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`.
"immed" : false, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
"latedef" : false, // Prohibit variable use before definition.
"loopfunc" : false, // Allow functions to be defined within loops.
"noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
"nonstandard" : false, // Defines non-standard but widely adopted globals such as escape and unescape.
"regexp" : false, // Prohibit `.` and `[^...]` in regular expressions.
"regexdash" : false, // Tolerate unescaped last dash i.e. `[-...]`.
"scripturl" : true, // Tolerate script-targeted URLs.
"shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
"supernew" : false, // Tolerate `new function () { ... };` and `new Object;`.
"undef" : true, // Require all non-global variables be declared before they are used.


// Personal styling preferences.
"newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
"noempty" : false, // Prohibit use of empty blocks.
"nonew" : true, // Prohibit use of constructors for side-effects.
"nomen" : false, // Prohibit use of initial or trailing underbars in names.
"onevar" : false, // Allow only one `var` statement per function.
"plusplus" : false, // Prohibit use of `++` & `--`.
"sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
"trailing" : true, // Prohibit trailing whitespaces.
"indent" : 4, // Specify indentation spacing
"white" : false, // Check against strict whitespace and indentation rules.
"smarttabs" : true // Suppresses warnings about mixed tabs and spaces when the latter are used for alignment only
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"globals": {
"angular": false
}
}
7 changes: 7 additions & 0 deletions .travis.yml
@@ -0,0 +1,7 @@
language: node_js
node_js:
- '0.8'
- '0.10'
before_script:
- 'npm install -g bower grunt-cli'
- 'bower install'

0 comments on commit 5b5e7cb

Please sign in to comment.