-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduced a tiny node module that gets the project version from pom.…
…xml and is shared by gulp and karma
- Loading branch information
Showing
3 changed files
with
44 additions
and
43 deletions.
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
var xml2json = require('xml-to-json'); | ||
|
||
function mavenVersion() { | ||
//This is so ugly, I'm embarrassed ;-) | ||
var gotIt = {err: null, result: null}; | ||
|
||
xml2json({ | ||
input: __dirname + '/pom.xml', | ||
output: null | ||
}, function (err, result) { | ||
gotIt.err = err; | ||
gotIt.result = result; | ||
}); | ||
var uvrun = require("uvrun"); | ||
while (gotIt.err === null && gotIt.result === null) | ||
uvrun.runOnce(); | ||
|
||
if (gotIt.err) | ||
throw gotIt.err; | ||
|
||
return gotIt.result.project.version; | ||
} | ||
var paths = require(__dirname + '/paths.json'); | ||
paths.projectVersion = mavenVersion(); | ||
paths.build = paths.buildTemplate.replace('@VERSION@', paths.projectVersion); | ||
module.exports = paths; |
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
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