Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge pull request #131 from vrockai/xmljs
Browse files Browse the repository at this point in the history
HAWKULAR-250: switched to xml2js lib for xml parsing
  • Loading branch information
jshaughn committed May 26, 2015
2 parents 5c2d3a3 + 829bfe7 commit d9832ea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions ui/console/src/main/scripts/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var gulp = require('gulp'),
wiredep = require('wiredep').stream,
eventStream = require('event-stream'),
gulpLoadPlugins = require('gulp-load-plugins'),
libxmljs = require('libxmljs'),
xml2js = require('xml2js'),
map = require('vinyl-map'),
fs = require('fs'),
path = require('path'),
Expand Down Expand Up @@ -61,15 +61,16 @@ var config = {
};

gulp.task('set-server-path', function(done) {
fs.readFile(POM_MAIN_PATH, 'utf8', function (err, data) {
if (err) throw err;
var xmlData = data;

var xmlDoc = libxmljs.parseXml(xmlData);
var version = xmlDoc.get('/xmlns:project/xmlns:version', 'http://maven.apache.org/POM/4.0.0').text();
config.serverPath = DIST_TARGET_PATH + 'hawkular-' + version + '/' + WF_CONSOLE_PATH;
var parser = new xml2js.Parser();
parser.addListener('end', function(result) {
config.serverPath = DIST_TARGET_PATH + 'hawkular-' + result.project.version + '/' + WF_CONSOLE_PATH;
done();
});

fs.readFile(POM_MAIN_PATH, 'utf8', function (err, xmlString) {
if (err) throw err;
parser.parseString(xmlString);
});
});

gulp.task('bower', function () {
Expand Down
2 changes: 1 addition & 1 deletion ui/console/src/main/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"gulp-tslint": "^1.4.2",
"gulp-typescript": "^2.3.0",
"gulp-watch": "^3.0.0",
"libxmljs": "0.14.1",
"xml2js": "0.4.8",
"through2": "^0.6.3",
"underscore.string": "^2.4.0",
"vinyl-map": "^1.0.1",
Expand Down

0 comments on commit d9832ea

Please sign in to comment.