0
私はantビルドファイルを初めて使用しています。 は現在、私はとビルドのファイルのリストを取得:Antビルドのコピータスクの前にファイルの名前を変更
a.cls
b.cls
c.cls
が、私の地元では、私は同じディレクトリに、ファイル上に構築を実行する必要があります。
a-meta.cls
b-meta.cls
c-meta.cls
ここmeta
キーワードは一貫したままになります。私は次のbuild.xmlファイルを使用しています。実際にファイルをコピーする前に、ファイル名をどのように変更するのかよく分かりません。私はreplace
とmapper
と他のantlib
タスクを試しました。しかし、役に立たない。
<project name="test" default="compile">
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="lib/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<loadfile property="file" srcfile="filesToMove.txt"/> <!-- these are the list of files, i mentioned earlier -->
<target name="compile">
<echo>${file}</echo> <!-- here i have to rename file name to include -meta -->
<copy file="./classes/${file}" tofile="./src/classes/${file}" overwrite="true"/>
</target>
</project>
ファイルを移動する前に名前を変更する方法。
ファイルを移動するのではなくコピーしているようです。元の名前のソースから新しい名前の(メタが付いた)宛先へのコピーが要件を満たしていますか? –
これを解決しました...答えとして更新されます –