Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Allow the use of custom data when launching a VM and attaching an OS disk #1038

Merged
merged 3 commits into from
Aug 27, 2016
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
30 changes: 27 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ var mappings = {
'package': 'com.microsoft.azure.management.website',
'args': '-FT 1'
},
'graph.rbac': {
'dir': 'azure-mgmt-graph-rbac',
'source': 'arm-graphrbac/compositeGraphRbacManagementClient.json',
'package': 'com.microsoft.azure.management.graph.rbac',
'args': '-FT 1'
},
'redis': {
'dir': 'azure-mgmt-redis',
'source': 'arm-redis/2015-08-01/swagger/redis.json',
'package': 'com.microsoft.azure.management.redis',
'args': '-FT 1'
},
'datalake.store.filesystem': {
'dir': 'azure-mgmt-datalake-store',
'source': 'arm-datalake-store/filesystem/2015-10-01-preview/swagger/filesystem.json',
Expand Down Expand Up @@ -91,14 +103,16 @@ var mappings = {
};

gulp.task('default', function() {
console.log("Usage: gulp codegen [--spec-root <swagger specs root>] [--projects <project names>] [--autorest <autorest info>]\n");
console.log("Usage: gulp codegen [--spec-root <swagger specs root>] [--projects <project names>] [--autorest <autorest info>] [--modeler <modeler name>] [--autorest-args <AutoRest arguments>]\n");
console.log("--spec-root");
console.log("\tRoot location of Swagger API specs, default value is \"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master\"");
console.log("--projects\n\tComma separated projects to regenerate, default is all. List of available project names:");
Object.keys(mappings).forEach(function(i) {
console.log('\t' + i.magenta);
});
console.log("--autorest\n\tThe version of AutoRest. E.g. 0.15.0, or the location of AutoRest repo, E.g. E:\\repo\\autorest");
console.log("--modeler\n\tSpecifies which modeler to use. Default is 'Swagger'");
console.log("--autorest-args\n\tPasses additional argument to AutoRest generator");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. this is used to call AutoRest with -verbose in case generation fail.

});

var isWindows = (process.platform.lastIndexOf('win') === 0);
Expand All @@ -111,6 +125,11 @@ var autoRestVersion = '0.17.0-Nightly20160706'; // default
if (args['autorest'] !== undefined) {
autoRestVersion = args['autorest'];
}
var modeler = 'Swagger'; // default
if (args['modeler'] !== undefined) {
modeler = args['modeler'];
}
var autoRestArgs = args['autorest-args'];
var autoRestExe;

gulp.task('codegen', function(cb) {
Expand Down Expand Up @@ -157,8 +176,13 @@ var codegen = function(project, cb) {
if (mappings[project].fluent !== null && mappings[project].fluent === false) {
generator = 'Azure.Java';
}
cmd = autoRestExe + ' -Modeler Swagger -CodeGenerator ' + generator + ' -Namespace ' + mappings[project].package + ' -Input ' + specRoot + '/' + mappings[project].source +
' -outputDirectory ' + mappings[project].dir + '/src/main/java/' + mappings[project].package.replace(/\./g, '/') + ' -Header MICROSOFT_MIT_NO_CODEGEN';
cmd = autoRestExe + ' -Modeler ' + modeler +
' -CodeGenerator ' + generator +
' -Namespace ' + mappings[project].package +
' -Input ' + specRoot + '/' + mappings[project].source +
' -outputDirectory ' + mappings[project].dir + '/src/main/java/' + mappings[project].package.replace(/\./g, '/') +
' -Header MICROSOFT_MIT_NO_CODEGEN' +
' -' + autoRestArgs;
if (mappings[project].args !== undefined) {
cmd = cmd + ' ' + mappings[project].args;
}
Expand Down