Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions eng/mgmt/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ gulp.task('default', function() {
console.log("\tThe version of AutoRest. E.g. 2.0.9, or the location of AutoRest repo, e.g. E:\\repo\\autorest");

console.log("--autorest-java");
console.log("\tPath to an autorest.java generator to pass as a --use argument to AutoRest.");
console.log("\tOption#1: Path to an autorest.java generator to pass as a --use argument to AutoRest.");
console.log("\tOption#2: The version of AutoRest.Java. E.g. 2.0.9. You can also pass latest or preview.");
console.log("\tUsually you'll only need to provide this and not a --autorest argument in order to work on Java code generation.");
console.log("\tSee https://github.com/Azure/autorest/blob/master/docs/developer/autorest-extension.md");
console.log("\tSee https://github.com/Azure/autorest/blob/master/.attic/developer/autorest-extension.md");

console.log("--debug");
console.log("\tFlag that allows you to attach a debugger to the autorest.java generator.");
Expand All @@ -62,15 +63,19 @@ var autoRestVersion = 'preview'; // default
if (args['autorest'] !== undefined) {
autoRestVersion = args['autorest'];
}
var autoRestJavaVersion = ''; // default
if (args['autorest-java'] !== undefined) {
autoRestJavaVersion = args['autorest-java'];
}
var debug = args['debug'];
var autoRestArgs = args['autorest-args'] || '';
var autoRestExe;
const mgmtPomFilename = 'pom.mgmt.xml'

gulp.task('codegen', function(cb) {
if (autoRestVersion.match(/[0-9]+\.[0-9]+\.[0-9]+.*/) ||
autoRestVersion == 'preview') {
autoRestExe = 'autorest ---version=' + autoRestVersion;
autoRestVersion == 'preview' || autoRestVersion == 'latest') {
autoRestExe = 'autorest --version=' + autoRestVersion;
handleInput(projects, cb);
} else {
autoRestExe = "node " + path.join(autoRestVersion, "src/autorest-core/dist/app.js");
Expand Down Expand Up @@ -107,9 +112,10 @@ var codegen = function(project, cb) {

console.log('Generating "' + project + '" from spec file ' + specRoot + '/' + mappings[project].source);

const generatorPath = args['autorest-java']
? `--use=${path.resolve(args['autorest-java'])} `
: '';
const generatorPath = autoRestJavaVersion == 'preview' || autoRestJavaVersion == 'latest'
|| autoRestJavaVersion.match(/^[0-9]+\.[0-9]+\.[0-9a-zA-Z]+$/)
? `[email protected]/autorest.java@` + autoRestJavaVersion +` `
: (autoRestJavaVersion == '' ? '' : `--use=${path.resolve(args['autorest-java'])} `);

const regenManager = args['regenerate-manager'] ? ' --regenerate-manager=true ' : '';

Expand Down