我有一个 self.driver.find_element(By.ID, "templateName").click()
self.driver.find_element(By.ID, "templateName").send_keys("Test")
self.driver.find_element(By.ID, "type").click()
dropdown = self.driver.find_element(By.ID, "type")
dropdown.find_element(By.XPATH, "//option[. = 'test']").click()
self.driver.find_element(By.ID, "file-upload").send_keys(os.getcwd() + "/picture.png")
文件,其中包含一个build.gradle
块中的存储库定义,如下所示:
buildscript
我想buildscript {
repositories {
// Several proprietary repositories are declared
}
dependencies {
classpath "com.example:foo:1.0"
}
}
apply from: "bar.gradle"
从bar.gradle
依赖项导入一个类。根据{{3}},这样做的方法是在foo
中复制buildscript
块。
但是,我想减少代码重复,因为存储库列表很长并且可能会更改。可以让bar.gradle
引用父bar.gradle
中声明的存储库吗?
到目前为止,我在build.gradle
中尝试过:
bar.gradle
但是不幸的是,我仍然收到一条错误消息,提示未定义存储库。
答案 0 :(得分:0)
如果您未在buildscript
中应用某些内容,则您的构建脚本将无法引用
尝试...
buildscript.gradle
project.buildscript {
repositories {
someRepo()
}
dependencies{
classpath 'some:dependency:0.1.0'
}
}
build.gradle
buildscript {
apply from: "buildscript.gradle"
}