新增檔案至建置的根目錄

根目錄檔是必須隨 Eclipse 安裝封裝的檔案,但其並非特性或外掛程式。常見的例子是 Eclipse 執行檔和 ini 檔,以及授權檔。
含有適當根內容的特性會提供根目錄檔給建置。

根目錄檔的內容

root
指定要併入要建置之所有配置中的檔案或資料夾清單(以逗點區隔)。
相對路徑會相對於包含特性。請使用 "file:" 來指定檔案,而 "absolute:" 則表示使用絕對路徑。
範例:
  • root=rootfiles:資料夾的相對路徑,包括資料夾的內容
  • root=file:license.html,licenses:"license.html" 檔的相對路徑,以及 "licenses" 資料夾的相對路徑
  • root=absolute:/eclipse/rootfiles:資料夾的絕對路徑,包括資料夾的內容
  • root=absolute:file:/eclipse/about.html,file:lib/*.so*:包括 "about.html" 的絕對路徑,以及包括 lib 資料夾下所有 *.so* 檔的絕對路徑。

每一個以逗點區隔的項目都會成為一個檔案集。如果項目代表資料夾,則該資料夾會是檔案集的 "dir" 參數,且會使用 "**" 作為 "includes" 參數。如果項目是檔案,則該檔案的包含目錄會成為 "dir" 參數,且該檔案會指定在 "includes" 參數中。

針對所有關聯的檔案,會在目錄中使用 ${baseDir} 內容。這個 ${baseDir} 內容是特性的根目錄,其中包含產生的 build.xml 檔。

root.<config>
指定給定配置要併入的檔案或資料夾清單。這裡指定的配置應該對應於建置之 configs 內容中的配置。 相對路徑會相對於包含特性。"root" 內容中使用的相同 "file:" 和 "absolute:" 字首也適用於這裡。
範例:
  • root.win32.win32.x86=rootfiles:資料夾的相對路徑,資料夾的內容包含在 win32.win32.x86 配置中
  • root.linux.gtk.x86=absolute:file:about.html:包含在 linux.gtk.x86 配置中之檔案的絕對路徑。
root.folder.<subfolder>

root.<config>.folder.<subfolder>
與 "root" 和 "root.<config>" 內容類似,但是檔案和資料夾會複製到給定的子資料夾中,而不會複製到 Eclipse 安裝的根目錄。
相對路徑會相對於包含特性。"root" 內容中使用的相同 "file:" 和 "absolute:" 字首也適用於這裡。
範例:
  • root.folder.docs/html=html_files:特性的 "html_files" 資料夾的內容會複製到 Eclipse 安裝的 docs/html 資料夾中。
  • root.linux.gtk.x86.folder.jre=absolute:/build/jres/linux:絕對路徑,/build/jres/linux 資料夾的內容會複製到 Eclipse 安裝的 jre 資料夾中。
當.product 檔中指定了 JRE 進行匯出時,PDE/UI 會使用這些內容。「PDE/建置」目前不支援P利用 .product 檔來併入 JRE,且這些內容需要指定在特性中,才能在遠端控制產品建置中併入 JRE。
root.permissions.<rights>

root.<config>.permissions.<rights>
指定要對其執行 ant chmod 作業的檔案清單。這個內容的值會當作 "includes" 參數傳給 ant chmod 作業。這表示您可以使用 ant 萬用字元型樣。
範例:
  • root.permissions.755=eclipse:設定 'eclipse' 檔具有執行檔許可權。
  • root.linux.gtk.x86.permissions.755=lib/**:將 lib 目錄下的所有檔案都設為執行檔

內容的 <rights> 部分實際上會當作 "perm" 參數傳給 ant chmod 作業。如果配置最終的保存檔格式是 antTar,則 <rights> 格式也會當作 "filemode" 參數傳給 ant tarfileset。antZip 和 zipfileset 也很類似。雖然 ant chmod 作業支援 "og-rwx" 之類的許可權(使得非擁有者無法接觸檔案),但是 tar 和 zip 檔案集只支援 3 位數的八進位字串。
root.link

root.<config>.link
成對列出需要符號鏈結的檔案和資料夾(以逗點區隔)。配對的第一個項目是目標,第二個項目是鏈結名稱。
範例:
  • root.macosx.carbon.ppc.link=Eclipse.app/Contents/MacOS/eclipse,eclipse:在 macosx.carbon.ppc 配置中,於名稱為 "eclipse" 的根目錄中建立軟鏈結,以指向 "Eclipse.app/Contents/MacOS/eclipse" 檔。

這會產生 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 加入這個產品建置有兩種方式: