2017-01-18 10 views
2

私は3つのxmlファイルbuild.xml, build_1.xml, build_2.xmlを持っています。 build_1.xml, build_2.xmlファイルの名前は「compress」です。Ant build.xmlから別のxmlファイルを呼び出す方法

私は私が呼ぶとき、「ant compress 1」はbuild_1.xmlファイルから圧縮対象を実行することをbuild.xmlファイルを設定し、それに応じて「ant compress 2」の場合にはbuild_2.xmlから圧縮ターゲットを実行するにはどうすればよいですか?

+0

http://stackoverflow.com/a/25207678/1422630をdepends = ""他のxmlターゲットを選択することができます –

答えて

2

私はあなたの質問を理解して、あなたのbuild.xmlファイルに次の2つのターゲット必要があるだろうhttps://ant.apache.org/manual/Tasks/ant.html

を参照してください:スルー、

<target name="ant compress 1"> 
    <ant antfile="build_1.xml" target="compress"/> 
</target> 

<target name="ant compress 2"> 
    <ant antfile="build_2.xml" target="compress"/> 
</target> 
+0

ありがとうございます。 – Lusi

+0

build.xmlの別のターゲットから "ant compress 1"の呼び出しを作成する方法はありますか? –

+0

@AquariusPowerチェックhttps://ant.apache.org/manual/Tasks/antcall.html – toongeorges

関連する問題