Re: Specify source file language in build.xml?

Jeffrey Walton <[email protected]>
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <CAH8yC8k9wmEDLDG7VdYc6yzHT15DRBavuK8iVSJ1L2zm3CB5Vw@mail.gmail.com>
On Tue, Feb 17, 2015 at 4:26 PM, Earl Hood <[email protected]> wrote:
> On Tue, Feb 17, 2015 at 2:58 PM, Jeffrey Walton wrote:
>
>>> Use the 'encoding' attribute to the <javac> task.
> ...
>>             <javac encoding="${java.encoding}"
>>                     source="${java.source}" target="${java.target}"
>>                     debug="true" extdirs="" includeantruntime="false"
>>                     destdir="${out.classes.absolute.dir}"
>>                     bootclasspathref="project.target.class.path"
>>                     verbose="${verbose}"
>>                     classpathref="project.javac.classpath"
>>                     fork="${need.javac.fork}">
>>                 <src path="${source.absolute.dir}" />
>>                 <src path="${gen.absolute.dir}" />
>>                 <compilerarg line="${java.compilerargs}" />
>>             </javac>
>
> I do not know the specifics of how your build files are organized and if
> you are using <ant> tasks to call other build files or you are including
> all the build files so that targets are available directly.
>
> With the fragment above, you need to set the java.encoding property.
> You can do this from the command-line:
>
>   ant -Djava.encoding=UTF-8 ...

That's what I was looking for! My dumb ass tried the following:

    $ /usr/local/bin/ant "java.encoding=ascii" release
    Buildfile: /Users/android-permission-explorer/build.xml

    BUILD FAILED
    Target "encoding=ascii" does not exist in the project "Permission Explorer".

> Command-line property settings have the highest precedence and will
> override any setting in the build files.
> ...
>
> Note, java.encoding is not a default java system property, so something
> is setting the property before the <javac> task is invoked.

Yeah, I'm beginning to think this is an Android problem.

Thanks for the help. Now that I have an idea of what I should do, I
think I should pursue it on an Android list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.