Joseph Kesselman/Watson/IBM | 27 Mar 14:26 2015
Picon

Wishlist item: Resource macros

Macrodef very explicitly says that the macro invocation is treated as a 
Task.

Unfortunately, I need macros to simplify gathering resources, so macrodef 
doesn't help me.

So I'm requesting <resource-macrodef> and <resource-macro> -- just working 
names, I'm sure something better exists -- which are isomorphic with 
Macrodef but have invocations that are typed as Resource Collections. 
Syntax could be almost identical, but use <union> in place of <sequential> 
as the body element.

Or, perhaps better, just modify macrodef so it recognizes when its body is 
a union rather than a squential and changes its type (and the type of its 
invocation) appropriately.

(Personally, I really wish that you'd left macros as pure syntactic 
operations rather than constraining them to be tasks in the first place... 
but since that decision was made, I think you need to "drop the other 
shoe" and give us the resources equivalent.)

______________________________________
"Everything should be as simple as possible. But not simpler." -- 
attributed to Albert Einstein
Al Le | 24 Mar 23:31 2015
Picon
Picon

Pass build failure message to the calling script

Hello,

I call Ant (execute a build) from a .bat script (under Windows). If the build fails, I'd like not only to
detect that it failed (this is possible via ERRORLEVEL) but also get the failure message (at least its
first line if the message contains multiple lines).

Is it possible without parsing the output of Ant? If yes, how?

Thank you!
Picon

How do I create a customized build?

First let me preface this question by stating that I'm very much an Ant 
newbie.

I have a Java application that was designed to provide the ability to "plug 
 in" a message transport mechanism (e.g. ActiveMQ) for a given client 
installation.  The code defines interfaces for the transport and then there 
are a number of implementations that conform to the interfaces, providing 
concrete implementations of the transports we support.  The idea is that a 
given client will indicate the transport they want/need to use and we will 
provide them with a build that includes only the classes for the chosen 
implementation. No other transport implementations should be included.  The 
reasons for this are to keep code size down and for 3rd party licensing 
issues.

How do you set up an Ant build file to customize the jar file produced so that 
it only includes a subset of the transport implementations?  Obviously I need 
to somehow get the transport selection into the build file so that it has the 
info it needs.  From what I've read, you have to use properties to get input 
arguments into the script.  Beyond that, I am at a loss as to what to do next.

I'll provide a brief package hierarchy to illustrate what is located where. 
If it makes sense to restructure this in some way, please let me know.

<base package>.impl
	config
		TransportConfig.java	<- Used to unmarshal a file used to configure the 
transport
	transport
		impl				<- Where the supported transport implementations live
			dds.rti
(Continue reading)

Josh Hoff | 17 Mar 01:14 2015
Picon

Excluding classpath jars from %ANT_HOME%\lib?

Hello Ants!

I'm having an issue where the server (that I don't have control over)
will have two junit jars in %ANT_HOME%\lib, and I'll pull one down (that
I do want) with ivy. My tests are failing because of the two in
%ANT_HOME%\lib conflicting with the one I got from ivy, but I can't find
where (if anywhere) %ANT_HOME%\lib is added to the classpath.
Suggestions?
jason mazzotta | 22 Feb 17:24 2015
Picon

mail task results in authentication failure when using gmail as smtp server

To whom it may concern,
        I am trying to use gmail as an smtp server with the ant mail task.
I have set up the task as follows:

<mail

         user="e-mail address"

         password="password"

         ssl="yes"

         mailhost="smtp.gmail.com"

         mailport="465"

         subject="Nightly unit test results">

         <to address="e-mail address" />

         <from address="e-mail address" />

         <message src="/Directory/On/My/Machine" />

</mail>

This worked a few months ago, but these days, when I run my ant build file
I get the follow error:

Failed to send email: 534-5.7.14 <
(Continue reading)

Jeffrey Walton | 17 Feb 21:11 2015
Picon

Specify source file language in build.xml?

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.

The sources appear to be written by a non-English speaker, and the
offending characters are in comments like so:

    /*
     * Projet   : Permission Explorer
     * Auteur   : Carlo Criniti
     * Date     : 2011.06.10
     *
     * Classe ApplicationDetail
     * ActivitÈ d'affichage du dÈtail d'une application
     * avec les permissions qu'elle utilise
     */

There are multiple errors like this. If /usr/local/bin/ant release
2>&1 | grep -i error | wc -l is accurate, then there's 103 of them.

I've been through ant's documentation at "Writing a Simple Buildfile"
(http://ant.apache.org/manual/using.html) and "Property Task"
(http://ant.apache.org/manual/Tasks/property.html), but damn if I can
figure out how to set a source file language to get past these errors.

How do I specify a source file language in build.xml?
Jackie Xiao | 13 Feb 02:54 2015

RE: [Ant]Read buid.xml file in memory

Hi, Martin

The thing is, we need to enable customers to work with us, but we don’t want to share the build scripts (I
know it’s weird).

So, we want to encrypt the build.xml and give them the encrypted file.

In the build process, we will decrypt build.xml in memory, and if Ant can read the content from memory, this
should work.

Thanks
Best Regards

From: Martin Gainty <mgainty <at> hotmail.com<mailto:mgainty <at> hotmail.com>>
Date: 2015年2月12日 GMT+08003时52分04秒
To: Ant Users List <user <at> ant.apache.org<mailto:user <at> ant.apache.org>>
Subject: RE: [Ant]Read buid.xml file in memory
Reply-To: "Ant Users List" <user <at> ant.apache.org<mailto:user <at> ant.apache.org>>
Hi Xiao-

supposedly yes ...if you can get your File to extend apache jackrabbit MemoryFile
https://jackrabbit.apache.org/api/1.5/index.html?org/apache/jackrabbit/core/fs/mem/MemoryFile.html


I would not rely on any java implementor to guarantee your Java Object will be "in memory" vs "on disk"
specifically a java object which implements Serializable will save the object to disk by the serializer..
http://www.onjava.com/pub/a/onjava/excerpt/JavaRMI_10/?page=3

(except your objects declared as transient of course)

Did you have a specific requirement in mind for "Memory File" for your build.xml ?

(Continue reading)

Jackie Xiao | 11 Feb 17:07 2015

[Ant]Read buid.xml file in memory

Dear List:

Is it possible for Ant to read build files from memory?

If possible, what will be the necessary steps, thanks.
This e-mail and any attachments thereto are intended for the sole use of the recipient(s) named above and
may contain confidential and/or privileged material. Any use of the information contained herein
(including, but not limited to, total or partial reproduction, communication, or dissemination in any
form) by persons other than the intended recipient(s) is prohibited. If you received this in error,
please contact the sender immediately and delete the material from any computer.
Eric Fetzer | 10 Feb 22:36 2015

sshexec

I'm running Ant 1.7 and having an issue I don't understand.  I see sshexec finish with a successful status,
then it gets back to the calling task and bombs out.  I upped the timeout value and that seemed to work once,
but not after that even though it's WAY over the value that the ssh command is taking.  Here's the ssh task,
and then the build output:
        <sshexec host="myMachine"
          username="myUser"
          keyfile="myUser_id_rsa"
          passphrase=""
          command="/bin/bash -l ant -f /my/folder/BuildMyApp.xml"
          trust="true"
          timeout="1800000"
          verbose="true"
        />
  [sshexec] main:
  [sshexec]   [sshexec]   [sshexec] BUILD SUCCESSFUL  [sshexec] Total time: 1 minute 7 seconds
  [sshexec] Feb 10, 2015 1:25:02 PM org.apache.bsf.BSFManager exec
SEVERE: Exception :
java.security.PrivilegedActionException: org.apache.bsf.BSFException: JavaScript Error:
Internal Error: The following error occurred while executing this line:
c:\BuildDeployScripts\build.xml:338: Remote command failed with exit status -1
 at java.security.AccessController.doPrivileged(AccessController.java:250)
 at org.apache.bsf.BSFManager.exec(BSFManager.java:491)
 at org.apache.tools.ant.util.optional.ScriptRunner.executeScript(ScriptRunner.java:103)
 at org.apache.tools.ant.taskdefs.optional.Script.execute(Script.java:52)
 at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
 at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:618)
 at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
 at org.apache.tools.ant.Task.perform(Task.java:348)
(Continue reading)

Jason Ricles | 5 Feb 15:54 2015

conditional flatten mapping

I have the following flatten mapping in my ant file.

      <path id="build.classpath" path="${deplibs}"/>
      <pathconvert property="mf.classpath" refid="build.classpath" pathsep=" ">
        <flattenmapper/>
      </pathconvert>

However for a couple of the paths in the deplibs variable I want to
make these full instead of relative paths. Is there anyway to do a
conditional in the pathconvet in ant to say make these flat but do not
flatten these paths?
xeonmailinglist | 29 Jan 16:47 2015
Picon

Ant can't find -factorypath option

Hi,

I am using Apache Ant(TM) version 1.9.3 and during compilation I get the 
error below. It seems that ant does not recognize the option 
|-factorypath|. Is there a way to solve this?

|     [mkdir] Skipping
/home/vagrant/Programs/jikesrvm-3.0.0/target/FastAdaptiveGenMS_airavat_ia32-linux/syscall/java
because it already exists.
      [exec] Current OS is Linux
      [exec] Executing 'apt' with arguments:
      [exec] '-factorypath'
      [exec] '/home/vagrant/Programs/jikesrvm-3.0.0/target/tasks/classes'
      [exec] '-nocompile'
      [exec] '-factory'
      [exec] 'org.jikesrvm.tools.apt.SysCallProcessorFactory'
      [exec] '-classpath'
      [exec] '/home/vagrant/Programs/jikesrvm-3.0.0/target/tasks/classes:/home/vagrant/Programs/jikesrvm-3.0.0/target/vmmagic-stub/classes:/home/vagrant/Programs/jikesrvm-3.0.0/target/FastAdaptiveGenMS_airavat_ia32-linux/classes'
      [exec] '-s'
      [exec] '/home/vagrant/Programs/jikesrvm-3.0.0/target/FastAdaptiveGenMS_airavat_ia32-linux/syscall/java'
      [exec] '/home/vagrant/Programs/jikesrvm-3.0.0/rvm/src/org/jikesrvm/runtime/SysCall.java'
      [exec]
      [exec] The ' characters around the executable and arguments are
      [exec] not part of the command.
Execute:Java13CommandLauncher: Executing 'apt' with arguments:
'-factorypath'
'/home/vagrant/Programs/jikesrvm-3.0.0/target/tasks/classes'
'-nocompile'
'-factory'
'org.jikesrvm.tools.apt.SysCallProcessorFactory'
(Continue reading)


Gmane