本文整理匯總了Java中org.gradle.plugins.ide.idea.model.Dependency類的典型用法代碼示例。如果您正苦於以下問題:Java Dependency類的具體用法?Java Dependency怎麽用?Java Dependency使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Dependency類屬於org.gradle.plugins.ide.idea.model包,在下文中一共展示了Dependency類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: provide
import org.gradle.plugins.ide.idea.model.Dependency; //導入依賴的package包/類
public Set<Dependency> provide(final IdeaModule ideaModule) {
getPath = new Transformer<FilePath, File>() {
@Override
@Nullable
public FilePath transform(File file) {
return file != null ? ideaModule.getPathFactory().path(file) : null;
}
};
Set<Dependency> result = new LinkedHashSet<Dependency>();
if (ideaModule.getSingleEntryLibraries() != null) {
for (Map.Entry<String, Iterable<File>> singleEntryLibrary : ideaModule.getSingleEntryLibraries().entrySet()) {
String scope = singleEntryLibrary.getKey();
for (File file : singleEntryLibrary.getValue()) {
if (file != null && file.isDirectory()) {
result.add(new SingleEntryModuleLibrary(getPath.transform(file), scope));
}
}
}
}
result.addAll(provideFromScopeRuleMappings(ideaModule));
return result;
}
示例2: extractDependencies
import org.gradle.plugins.ide.idea.model.Dependency; //導入依賴的package包/類
/** Looks for dependencies contained in all configurations to remove them from multimap and return as result. */
private List<IdeDependencyKey<?, Dependency>> extractDependencies(Multimap<IdeDependencyKey<?, Dependency>, String> dependenciesToConfigs,
Collection<String> configurations, Collection<String> minusConfigurations) {
List<IdeDependencyKey<?, Dependency>> deps = new ArrayList<IdeDependencyKey<?, Dependency>>();
List<IdeDependencyKey<?, Dependency>> minusDeps = new ArrayList<IdeDependencyKey<?, Dependency>>();
for (IdeDependencyKey<?, Dependency> dependencyKey : dependenciesToConfigs.keySet()) {
if (dependenciesToConfigs.get(dependencyKey).containsAll(configurations)) {
boolean isInMinus = false;
for (String minusConfiguration : minusConfigurations) {
if (dependenciesToConfigs.get(dependencyKey).contains(minusConfiguration)) {
isInMinus = true;
break;
}
}
if (!isInMinus) {
deps.add(dependencyKey);
} else {
minusDeps.add(dependencyKey);
}
}
}
for (IdeDependencyKey<?, Dependency> key : Iterables.concat(deps, minusDeps)) {
dependenciesToConfigs.removeAll(key);
}
return deps;
}
示例3: provide
import org.gradle.plugins.ide.idea.model.Dependency; //導入依賴的package包/類
Set<Dependency> provide(final IdeaModule ideaModule) {
getPath = new Function<File, FilePath>() {
@Nullable
public FilePath apply(File file) {
return file != null ? ideaModule.getPathFactory().path(file) : null;
}
};
Set<Dependency> result = new LinkedHashSet<Dependency>();
if (ideaModule.getSingleEntryLibraries() != null) {
for (Map.Entry<String, Iterable<File>> singleEntryLibrary : ideaModule.getSingleEntryLibraries().entrySet()) {
String scope = singleEntryLibrary.getKey();
for (File file : singleEntryLibrary.getValue()) {
if (file != null && file.isDirectory()) {
result.add(new SingleEntryModuleLibrary(getPath.apply(file), scope));
}
}
}
}
result.addAll(provideFromScopeRuleMappings(ideaModule));
return result;
}
示例4: extractDependencies
import org.gradle.plugins.ide.idea.model.Dependency; //導入依賴的package包/類
/** Looks for dependencies contained in all configurations to remove them from multimap and return as result. */
List<IdeDependencyKey<?, Dependency>> extractDependencies(Multimap<IdeDependencyKey<?, Dependency>, String> dependenciesToConfigs,
Collection<String> configurations, Collection<String> minusConfigurations) {
List<IdeDependencyKey<?, Dependency>> deps = new ArrayList<IdeDependencyKey<?, Dependency>>();
List<IdeDependencyKey<?, Dependency>> minusDeps = new ArrayList<IdeDependencyKey<?, Dependency>>();
for (IdeDependencyKey<?, Dependency> dependencyKey : dependenciesToConfigs.keySet()) {
if (dependenciesToConfigs.get(dependencyKey).containsAll(configurations)) {
boolean isInMinus = false;
for (String minusConfiguration : minusConfigurations) {
if (dependenciesToConfigs.get(dependencyKey).contains(minusConfiguration)) {
isInMinus = true;
break;
}
}
if (!isInMinus) {
deps.add(dependencyKey);
} else {
minusDeps.add(dependencyKey);
}
}
}
for (IdeDependencyKey<?, Dependency> key : Iterables.concat(deps, minusDeps)) {
dependenciesToConfigs.removeAll(key);
}
return deps;
}
示例5: buildDependencies
import org.gradle.plugins.ide.idea.model.Dependency; //導入依賴的package包/類
private void buildDependencies(Map<String, DefaultIdeaModule> modules, IdeaModule ideaModule) {
ideaModule.setOffline(offlineDependencyResolution);
Set<Dependency> resolved = ideaModule.resolveDependencies();
List<DefaultIdeaDependency> dependencies = new LinkedList<DefaultIdeaDependency>();
for (Dependency dependency : resolved) {
if (dependency instanceof SingleEntryModuleLibrary) {
SingleEntryModuleLibrary d = (SingleEntryModuleLibrary) dependency;
DefaultIdeaSingleEntryLibraryDependency defaultDependency = new DefaultIdeaSingleEntryLibraryDependency()
.setFile(d.getLibraryFile())
.setSource(d.getSourceFile())
.setJavadoc(d.getJavadocFile())
.setScope(new DefaultIdeaDependencyScope(d.getScope()))
.setExported(d.isExported());
if (d.getModuleVersion() != null) {
defaultDependency.setGradleModuleVersion(new DefaultGradleModuleVersion(d.getModuleVersion()));
}
dependencies.add(defaultDependency);
} else if (dependency instanceof ModuleDependency) {
ModuleDependency moduleDependency = (ModuleDependency) dependency;
DefaultIdeaModuleDependency ideaModuleDependency = new DefaultIdeaModuleDependency(moduleDependency.getName())
.setExported(moduleDependency.isExported())
.setScope(new DefaultIdeaDependencyScope(moduleDependency.getScope()));
// Find IdeaModule model for dependency within same build: may be null
DefaultIdeaModule targetModule = modules.get(moduleDependency.getName());
ideaModuleDependency.setDependencyModule(targetModule);
dependencies.add(ideaModuleDependency);
}
}
modules.get(ideaModule.getName()).setDependencies(dependencies);
}
示例6: scopeToDependency
import org.gradle.plugins.ide.idea.model.Dependency; //導入依賴的package包/類
private static Function<String, Dependency> scopeToDependency(final IdeDependencyKey<?, Dependency> dependencyKey) {
return new Function<String, Dependency>() {
@Override
@Nullable
public Dependency apply(String s) {
return dependencyKey.buildDependency(s);
}
};
}
示例7: getIdeaModuleLibraryDependenciesAsFiles
import org.gradle.plugins.ide.idea.model.Dependency; //導入依賴的package包/類
private static Iterable<File> getIdeaModuleLibraryDependenciesAsFiles(IdeaModule ideaModule) {
// could make resolveDependencies() cache its result for later use by GenerateIdeaModule
Set<Dependency> dependencies = ideaModule.resolveDependencies();
List<File> files = Lists.newArrayList();
for(ModuleLibrary moduleLibrary : Iterables.filter(dependencies, ModuleLibrary.class)) {
for (FilePath filePath : Iterables.filter(moduleLibrary.getClasses(), FilePath.class)) {
files.add(filePath.getFile());
}
}
return files;
}
示例8: scopeToDependency
import org.gradle.plugins.ide.idea.model.Dependency; //導入依賴的package包/類
private static Function<String, Dependency> scopeToDependency(final IdeDependencyKey<?, Dependency> dependencyKey) {
return new Function<String, Dependency>() {
@Nullable
public Dependency apply(String s) {
return dependencyKey.buildDependency(s);
}
};
}
示例9: forRepoFileDependency
import org.gradle.plugins.ide.idea.model.Dependency; //導入依賴的package包/類
public static IdeDependencyKey<IdeExtendedRepoFileDependency, Dependency> forRepoFileDependency(
IdeExtendedRepoFileDependency dependency, DependencyBuilder<IdeExtendedRepoFileDependency, Dependency> dependencyBuilder) {
return new RepoFileDependencyKey<Dependency>(dependency, dependencyBuilder);
}