打開Hybris安裝文件夾下的recipes,隨便打開一個(gè)recipe的build.gradle文件,發(fā)現(xiàn)使用了installer-platform-plugin和installer-addon-plugin這兩個(gè)plugin. Groovy setup任務(wù)的邏輯,也就是使用這兩個(gè)plugin里的實(shí)現(xiàn),根據(jù)config實(shí)例化platform對(duì)象,然后調(diào)用其setup方法和executeAntTarget方法。
蒼溪ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)公司的ssl證書銷售渠道,可以享受市場價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:028-86922220(備注:SSL證書合作)期待與您的合作!
這兩個(gè)方法的實(shí)現(xiàn)源代碼在哪里?這就是本文所要描述的內(nèi)容。
去docs文件夾里可以找到插件的實(shí)現(xiàn)源代碼:

到源代碼里根據(jù)executeAntTarget進(jìn)行搜索:

在AbstractPlatform.groovy里找到了executeAntTarget的實(shí)現(xiàn)邏輯,發(fā)現(xiàn)其delegate到了成員屬性antExecutor里:

這個(gè)antExecutor的類型是HybrisAntExecutor:

找到HybrisAntExcutor,發(fā)現(xiàn)其只不過是調(diào)用類HybrisPluginUtils的靜態(tài)方法:

實(shí)現(xiàn)核心:
private static void runExternalProcess(String workDir, String[] command, Closure closure) {
def builder = new DefaultExecHandleBuilder()
builder.setWorkingDir((new File(workDir)).absolutePath)
builder.setCommandLine(command)
if (closure) closure.call(builder)
def handle = builder.build()
handle.start()
def result = handle.waitForFinish()
if (result.getExitValue() != 0) {
throw new IllegalStateException("external process returned non-zero exit code, command: ${command}")
}
}
當(dāng)前標(biāo)題:SAPHybris使用recipe進(jìn)行安裝時(shí),是如何執(zhí)行ant命令的?-創(chuàng)新互聯(lián)
本文URL:http://www.chinadenli.net/article6/ccpoig.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)網(wǎng)站制作、網(wǎng)站收錄、外貿(mào)建站、微信公眾號(hào)、網(wǎng)站改版、微信小程序
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)