From cf9c25872133964c8acb828cc86519819916fdf2 Mon Sep 17 00:00:00 2001 From: Andreas Kohn Date: Mon, 2 May 2016 10:42:59 +0200 Subject: [PATCH 1/4] Let the options provided to install/deploy override the defaults --- src/util/buildFileOptions.js | 4 ++-- test/deployTest.js | 17 +++++++++++++++++ test/installTest.js | 17 +++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/util/buildFileOptions.js b/src/util/buildFileOptions.js index fccf031..3d62415 100644 --- a/src/util/buildFileOptions.js +++ b/src/util/buildFileOptions.js @@ -5,10 +5,10 @@ module.exports = function(file, baseOptions) { // Ensure file to be of new vinyl version file = new File(file); - var fileOptions = assign({}, baseOptions, { + var fileOptions = assign({}, { artifactId: file.stem, type: file.extname.replace(/^\./, '') - }); + }, baseOptions); return fileOptions; }; diff --git a/test/deployTest.js b/test/deployTest.js index 43684cc..64abfe2 100644 --- a/test/deployTest.js +++ b/test/deployTest.js @@ -142,6 +142,23 @@ describe('gulp-maven-deploy plugin', function () { stream.end(); }); + it('uses provided artifactId', function (done) { + var config = Object.assign({}, testConfig); + config.artifactId = 'file'; + var stream = plugin.deploy(config); + var expectedOptions = { + artifactId: 'file' + }; + + stream.on('finish', function() { + expect(mavenDeploy.config).to.be.calledWith(sinon.match(expectedOptions)); + done(); + }); + + stream.write(fileA); + stream.end(); + }); + it('removes temporary file when finished', function(done) { var stream = plugin.deploy(testConfig); diff --git a/test/installTest.js b/test/installTest.js index 7786955..34a26d5 100644 --- a/test/installTest.js +++ b/test/installTest.js @@ -94,6 +94,23 @@ describe('gulp-maven-deploy plugin', function () { stream.end(); }); + it('uses provided artifactId', function (done) { + var config = Object.assign({}, testConfig); + config.artifactId = 'file'; + var stream = plugin.install(config); + var expectedOptions = { + artifactId: 'file' + }; + + stream.on('finish', function() { + expect(mavenDeploy.config).to.be.calledWith(sinon.match(expectedOptions)); + done(); + }); + + stream.write(fileA); + stream.end(); + }); + it('ensures to work with old vinyl versions', function (done) { var stream = plugin.install(testConfig); var expectedOptions = { From 0c9cbf628727c384a9896bc8d279679229e992bd Mon Sep 17 00:00:00 2001 From: Michael van Engelshoven Date: Mon, 29 Aug 2016 08:40:23 +0200 Subject: [PATCH 2/4] Fix tests failing on node 0.10 and node 0.12 --- test/deployTest.js | 3 ++- test/installTest.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/deployTest.js b/test/deployTest.js index 64abfe2..c2c2bc4 100644 --- a/test/deployTest.js +++ b/test/deployTest.js @@ -3,6 +3,7 @@ var plugin = require('../index.js'), sinon = require('sinon'), Vinyl = require('vinyl'), mavenDeploy = require('maven-deploy'), + assign = require('lodash.assign'), fs = require('fs'); /* globals describe: false, it: false, beforeEach: false, afterEach: false */ @@ -143,7 +144,7 @@ describe('gulp-maven-deploy plugin', function () { }); it('uses provided artifactId', function (done) { - var config = Object.assign({}, testConfig); + var config = assign({}, testConfig); config.artifactId = 'file'; var stream = plugin.deploy(config); var expectedOptions = { diff --git a/test/installTest.js b/test/installTest.js index 34a26d5..1b37a2b 100644 --- a/test/installTest.js +++ b/test/installTest.js @@ -3,6 +3,7 @@ var plugin = require('../index.js'), sinon = require('sinon'), Vinyl = require('vinyl'), mavenDeploy = require('maven-deploy'), + assign = require('lodash.assign'), fs = require('fs'); /* globals describe: false, it: false, beforeEach: false, afterEach: false */ @@ -95,7 +96,7 @@ describe('gulp-maven-deploy plugin', function () { }); it('uses provided artifactId', function (done) { - var config = Object.assign({}, testConfig); + var config = assign({}, testConfig); config.artifactId = 'file'; var stream = plugin.install(config); var expectedOptions = { From a3517d23f4a25de4677e06df7b54f8e12498bb07 Mon Sep 17 00:00:00 2001 From: Michael van Engelshoven Date: Mon, 29 Aug 2016 08:55:56 +0200 Subject: [PATCH 3/4] Update readme for 1.0.0 release --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index b848836..8c303c1 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,6 @@ gulp-maven-deploy ================= -*** -**Warning** This readme contains changes for the upcoming 1.0.0 release. For using the 0.x versions, have a look into the [0.x support branch](https://github.com/micha149/gulp-maven-deploy/tree/support/0.x) -*** - A [Gulp](//gulpjs.com/) wrapper for the [maven-deploy](https://www.npmjs.org/package/maven-deploy) module. Enables you to have projects which are built with Gulp, but deploys to Maven repositories. [![Build Status](https://travis-ci.org/micha149/gulp-maven-deploy.svg?branch=master)](https://travis-ci.org/micha149/gulp-maven-deploy) @@ -13,7 +9,7 @@ A [Gulp](//gulpjs.com/) wrapper for the [maven-deploy](https://www.npmjs.org/pac [![NPM](https://nodei.co/npm/gulp-maven-deploy.png?stars=true&downloads=true)](https://npmjs.org/package/gulp-maven-deploy) -All the samples below require a basic understanding of [Gulp](//gulpjs.com/) and [Maven](http://maven.apache.org/). Please look at the documentation for those projects for details. +All the samples below require a basic understanding of [Gulp](//gulpjs.com/) and [Maven](http://maven.apache.org/). Please look at the documentation for those projects for details. This readme refers to 1.x versions. If you are still using the 0.x versions, have a look into the [0.x support branch](https://github.com/micha149/gulp-maven-deploy/tree/support/0.x). ## Installing From 6df975fc766c99c7c5ed0f88dba51041209dd15f Mon Sep 17 00:00:00 2001 From: Michael van Engelshoven Date: Mon, 29 Aug 2016 08:56:56 +0200 Subject: [PATCH 4/4] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b17ecaf..c7f4b15 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gulp-maven-deploy", - "version": "1.0.0-beta.5", + "version": "1.0.0", "description": "Simple gulp plugin for the maven-deploy module", "main": "index.js", "scripts": {