Created
August 9, 2011 12:46
-
-
Save gimmi/1133952 to your computer and use it in GitHub Desktop.
Addins jsmake
This file contains hidden or 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
// Example: buildSetup('src/Solution.sln', 'Project', 'Release', 'AnyCPU'); | |
function buildSetup(sln, vdproj, configuration, platform) { | |
sys.createRunner(jsmake.Fs.combinePaths(sys.getEnvVar('DevEnvDir', null), 'devenv.exe')) | |
.args(sln) | |
.args('/Build', [ configuration, platform ].join('|')) | |
.args('/Project', vdproj) | |
// .args('/Out', 'devenv_errors.txt') | |
.run(); | |
} |
This file contains hidden or 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
jsmake.svn = {}; | |
jsmake.svn.SvnUtils = function () { | |
this._svnVersionPath = 'svnversion'; | |
}; | |
jsmake.svn.SvnUtils.prototype = { | |
isWorkingFolderClear: function (path) { | |
var version = this._svnVersion(path); | |
return !(version.modified || version.switched || version.partial || version.mixed); | |
}, | |
getWorkingFolderRevision: function (path) { | |
return this._svnVersion(path).revision; | |
}, | |
updateWorkingFolder: function (path) { | |
// TODO | |
}, | |
_svnVersion: function (path) { | |
var out = this._run(this._svnVersionPath, [ '--no-newline', path ]); | |
return { | |
modified: out.indexOf('M') !== -1, | |
switched: out.indexOf('S') !== -1, | |
partial: out.indexOf('P') !== -1, | |
mixed: out.indexOf(':') !== -1, | |
revision: parseInt(/^\d+/.exec(out), 10) | |
}; | |
}, | |
_run: function (command, args) { | |
var options = { | |
args: args, | |
output: '' | |
}; | |
var exitStatus = runCommand(command, options); | |
if( exitStatus !== 0) { | |
throw 'Command failed with exit status ' + exitStatus; | |
} | |
return options.output; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment