samples are always a good startingpoint ...
maybe a wiki-page or snipplr.com could become source
for a collection of useful gradle-snippets.
Adam Murdoch-2 wrote:
>
> I wonder if this is the start of a 'java-application' plugin
>
such a plugin targets a typical usecase but
implicates the danger of beeing 'overgeneric'.
for the interested gradle-user ...
i improved my script a little bit:
Set runtimeLibFiles = configurations.runtime.resolve()
manifest.mainAttributes(
'Provider': group,
'Main-Class': 'insert_mainclass_here',
'Implementation-Version': version,
'Built-With': 'gradle-' + new GradleVersion().getVersion(),
'Class-Path': getManifestCp(runtimeLibFiles))
task distZip(type: Zip) {
fileSet(dir: libsDir)
zipFileSet(dir: 'lib') {
runtimeLibFiles.each {
include(it.name)
}
prefix = 'lib'
}
files(new File('insert_name_of_propertiesfile_here'))
}
String getManifestCp(Set runtimeLibFiles) {
StringBuffer manifestCp = new StringBuffer()
runtimeLibFiles.eachWithIndex() {
file, index ->
if (index > 0)
manifestCp.append(' ')
manifestCp.append("lib/$file.name")
}
return manifestCp.toString()
}
--
View this message in context:
http://www.nabble.com/creating-a-manifest-file-tp23974975p24032208.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email