根目錄檔是必須隨 Eclipse 安裝封裝的檔案,但其並非特性或外掛程式。常見的例子是 Eclipse 執行檔和 ini 檔,以及授權檔。
含有適當根內容的特性會提供根目錄檔給建置。
root |
指定要併入要建置之所有配置中的檔案或資料夾清單(以逗點區隔)。 相對路徑會相對於包含特性。請使用 "file:" 來指定檔案,而 "absolute:" 則表示使用絕對路徑。 範例:
每一個以逗點區隔的項目都會成為一個檔案集。如果項目代表資料夾,則該資料夾會是檔案集的 "dir" 參數,且會使用 "**" 作為 "includes" 參數。如果項目是檔案,則該檔案的包含目錄會成為 "dir" 參數,且該檔案會指定在 "includes" 參數中。 針對所有關聯的檔案,會在目錄中使用 ${baseDir} 內容。這個 ${baseDir} 內容是特性的根目錄,其中包含產生的 build.xml 檔。 |
root.<config> |
指定給定配置要併入的檔案或資料夾清單。這裡指定的配置應該對應於建置之 configs 內容中的配置。
相對路徑會相對於包含特性。"root" 內容中使用的相同 "file:" 和 "absolute:" 字首也適用於這裡。 範例:
|
root.folder.<subfolder> root.<config>.folder.<subfolder> |
與 "root" 和 "root.<config>" 內容類似,但是檔案和資料夾會複製到給定的子資料夾中,而不會複製到 Eclipse 安裝的根目錄。
相對路徑會相對於包含特性。"root" 內容中使用的相同 "file:" 和 "absolute:" 字首也適用於這裡。 範例:
|
root.permissions.<rights> root.<config>.permissions.<rights> |
指定要對其執行 ant chmod 作業的檔案清單。這個內容的值會當作 "includes" 參數傳給 ant chmod 作業。這表示您可以使用 ant 萬用字元型樣。 範例:
內容的 <rights> 部分實際上會當作 "perm" 參數傳給 ant chmod 作業。如果配置最終的保存檔格式是 antTar,則 <rights> 格式也會當作 "filemode" 參數傳給 ant tarfileset。antZip 和 zipfileset 也很類似。雖然 ant chmod 作業支援 "og-rwx" 之類的許可權(使得非擁有者無法接觸檔案),但是 tar 和 zip 檔案集只支援 3 位數的八進位字串。 |
root.link root.<config>.link |
成對列出需要符號鏈結的檔案和資料夾(以逗點區隔)。配對的第一個項目是目標,第二個項目是鏈結名稱。 範例:
這會產生 ant exec 作業來執行 "ln -sf" 指令。假設值為 "targetA, nameA, targetB, nameB, targetC, nameC",則會在收集 Eclipse rootfile 的資料夾中執行一組 "ln" 指令: ln -sf targetA nameA ln -sf targetB nameB ln -sf targetC nameC |
在根據特性使用 .product 檔時,您只要在任一併入特性中指定上述 rootfile 內容,即可將 rootfile 加入產品中。
您可以併入一個特性,僅供提供 rootfile 之用。如果這個 "rootfile" 特性未在其 build.properties 檔中指定 "bin.includes" 內容,其不會併入最終的建置結果中,但是其提供的 rootfile 則會。
如果 .product 檔是以外掛程式而非特性為基礎,rootfile 仍然可以加入建置中。在產品建置中,「PDE/建置」會自動產生儲存器特性,來併入 .product 檔中指定的所有外掛程式(請參閱 eclipse.generateFeature 作業)。將 rootfile 加入這個產品建置有兩種方式:
${buildDirectory}/features/org.foo.rootfile.feature/rootfiles/*
/build.properties : root = rootfiles
${buildDirectory}/build.properties: featureList = org.foo.rootfile.feature
${buildDirectory}/build.properties: generatedBuildProperties = ${buildDirectory}/root.properties
${buildDirectory/root.properties: root = absolute:${buildDirectory}/rootfiles
${buildDirectory}/rootfiles/*