2017-07-25 97 views
0

/路徑/腳本gradle這個從申請:不使用父腳本目錄

foo.gradle 
    apply from: 'bar.gradle' 

bar.gradle 

/路/工作

build.gradle 
    apply from: '/path/script/foo.gradle' 

錯誤:bar.gradle是找不到的。

Gradle正在尋找它在當前的工作目錄/路徑/工作。它應該根據其父腳本的目錄解析相對路徑。

回答

0

不,應該不能解決基於其父腳本的目錄的相對路徑,因爲這不是在the docs什麼規定:

...,並按照上面的鏈接,.. 。

Resolves a file path to a URI, relative to the project directory of this project.

由於Project範圍被施加到腳本,應用從有與從原始腳本應用它的另一腳本文件。