Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build.gradle snippet to use ManifestClasspath plugin
##### Build script snippet for plugins DSL for Gradle 2.1 and later
```
plugins {
id "com.github.ManifestClasspath" version "0.1.0-RELEASE"
id "com.github.ManifestClasspath" version "0.2.0-RELEASE"
}
```
##### Build script snippet for use in older Gradle versions or where dynamic configuration is required
Expand All @@ -26,7 +26,7 @@ buildscript {
}
}
dependencies {
classpath "gradle.plugin.com.github.viswaramamoorthy:gradle-util-plugins:0.1.0-RELEASE"
classpath "gradle.plugin.com.github.viswaramamoorthy:gradle-util-plugins:0.2.0-RELEASE"
}
}

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ apply plugin: 'io.codearte.nexus-staging'
apply plugin: 'com.gradle.plugin-publish'

group = 'com.github.viswaramamoorthy'
version = '0.1.0-RELEASE'
version = '0.2.0-RELEASE'

sourceCompatibility = 1.8

Expand Down
14 changes: 13 additions & 1 deletion src/main/groovy/vr/util/ManifestUtil.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,23 @@ class ManifestUtil
if (!fileCollection)
return
def classPathString = fileCollection.files.collect {
it.toURL().toString()
toClassPathEntry(it)
}.join(' ')
createManifestJar(jarFile, manifestWithClasspath(classPathString))
}

/**
* Convert a file to its URL, with any spaces in the path replaced by {@ %20} so that directories
* containing spaces in their names in the classpath will be properly processed when running.
*
* @param element file to convert to string for inclusion in classpath
* @return classpath string referencing given file, as described
*/
private static String toClassPathEntry(File element) {
String path = element.toURL().toString()
return path.replaceAll(' ', '%20')
}

private static def createManifestJar(def jarFile, def manifest = null) throws IOException {
def jarOutputStream

Expand Down