Skip to content

Commit

Permalink
[bug] closes #91, Class-Path attribute is relative to ShadowJar path.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnrengelman committed Aug 26, 2014
1 parent fcffc23 commit 65d6f8d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ v1.1.1
======

+ Fix bug in `'createStartScripts'` task that was causing it to not execute `'shadowJar'` task ([Issue #90](https://github.com/johnrengelman/shadow/issues/90))
+ Do not include `null` in ShadowJar Manifest `'Class-Path'` value when `jar` task does not specify a value for it. ([Issue #92](https://github.com/johnrengelman/shadow/issues/92)
+ Do not include `null` in ShadowJar Manifest `'Class-Path'` value when `jar` task does not specify a value for it. ([Issue #92](https://github.com/johnrengelman/shadow/issues/92))
+ ShadowJar Manifest `'Class-Path'` should reference jars from `'shadow'` config as relative to location of `shadowJar` output ([Issue #91](https://github.com/johnrengelman/shadow/issues/91))

v1.1.0
======
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ShadowJavaPlugin implements Plugin<Project> {
def files = project.configurations.findByName(ShadowBasePlugin.CONFIGURATION_NAME).files
if (files) {
def libs = [project.tasks.jar.manifest.attributes.get('Class-Path')]
libs.addAll files.collect { "lib/${it.name}" }
libs.addAll files.collect { "${it.name}" }
manifest.attributes 'Class-Path': libs.findAll { it }.join(' ')
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ class ShadowPluginSpec extends PluginSpecification {
|
|jar {
| manifest {
| attributes 'Class-Path': 'a.jar'
| attributes 'Class-Path': '/libs/a.jar'
| }
|}
|
Expand All @@ -519,7 +519,7 @@ class ShadowPluginSpec extends PluginSpecification {
JarFile jar = new JarFile(output)
Attributes attributes = jar.manifest.getMainAttributes()
String classpath = attributes.getValue('Class-Path')
assert classpath == 'a.jar lib/junit-3.8.2.jar'
assert classpath == '/libs/a.jar junit-3.8.2.jar'

}

Expand Down Expand Up @@ -552,7 +552,7 @@ class ShadowPluginSpec extends PluginSpecification {
JarFile jar = new JarFile(output)
Attributes attributes = jar.manifest.getMainAttributes()
String classpath = attributes.getValue('Class-Path')
assert classpath == 'lib/junit-3.8.2.jar'
assert classpath == 'junit-3.8.2.jar'

}
}

0 comments on commit 65d6f8d

Please sign in to comment.