Skip to content

Commit 7bbe7d6

Browse files
committed
update gradle and versions plugin
update deps; remove manual wrapper copying (binary check fixed in yeoman)
1 parent 201d9e7 commit 7bbe7d6

File tree

9 files changed

+22
-47
lines changed

9 files changed

+22
-47
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### 1.0.2 (2015-02-23)
2+
3+
* Update gradle 2.2.1 -> 2.3
4+
* Update gradle-versions-plugin 0.7 -> 0.8
5+
16
### 1.0.1 (2015-02-12)
27

38
* Update gradle-bintray-plugin 1.0 -> 1.1

app/index.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
// update generator to 1.18.9 or above when new windows inslaller release with updated npm (2.6)
4+
// because new yeoman 1.4.5 required for proper work
35
var yeoman = require('yeoman-generator'),
46
chalk = require('chalk'),
57
path = require('path'),
@@ -367,7 +369,7 @@ module.exports = yeoman.generators.Base.extend({
367369
var signature = {
368370
'1.6': 'org.codehaus.mojo.signature:java16-sun:+@signature',
369371
'1.7': 'org.codehaus.mojo.signature:java17:+@signature',
370-
'1.8': '' // switch off animalsniffer for latest java
372+
'1.8': '' // switch off animalsniffer for the latest java
371373
};
372374
var travis = {
373375
'1.6': 'oraclejdk7', // better use oraclejdk, compatibility will be checked with animalsniffer
@@ -396,20 +398,9 @@ module.exports = yeoman.generators.Base.extend({
396398
];
397399
this.gradlewExists = this.helper.exists('gradlew');
398400

401+
this.helper.copy('gradle-base', {writeOnceFiles: writeOnceFiles});
399402

400-
// avoid copying jar file due conflict resolution mistake: https://github.com/yeoman/generator/issues/717
401-
// (in memory content is wring and so comparison failed). this way jar file avoid any collision checks and gets copied as is each time
402-
this.helper.copy('gradle-base',
403-
{glob: '**/*[!.jar]', writeOnceFiles: writeOnceFiles});
404-
405-
// do resolution manually until issue fixed
406-
this.helper.bulkChangeCopy(
407-
'gradle-base/gradle/wrapper/gradle-wrapper.jar',
408-
'gradle/wrapper/gradle-wrapper.jar'
409-
);
410-
411-
this.helper.copyTpl('project-base',
412-
{writeOnceFiles: writeOnceFiles});
403+
this.helper.copyTpl('project-base', {writeOnceFiles: writeOnceFiles});
413404
},
414405

415406
sources: function () {

app/templates/gradle-base/gradle/buildscript.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies {
1010
// coveralls integration
1111
classpath "org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.3.1"
1212
// check dependencies updates
13-
classpath "com.github.ben-manes:gradle-versions-plugin:0.7"
13+
classpath "com.github.ben-manes:gradle-versions-plugin:0.8"
1414
classpath 'com.github.townsfolk:gradle-release:1.2'
1515
classpath "be.insaneprogramming.gradle:animalsniffer-gradle-plugin:1.4.0"
1616
}
8 Bytes
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Dec 10 00:12:55 NOVT 2014
1+
#Mon Feb 23 06:44:37 NOVT 2015
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-all.zip

app/templates/project-base/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description = '<%= libDesc %>'
1111
// convention: project.name == github project name == bintray package page
1212
project.ext {
1313
build = {
14-
gradle = '2.2.1'
14+
gradle = 2.3
1515
java = <%= targetJava %>
1616
// if not empty runs animal sniffer on compile to guarantee binary compatibility; set '' to disable
1717
signature = '<%= animalsnifferSignature %>'

app/utils.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ var url = require('url'),
77
properties = require('properties'),
88
fs = require('fs'),
99
_s = require('underscore.string'),
10-
detectConflict = require('detect-conflict'),
1110
chalk = require('chalk'),
1211
Insight = require('insight');
1312

@@ -97,24 +96,6 @@ _.extend(Helper.prototype, {
9796
return 'The package name you have provided is not a valid Java package name.';
9897
},
9998

100-
detectConflict: function (sourcePath, targetPath) {
101-
var content = fs.readFileSync(sourcePath);
102-
return detectConflict(targetPath, content);
103-
},
104-
105-
bulkChangeCopy: function (sourcePath, targetPath) {
106-
var src = this.$.templatePath(sourcePath);
107-
var dest = this.$.destinationPath(targetPath);
108-
if (!fs.existsSync(dest) || this.detectConflict(src, dest)) {
109-
this.$.bulkCopy(
110-
src,
111-
dest
112-
);
113-
} else {
114-
this.$.log(chalk.cyan('identical ') + dest.substr(this.$.destinationPath().length + 1));
115-
}
116-
},
117-
11899
exists: function (filePath) {
119100
return fs.existsSync(this.$.destinationPath(filePath));
120101
},

package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-lib-java",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Java library project generator, hosted on github, build with gradle and published to bintray and maven central",
55
"license": "MIT",
66
"main": "app/index.js",
@@ -36,23 +36,21 @@
3636
"dependencies": {
3737
"chalk": "^0.5.1",
3838
"configstore": "^0.3.2",
39-
"detect-conflict": "^1.0.0",
4039
"github": "^0.2.3",
4140
"insight": "^0.5.2",
42-
"lodash": "^3.1.0",
41+
"lodash": "^3.3.0",
4342
"properties": "^1.2.1",
4443
"sprintf": "^0.1.5",
4544
"underscore.string": "^3.0.3",
4645
"user-home": "^1.1.1",
47-
"yeoman-generator": "^0.18.8"
46+
"yeoman-generator": "0.18.8"
4847
},
4948
"devDependencies": {
50-
"exec": "^0.2.0",
5149
"fs-readdir-recursive": "^0.1.0",
5250
"mocha": "*",
5351
"mocha-jshint": "0.0.9"
5452
},
5553
"peerDependencies": {
56-
"yo": ">=1.0.0"
54+
"yo": ">=1.4.2"
5755
}
5856
}

test/test-app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var path = require('path'),
44
assert = require('yeoman-generator').assert,
55
helpers = require('yeoman-generator').test,
66
read = require('fs-readdir-recursive'),
7-
exec = require('exec');
7+
execFile = require('child_process').execFile;
88

99
describe('lib-java generator', function () {
1010
var appPath = path.join(__dirname, '../app'),
@@ -52,11 +52,11 @@ describe('lib-java generator', function () {
5252
this.timeout(300000); //5 min should be enough to download everything
5353
var isWin = /^win/.test(process.platform),
5454
targetFile = targetPath + '/testlib/gradlew' + (isWin ? '.bat' : '');
55-
exec([targetFile, 'check'], function (err, out, code) {
55+
execFile(targetFile, ['check'], function (err, stdout, stderr) {
5656
if (err instanceof Error)
5757
throw err;
58-
process.stderr.write(err);
59-
process.stdout.write(out);
58+
console.log(stdout);
59+
console.log(stderr);
6060
done();
6161
});
6262
});

0 commit comments

Comments
 (0)