The Artima Developer Community
Sponsored Link

Java Buzz Forum
ANT Phing Wrapper

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Fred Grott

Posts: 4361
Nickname: shareme
Registered: Jan, 2003

Fred Grott is Lead Developer-CEO of ShareMe Technologies LLC -The Mobile Future
ANT Phing Wrapper Posted: Sep 29, 2008 9:20 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Fred Grott.
Original Post: ANT Phing Wrapper
Feed Title: ShareMe Technologies LLC-The Mobile Future
Feed URL: http://www.jroller.com/shareme/feed/entries/rss
Feed Description: A Weblog about Java programming and digital convergence on mobile devices in such areas as P2P and collaborative technology.
Latest Java Buzz Posts
Latest Java Buzz Posts by Fred Grott
Latest Posts From ShareMe Technologies LLC-The Mobile Future

Advertisement
I am working on building some elgg plugins and widgets and thus need an ANT wrapper to drive Phing builds from my IDE. This is what I came up with, the name may change:

<?xml version="1.0" encoding="UTF-8"?>
<!-- PhingBuidler ANT Wrapper for calling Phing by Fred Grott
GPLv3.0, 2008.
blog: http://www.jroller.com/shareme
-->
<project name="PhingBuilder">

<property name="phing.command" value="phing" />
<property name="filename.command" value="-f"/>

<!-- Need to read in properties file denoting phing settings
Settings that are immutable and not changeable once set would
be the buildfile name, logger to be used, and etc.

env file name should be proejctname.phing.properties

other setings set in properties here and need to be
mutable are target name and etc.

Format:

exec command arg line

thus help target translates to

phing -help

we want the format to be

phing -otherargs(ant wrapper targets) -logger loggerproperty -f buildfilename.xml targetname(user console input)
-->
<!-- read in proejct.properties file here
-->
<property file="${user.home}/.${ant.project.name}-phing.properties"/>
<property file="${user.home}/.phing.properties"/>
<property file="${ant.project.name}-phing.properties"/>

<!-- - - - - - - - - - - - - - - - - -
target: -user.input.target
- - - - - - - - - - - - - - - - - -->
<target name="-user.input.target" description="gets user specificed phing build file target" depends="help">
<!-- Get user input phing build.xml target
-->
<input
message="Please enter phing target:"
addproperty="phing.user.target"
defaultvalue="all"
/>

</target>

<!-- ===================================
target: help
=================================== -->
<target name="help" description="Shows help information">
<exec dir="" executable="${phing.command}">
<arg line="-help" />
</exec>
</target>

<!-- =======================================
target: quiet
======================================= -->
<target name="quiet" description="Quiet operation with no output" depends="-user.input.target">
<exec dir="" executable="${phing.command}">
<arg line="-quiet ${filename.command} ${buildfn}.xml -logger ${logger} ${phing.user.target}" />
</exec>
</target>

<!-- =======================================
target: verbose
======================================= -->
<target name="verbose" description="Verbose output" depends="-user.input.target">
<exec dir="" executable="${phing.command}">
<arg line="-verbose ${filename.command} ${buildfn}.xml -logger ${logger} ${phing.user.target}"/>
</exec>
</target>

<!-- =======================================
target: debug
======================================= -->
<target name="debug" description="output debug information" depends="-user.input.target">
<exec dir="" executable="${phing.command}">
<arg line="-debug ${filename.command} ${buildfn}.xml -logger ${logger} ${phing.user.target}"/>
</exec>
</target>

<!-- =======================================
target: projecthelp
======================================= --> <target name="projecthelp" description="list targets for this project">
<exec dir="" executable="${phing.command}">
<arg line="-projecthelp"/>
</exec>
</target>

</project>

I do not know if the phing targets are the only item I should wrap as a user input item.

Read: ANT Phing Wrapper

Topic: No Shit, Sherlock Previous Topic   Next Topic Topic: iPod Touch 2nd Generation 1st Impression

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use