當前位置: 首頁>>代碼示例>>Java>>正文


Java Dependency類代碼示例

本文整理匯總了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;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:24,代碼來源:IdeaDependenciesProvider.java

示例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;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:27,代碼來源:IdeaDependenciesProvider.java

示例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;
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:23,代碼來源:IdeaDependenciesProvider.java

示例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;
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:27,代碼來源:IdeaDependenciesProvider.java

示例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);
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:35,代碼來源:IdeaModelBuilder.java

示例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);
        }
    };
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:10,代碼來源:IdeaDependenciesProvider.java

示例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;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:12,代碼來源:IdeaScalaConfigurer.java

示例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);
        }
    };
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:9,代碼來源:IdeaDependenciesProvider.java

示例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);
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:5,代碼來源:IdeDependencyKey.java


注:本文中的org.gradle.plugins.ide.idea.model.Dependency類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。