程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> JAVA編程 >> 關於JAVA >> ivy中文參考文檔(13)-ant任務(1)-buildlist

ivy中文參考文檔(13)-ant任務(1)-buildlist

編輯:關於JAVA

buildlist任務用於獲取按照ivy依賴信息從小到大排序的文件(通常是build.xml文件) 列表,或者相反(從1.2之後)

這個任務在結合subant構建相關項目集合時特別有效, 可以確保依賴在其他依賴它的模塊之前被構建。

當你要排序的模塊的ivy.xml不包含修訂版本號,在依賴上定義的rev屬性將不被使用。

當你要排序的模塊的ivy.xml包含修訂版本號,修訂版本號將被使用。如果修訂版本號和依賴描述不匹配,將會記錄警告日志而模塊被 認為是不同的模塊.

從1.3版本起,root屬性也可以用來在找到的所有模塊之中只選擇依賴(不管式直接還是間接)root模塊的模塊。可以和excluderoot屬性 同時使用,當設置為true時將從列表中排除root自己。

從1.4版本起, leaf屬性也可以用來在找到的所有模塊之中只選擇依賴(不管式直接還是間接)leaf模塊的模塊。可以和excludeleaf屬性 同時使用,當設置為true時將從列表中排除leaf自己。

從1.4版本起, 在這個任務執行之後ivy.sorted.modules屬性將在ant中設置,值為逗號分隔的排序好的模塊列表。這可以用於調試或者 報告。

從2.0版本起,root和leaf屬性可以是用來作為root的模塊的分隔列表。這些模塊和他們所有的模塊將被包含在構建列表中。

從2.0版本起,默認所有循環依賴的模塊將被組合,以便在這個循環中的任何模塊的任何依賴都在循環中的模塊前出現。如果有一個依 賴路徑在模塊A和B之間(但是沒有從B到A的依賴路徑),B將在A之前出現,即使A被包含在一個用來排序的模塊集合的循環中。

從2.0版本起,當你指定roo和leaf模塊你可以限制結果列表為只有root模塊的直接依賴或者leaf模塊的直接依賴。

從2.0版本起,你可以指定一個restartFrom模塊。和root或者leaf不同的是,你可以得到一個從restartFrom模塊開始的,後面是如果 這個參數沒有設置時應該在後面的所有模塊,的文件列表,(即使沒有依賴在restartFrom和後面的模塊之間)

屬性 描述 要求 reference the reference of the path to set
要設置的路徑引用 Yes ivyfilepath the relative path from files to order to corresponding ivy files
從文件到對應的ivy文件的相對路徑 No. 默認為 ${ivy.buildlist.ivyfilepath} root since 2.0 the names of the modules which should be considered as the root of the buildlist.
從2.0起 模塊名 (可以是多個)將被認為是構建列表的root
since 1.3 Was limited to only one module name before 2.0.
從1.3起在2.0前被 限制為只能設置一個模塊名 No. 默認沒有root (在構建列表中所有模塊都將被使用) excluderoot since 1.3 true if the root defined should be excluded from the list
從1.3起 true如果需要將定義的root排除在 列表之外 No. 默認是false leaf since 2.0 the names of the modules which should be considered as the leaf of the buildlist.
從2.0起 模塊名 (可以是多個)將被認為是構建列表的leaf
since 1.4.1 Was limited to only one module name before 2.0.
從1.4.1起在2.0 前被限制為只能設置一個模塊名 No. 默認沒有leaf (在構建列表中所有模塊都將被使用) onlydirectdep since 2.0 true if the
resulting list should be restricted to direct dependencies of root modules or modules that directly depends on the leaf modules.
This field is ignored when neither root neither leaf is filled.
從2.0起 true如果結果列表被限制為root模塊的直接依賴或者直接依賴leaf模塊。當root和leaf都沒有被設置時這個屬性將 被忽略 No. 默認是false delimiter since 2.0 delimiter to use when specifying multiple module names in the root and leaf properties.
從2.0起 當指定多個模塊名時在root和leaf屬性中使用的分隔符 No. 默認是逗號(,). excludeleaf since 1.4.1 true if the leaf defined should be excluded from the list
從1.4.1起 true如果需要將定義的leaf排 除在列表之外 No. 默認是false haltonerror true to halt the build when an invalid ivy file is encountered, false to continue
當遇到一個無效的ivy文件 時,true終止構建,false繼續 No. 默認是true skipbuildwithoutivy Deprecated, use onMissingDescriptor instead. true to skip files of the fileset with no corresponding ivy file, false otherwise. If false the file with no corresponding ivy file will be considered as independent of the other and put at the beginning of the built filelist.
申明不贊成繼續使用,請使用onMissingDescripto。 No. 默認是false onMissingDescriptor since 2.0 Specify the action to take when no module descriptor file is found for a file of the fileset. Possible values are:
從2.0起 當文件集合中的一個文件找不到模塊描述文件時指定處理動作:
head
put at the head of the built filelist.
tail
put at the tail of the built filelist.
skip
skip the file, which won't be put in the build filelist at all.
warn
warn and put at the head of the build filelist.
fail
halt the build with a failure. No. Defaults to 'head' reverse true to obtain the list in the reverse order, i.e. from the most dependent to the least one
true 用於獲取 倒敘排列的列表。例如從最大依賴到最小 No. 默認是 false restartFrom since 2.0 The name of the module which should be considered as the starting point in the buildlist. This allows for the build to be started at any point in the dependency chain.
從2.0起 被認為是構建列表的起點的模塊的名字。這容許 構建從依賴鏈的任意節點開始。 No. 默認沒有restart point (在構建列表中所有模塊都將被使用). settingsRef since 2.0 A reference to the ivy settings that must be used by this task
從2.0起 必須被這個任務使用的ivy設 置的一個引用。 No, 默認使用'ivy.instance'.

內嵌元素參數說明

fileset

文件集合用於選擇文件集合來排序。

范例:

<ivy:buildlist reference="build-path">
       <fileset dir="projects" includes="**/build.xml"/>
     </ivy:buildlist>

構建一個build.xml文件列表,根據在相同級別上找到的ivy.xml文件(ivyfilepath的默認值是ivy.xml)來排序。

然後這個列表可以像這樣被使用:

<subant target="build" buildpathref="build-path" />
     <ivy:buildlist reference="build-path" ivyfilepath="ivy/ivy.xml" reverse="true">
       <fileset dir="projects" includes="**/build.xml"/>
     </ivy:buildlist>

構建一個build.xml文件列表,根據在這些構建文件相對的ivy目錄下找到的ivy.xml文件(ivyfilepath的默認值是ivy.xml)來排序。列 表被從最多依賴到最少排序。

<ivy:buildlist reference="build-path" ivyfilepath="ivy/ivy.xml" root="myapp">
       <fileset dir="projects" includes="**/build.xml"/>
     </ivy:buildlist>

構建一個build.xml文件列表,根據在這些構建文件相對的ivy目錄下找到的ivy.xml文件(ivyfilepath的默認值是ivy.xml)來排序。僅 有是myapp的依賴的模塊(不管是直接還是間接)的build.xml被放置在結果列表中。

<ivy:buildlist reference="build-path" ivyfilepath="ivy/ivy.xml" leaf="mymodule">
       <fileset dir="projects" includes="**/build.xml"/>
     </ivy:buildlist>

構建一個build.xml文件列表,根據在這些構建文件相對的ivy目錄下找到的ivy.xml文件(ivyfilepath的默認值是ivy.xml)來排序。僅 有是依賴mymodule的模塊(不管是直接還是間接)的build.xml被放置在結果列表中。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved