ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Walton <noloa...@gmail.com>
Subject Re: Specify source file language in build.xml?
Date Tue, 17 Feb 2015 20:58:56 GMT
On Tue, Feb 17, 2015 at 3:17 PM, Earl Hood <earlhood@gmail.com> wrote:
> On Tue, Feb 17, 2015 at 2:11 PM, Jeffrey Walton wrote:
>> I'm trying to build an Android project from the command line. I'm
>> getting an error during `ant release`. The error is unmappable
>> character for encoding UTF-8.
>
> Use the 'encoding' attribute to the <javac> task.

Thanks Eric.

It looks like build.xml brings in
$ANDROID_SDK_ROOT/tools/ant/build.xml, and Android's build.xml uses
{java.encoding}:

$ cat "$ANDROID_SDK_ROOT/tools/ant/build.xml" | grep -A 10 javac
    ...
            <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 tried adding the following to the project's build.xml (not Android's
build.xml), but with no joy. It results in same/similar errors:

  <project>
  ...
    <property name="java.encoding" value="ascii" />
  </project>

I also tried to add the following to the project's build.xml (not
Android's build.xml):

  <project>
  ...
     <javac encoding="ascii" />
  </project>

But it results in:

    build.xml:115: srcdir attribute must be set!

I know ASCII is probably wrong. I'm just trying to get a toehold on
the fix at the moment).

How, exactly, do I specify the 'encoding' attribute to the <javac> task?

Sorry to ask. I'm not sure where the delineation between Ant problems
and Android problems occurs (should I be asking on an Android list?).
And all of this is modulo the problem of me being inexperienced and
wondering why comments are not being ignored (ignoring comments would
make this a non-sequitur).

Jeff

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message