ant - How to identify if a file is copied from a particular archive? -
i new ant.
i have specific scenario handle in this:
step-1: need pattern of filenames in ear files. if pattern matches need extract files. step-2: , if file extracted ear (similar zip-file) file, need search set of files, , re-create set of files too.
the case handle "how identify if file copied particular archive" if found proceed step 2, else move next archive.
i have achieved step-1 no thought how accomplish step-2.
step-1
<!-- set via arguments passed --> <patternset id="pattern.needtocopy" includes="${needtocopyfile.pattern}" excludes="${ignore.pattern}"> </patternset> <target name="get-binaries-from-baseline"> <for param="binary"> <path> <fileset dir="${baseline.dir}/target/aaa/bbb/ccc" includes="*.ear" /> </path> <sequential> <basename file="@{binary}" property="@{binary}.basename" /> <unzip src="@{binary}" dest="${baseline.dir}"> <patternset refid="pattern.needtocopy" /> <mapper type="flatten" /> </unzip> </sequential> </for> </target>
step-2:
????
need help in this.
thanks.
well resolved same, using groovy script based on resources find.
<target name="findjars"> <zipfileset id="found" src="${ear-name}"> <patternset refid="${patternsetref}" /> </zipfileset> <groovy> project.references.found.each { println it.name println project.properties.'ear-name' println project.properties.'dest.dir' } </groovy> </target>
and added task takes filename , ear-file-name input , extracts related jars based on file search pattern.
ant
No comments:
Post a Comment