Little update...
Looking at the ant jar task, it uses UTF-8 as the default encoding.So setting
System.setProperty('file.encoding', 'UTF-8') in the root project build.gradle
file seemed to do the trick.
However this begs the question... wouldn't it be a sensible default for the
gradle jar task to use UTF-8 ?
cheersMagnus
From: [email protected]
To: [email protected]
Date: Fri, 29 Apr 2011 12:46:26 +0000
Subject: RE: [gradle-user] Re: file encoding for jar task
Doing the following produces proper filenames though:
task myJar { doLast { ant.jar(baseDir: sourceSets.main.classesDir,
destFile:file('build/libs/myjar.jar')) }}
However this is obviously not a preferred solution...
cheersMagnus
From: [email protected]
To: [email protected]
Date: Fri, 29 Apr 2011 11:34:57 +0000
Subject: RE: [gradle-user] Re: file encoding for jar task
I've tried the following:1) On the command line: export
JAVA_TOOL_OPTIONS=-Dfile.encoding=ISO-8859-12) On command line : export
JAVA_OPTS=-Dfile.encoding=ISO-8859-13) in gradle startup script setting
-Dfile.options in JAVA_OPTS4) in root build.gradle
System.setProperty('file.encoding', 'ISO-8859-1')
println outputs the correct encoding but to no avail for the jar task. I'm
baffled :.-)
I can get the compile working by setting compile dependency to the classes dir,
but thats obviously not helping much when the produced jar is containing class
files with messed up names.
cheersMagnus
> Date: Fri, 29 Apr 2011 04:20:05 -0700
> From: [email protected]
> To: [email protected]
> Subject: [gradle-user] Re: file encoding for jar task
>
>
> Magnus Rundberget-3 wrote:
> >
> > So I'm guessing that the jar task (extending copy ?) doesn't use the
> > encoding it should.. and I can't find any setting for the jar task that I
> > could use to specify the encoding either. Is there something obvious I'm
> > missing?
> >
>
> I don't think the Jar task has such a setting at the moment. Have you tried
> setting the JVM's default encoding to iso-8859-1? After all, other parts of
> the build (compiler etc.) will also need to use this encoding. What's the
> output of 'println System.getProperty("file.encoding")' ?
>
> --
> Peter Niederwieser
> Developer, Gradle
> http://www.gradle.org
> Trainer & Consultant, Gradleware
> http://www.gradleware.com
> Creator, Spock Framework
> http://spockframework.org
>
> --
> View this message in context:
> http://gradle.1045684.n5.nabble.com/file-encoding-for-jar-task-tp4358462p4358512.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
>
>