本文整理匯總了Java中org.gradle.api.Project.getDependencies方法的典型用法代碼示例。如果您正苦於以下問題:Java Project.getDependencies方法的具體用法?Java Project.getDependencies怎麽用?Java Project.getDependencies使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.gradle.api.Project
的用法示例。
在下文中一共展示了Project.getDependencies方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addStandardJavaTestDependencies
import org.gradle.api.Project; //導入方法依賴的package包/類
private static void addStandardJavaTestDependencies(Project project) {
Configuration testConfiguration =
project.getPlugins().hasPlugin(JavaLibraryPlugin.class)
? project
.getConfigurations()
.getByName(JavaPlugin.TEST_IMPLEMENTATION_CONFIGURATION_NAME)
: project.getConfigurations().getByName(JavaPlugin.TEST_COMPILE_CONFIGURATION_NAME);
DependencyHandler dependencies = project.getDependencies();
dependencies.add(JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME, "com.google.code.findbugs:jsr305");
dependencies.add(testConfiguration.getName(), "org.curioswitch.curiostack:curio-testing-framework");
dependencies.add(testConfiguration.getName(), "org.assertj:assertj-core");
dependencies.add(testConfiguration.getName(), "org.awaitility:awaitility");
dependencies.add(testConfiguration.getName(), "junit:junit");
dependencies.add(testConfiguration.getName(), "org.mockito:mockito-core");
dependencies.add(testConfiguration.getName(), "info.solidsoft.mockito:mockito-java8");
}
示例2: execute
import org.gradle.api.Project; //導入方法依賴的package包/類
@Override
public void execute(Project project) {
DependencyHandler dependencies = project.getDependencies();
Set<SourceSet> testSourceSets = extension.getTestSourceSets();
for (SourceSet testSourceSet : testSourceSets) {
String compileConfigurationName = testSourceSet.getCompileConfigurationName();
dependencies.add(compileConfigurationName, dependencies.gradleTestKit());
String runtimeConfigurationName = testSourceSet.getRuntimeConfigurationName();
dependencies.add(runtimeConfigurationName, project.files(pluginClasspathTask));
}
}
示例3: applyDependencies
import org.gradle.api.Project; //導入方法依賴的package包/類
private void applyDependencies(Project project) {
DependencyHandler dependencies = project.getDependencies();
dependencies.add(COMPILE_CONFIGURATION, dependencies.gradleApi());
}