部分继承配置的依赖关系

时间:2016-04-30 13:49:21

标签: gradle dependencies build.gradle

如果我在配置preRuntime中有一些依赖项,并希望配置运行时继承它们,除了一对,有一种方法可以在gradle中执行以下操作:

 import cv as cv2
cv2.namedWindow("preview")
vc = cv2.VideoCapture(0)

if vc.isOpened(): # try to get the first frame
    rval, frame = vc.read()
else:
    rval = False

while rval:
    cv2.imshow("preview", frame)
    rval, frame = vc.read()
    key = cv2.waitKey(20)
    if key == 27: # exit on ESC
        break
cv2.VideoCapture.open(0)

cv2.destroyWindow("preview")

1 个答案:

答案 0 :(得分:0)

我最终做了:

dependencies{
    runtime project.configurations.getByName('preRuntime')
        .filter {it.name != 'bar'}
}