Skip to content

Commit

Permalink
closes issue 49, calculate file name correctly on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
johnrengelman committed Jun 13, 2014
1 parent 3fa132c commit b796872
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v0.9.0-M3
=========

+ Use commons.io FilenameUtils to determine name of resolved jars for including/excluding

v0.9.0-M2
=========

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ instead of a port of the Maven Shade code. Documentation for version 0.8 and pri
buildscript {
repositories { jcenter() }
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:0.9.0-M2'
classpath 'com.github.jengelman.gradle.plugins:shadow:0.9.0-M3'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.github.jengelman.gradle.plugins.shadow.relocation.SimpleRelocator
import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer
import com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer
import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer
import org.apache.commons.io.FilenameUtils
import org.apache.tools.zip.ZipOutputStream
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.ResolvedDependency
Expand Down Expand Up @@ -107,7 +108,7 @@ class ShadowJar extends Jar {
Set<ResolvedDependency> dependencies = findMatchingDependencies(spec,
project.configurations.runtime.resolvedConfiguration.firstLevelModuleDependencies, includeTransitive)
dependencies.collect { it.moduleArtifacts.file }.flatten().each { File file ->
this.exclude(file.path.substring(file.path.lastIndexOf('/')+1)) //Get just the file name
this.exclude(FilenameUtils.getName(file.path))
}
return this
}
Expand All @@ -123,7 +124,7 @@ class ShadowJar extends Jar {
Set<ResolvedDependency> dependencies = findMatchingDependencies(spec,
project.configurations.runtime.resolvedConfiguration.firstLevelModuleDependencies, includeTransitive)
dependencies.collect { it.moduleArtifacts.file }.flatten().each { File file ->
this.include(file.path.substring(file.path.lastIndexOf('/')+1))
this.include(FilenameUtils.getName(file.path))
}
return this
}
Expand Down

0 comments on commit b796872

Please sign in to comment.