ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject Ensure Build Failed if fileset contains no jars
Date Wed, 17 Aug 2005 14:20:29 GMT

Hi,

Problem =

my script contains a target with two filesets.
If the compile -done in another script- fails, there are only empty
folders, 
but no jars in it.

If compile successful it looks like =

dist/lib
        /Toplevel
	/project1
	/project2

if compile failed it looks like that =

dist/lib
        /Toplevel

<target name="publish">
     
     <fileset id="jarsfolder" dir="./temp/dist/lib/Toplevel"
includes="**/*"/>
     <fileset id="jarsonly"   dir="./temp/dist/lib/Toplevel"
includes="**/*.jar"/>
     
        <copy todir="${safir.jar.deploy}safir" overwrite="true">
            <fileset refid="jarsfolder"/>
        </copy>
        
        
        <move todir="./jars" flatten="true">
            <fileset refid="jarsonly"/>
        </move>
        
    <!-- Move von Auftrag.txt und *.doc -->    
        <move file="${safir.txtquelle}${wordfile_move}"
todir="${safir.txtziel}/temp"/>   
        <move file="${auftragtxt}" todir="${safir.txtziel}"/>

<target name="clean" depends="publish">
<delete includeemptydirs="yes">        
            <fileset dir="C:/cc_safir_workdir/checkout"
defaultexcludes="no">
                <include name ="**/*"/> 
                <exclude name="**/jars/*"/>
                <exclude name="**/SAFIR Build/**"/>
            </fileset> 
         </delete>


the filesets jarsfolder and jarsonly exist but only as empty
directories, containing
no jars as compile in another script failed.

The script runs successful =

Buildfile: publisher.xml

publish:

  *** those are the txt and doc files that shouldnt be moved,
       when compile in other script failed and no jars available ***

     [move] Moving 1 file to C:\deployserver\liefern\prod\temp
     [move] Moving 1 file to C:\deployserver\liefern\prod

clean:
   [delete] Deleting 1831 files from C:\cc_safir_workdir\checkout
   [delete] Deleted 175 directories from C:\cc_safir_workdir\checkout

BUILD SUCCESSFUL

Question : The script should fail, if there are no jars beyond the
toplevel directory.

How to get a Build Failed when there are only empty folders ?


Regards, Gilbert

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


Mime
View raw message