You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Dan Peder Eriksen <da...@online.no> on 2002/08/23 13:16:57 UTC

Init and clean

Hi!

In init I create a dir, build. I compile all my java files there and make a 
jar file of them.
Then I delete the build dir. The problem is that if the compile failes the 
build dir
doesnt get deleted because clean depends on it. If I remove the dependends 
clean
doesnt get runned no matter what.

Any ideas on how to do this?

Dan



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Computed ids not visible in sub projects?

Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 23 Aug 2002, Fei Sha <Fe...@prism.uvsq.fr> wrote:

> 	<path id="${cpid}">

> 		<java classname="test">
> 			<classpath refid="${cpid}" />		

> The "classpath_id" is not visible in the sub project.
> If I hard code the name as:
> 
> 	<path id="classpath_id">

> Then it works fine. Is this intended behavior?

In a way, yes.  Properties are not expanded in the id attribute, so
your path has the literal id ${cpid}.

> Another thing, when u want to see the value of a variable, u just
> echo ${v} anyway similar to see what an id refers to?

By using a helper property and <property>'s refid attribute.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Computed ids not visible in sub projects?

Posted by Fei Sha <Fe...@prism.uvsq.fr>.
Hi, all
	I have a build file like this:

----------------------------------------------------

<project name="x" default="x">

	<property name="cpid" value="classpath_id" />
	
	<path id="${cpid}">
		<pathelement location="."/>
	</path>

	<target name="x">		
		<antcall
			target="y"
			inheritrefs="true" >
		</antcall>
	</target>
	
	<target name="y">		
		<java classname="test">
			<classpath refid="${cpid}" />		
		</java>
	</target>
	
</project>

-----------------------------------------------------

E:\exmlmedia\qa>ant -f x.xml
Buildfile: x.xml

x:

y:
      [java] Reference classpath_id not found.

BUILD SUCCESSFUL
Total time: 3 seconds

The "classpath_id" is not visible in the sub project.
If I hard code the name as:

	<path id="classpath_id">
		<pathelement location="."/>
	</path>

Then it works fine. Is this intended behavior?

Another thing, when u want to see the value of a variable, u just echo ${v}
anyway similar to see what an id refers to?

Thanks!

Fei Sha


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Init and clean

Posted by Jesse Stockall <je...@cryptocard.com>.
On Fri, 2002-08-23 at 07:16, Dan Peder Eriksen wrote:
> Hi!
> 
> In init I create a dir, build. I compile all my java files there and make a 
> jar file of them.
> Then I delete the build dir. The problem is that if the compile failes the 
> build dir
> doesnt get deleted because clean depends on it. If I remove the dependends 
> clean
> doesnt get runned no matter what.

If you are using <javac> to compile the code, you can set the
failonerror attribute so that the build will continue, even if the
compile fails.

Jesse

-- 
 Jesse Stockall			|	Tel: 1+ 613.599.2441 ext. 243
 CRYPTOCard Corporation		|	Fax: 1+ 613.599.2442	 	
 Suite 304, 300 March Rd.	|	email: jesse@cryptocard.com
 Ottawa, ON, Canada K2K 2E2	|	web: www.cryptocard.com 
---------------------------------------------------------------------


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Init and clean

Posted by Joey Gibson <jo...@joeygibson.com>.
On Fri, 23 Aug 2002 13:16:57 +0200, Dan Peder Eriksen <da...@online.no>
wrote:

||| In init I create a dir, build. I compile all my java files there and make a 
||| jar file of them.
||| Then I delete the build dir. The problem is that if the compile failes the 
||| build dir
||| doesnt get deleted because clean depends on it. If I remove the dependends 
||| clean
||| doesnt get runned no matter what.

You could set failonerror on the javac task to false. This would keep the
build moving. Obviously you'd need to do something else then to make
certain that you don't overlook compilation errors. Just a question though
is why do you want to delete the build directory at this point? That's
generally what a "clean" target is for, allowing you to do something like
"ant clean build" to first remove the old build directory then do a build.

Joey

--
Oh great. My dog found the chainsaw...



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>