.properties
一度に 2 つの異なるファイルを参照する ant スクリプトを取得できるかどうか、もし可能であれば、これを達成する方法を知りたいです。
.properties
2 つのファイルに含まれるプロパティは相互に排他的であると仮定します。つまり、同じプロパティが 2 回表示されることはありません。
ありがとう!
.properties
一度に 2 つの異なるファイルを参照する ant スクリプトを取得できるかどうか、もし可能であれば、これを達成する方法を知りたいです。
.properties
2 つのファイルに含まれるプロパティは相互に排他的であると仮定します。つまり、同じプロパティが 2 回表示されることはありません。
ありがとう!
antスクリプトに複数のエントリを持つプロパティファイルをいくつでもインポートできるはずです<property file="...">
(私が見逃した質問に微妙な点がない限り)。antプロパティは不変であり、最初にプロパティを設定した人が「勝つ」ため、重複するプロパティは問題ありません。
見る詳細については、 http://ant.apache.org/manual/Tasks/property.htmlを参照してください。
You can use a different prefix
attribute of property
task, e.g
<property file="file1.properties" prefix="file1"/>
<property file="file2.properties" prefix="file2"/>
This way you can find out if both files have same properties and differentiate between them in your build script. For example if both files have property test
, then after they are loaded with the above commands you will end up with properties named file1.test
and file2.test
.