Skip to content

add --client command line arg to gulpfile #1220

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
10 changes: 6 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var connect = require('gulp-connect');
var header = require('gulp-header');
var pkg = require('./package.json');
var order = require('gulp-order');
var argv = require('yargs').argv;
var banner = ['/**',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @version v<%= pkg.version %>',
Expand Down Expand Up @@ -53,11 +54,12 @@ function templates() {
*/
gulp.task('dist', ['clean'], function() {

// Get local client or one specified on the command line
var swaggerClient = argv.client ? argv.client : './node_modules/swagger-client/browser/swagger-client.js';
log('swagger-client: ' + swaggerClient);
return es.merge(
gulp.src([
'./src/main/javascript/**/*.js',
'./node_modules/swagger-client/browser/swagger-client.js'
]),
gulp.src('./src/main/javascript/**/*.js'),
gulp.src(swaggerClient),
templates()
)
.pipe(order(['scripts.js', 'templates.js']))
Expand Down
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "swagger-ui",
"author": "Tony Tam <[email protected]>",
"contributors": [{
"name": "Mohsen Azimi",
"email": "[email protected]"
}],
"contributors": [
{
"name": "Mohsen Azimi",
"email": "[email protected]"
}
],
"description": "Swagger UI is a dependency-free collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API",
"version": "2.1.2-M2",
"homepage": "http://swagger.io",
Expand Down Expand Up @@ -45,6 +47,7 @@
"less": "^2.4.0",
"mocha": "^2.1.0",
"selenium-webdriver": "^2.45.0",
"swagger-client": "2.1.2-M2"
"swagger-client": "2.1.2-M2",
"yargs": "^3.8.0"
}
}