Skip to content

Commit

Permalink
do not include a / directory in the jar
Browse files Browse the repository at this point in the history
  • Loading branch information
johnrengelman committed Jun 27, 2014
1 parent 83142f0 commit 6513045
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ v1.0.1
======

+ Fix issue where non-class files are dropped when using relocation ([Issue #58](https://github.com/johnrengelman/shadow/issues/58))
+ Do not create a / directory inside the output jar.

v1.0.0
======
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,8 @@ public class ShadowCopyAction implements CopyAction {
}

RelativeArchivePath getParent() {
if (!segments) {
if (!segments || segments.length == 1) {
return null
} else if (segments.length == 1) {
return new RelativeArchivePath(new ZipEntry('/'), null)
} else {
//Parent is always a directory so add / to the end of the path
String path = segments[0..-2].join('/') + '/'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ class ShadowPluginSpec extends PluginSpecification {

and:
contains(output, ['shadow/Passed.class', 'junit/framework/Test.class'])

and:
doesNotContain(output, ['/'])
}

def 'include project dependencies'() {
Expand Down

0 comments on commit 6513045

Please sign in to comment.