当前位置: 首页>>代码示例>>Java>>正文


Java EclipseClasspath类代码示例

本文整理汇总了Java中org.gradle.plugins.ide.eclipse.model.EclipseClasspath的典型用法代码示例。如果您正苦于以下问题:Java EclipseClasspath类的具体用法?Java EclipseClasspath怎么用?Java EclipseClasspath使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EclipseClasspath类属于org.gradle.plugins.ide.eclipse.model包,在下文中一共展示了EclipseClasspath类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: finalizeEclipseClasspathTask

import org.gradle.plugins.ide.eclipse.model.EclipseClasspath; //导入依赖的package包/类
/**
 * @param eclipseClasspath
 * @param eclipseConfigPlugin
 * @param configurations
 */
@Finalize
public void finalizeEclipseClasspathTask(@Each GenerateEclipseClasspath eclipseClasspath,
        EclipseConfigPlugin eclipseConfigPlugin, ConfigurationContainer configurations) {
    EclipseClasspath classpath = eclipseClasspath.getClasspath();

    Configuration integrationCompileConfiguration = configurations.getAsMap()
            .get(JavaConfigPlugin.INTEGRATION_COMPILE_CLASSPATH_CONFIGURATION);

    if (integrationCompileConfiguration != null) {
        classpath.getPlusConfigurations().add(integrationCompileConfiguration);
    }

    Configuration integrationRuntimeConfiguration = configurations.getAsMap()
            .get(JavaConfigPlugin.INTEGRATION_RUNTIME_CLASSPATH_CONFIGURATION);

    if (integrationRuntimeConfiguration != null) {
        classpath.getPlusConfigurations().add(integrationRuntimeConfiguration);
    }

    classpath.getFile().whenMerged((Classpath c) -> {
        c.getEntries().removeIf(e -> (e instanceof Library)
                && Files.getFileExtension(((Library) e).getPath()).equalsIgnoreCase("pom"));
    });
}
 
开发者ID:jochenseeber,项目名称:gradle-project-config,代码行数:30,代码来源:EclipseConfigPlugin.java

示例2: createSourceFolders

import org.gradle.plugins.ide.eclipse.model.EclipseClasspath; //导入依赖的package包/类
public List<ClasspathEntry> createSourceFolders(final EclipseClasspath classpath) {
    List<ClasspathEntry> entries = Lists.newArrayList();
    Function<File, String> provideRelativePath = new Function<File, String>() {
        @Override
        public String apply(File input) {
            return classpath.getProject().relativePath(input);
        }
    };
    List<SourceFolder> regulars = getRegularSourceFolders(classpath.getSourceSets(), provideRelativePath);
    List<SourceFolder> trimmedExternals = getExternalSourceFolders(classpath.getSourceSets(), provideRelativePath);
    entries.addAll(regulars);
    entries.addAll(trimmedExternals);
    return entries;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:15,代码来源:SourceFoldersCreator.java

示例3: create

import org.gradle.plugins.ide.eclipse.model.EclipseClasspath; //导入依赖的package包/类
public List<Library> create(EclipseClasspath classpath) {
    List<Library> out = new LinkedList<Library>();
    FileReferenceFactory fileReferenceFactory = classpath.getFileReferenceFactory();

    if(classpath.getClassFolders() != null) {
        for (File folder : classpath.getClassFolders()) {
            Library library = new Library(fileReferenceFactory.fromFile(folder));
            library.setExported(true);
            out.add(library);
        }
    }

    return out;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:15,代码来源:ClassFoldersCreator.java

示例4: createLibraryEntry

import org.gradle.plugins.ide.eclipse.model.EclipseClasspath; //导入依赖的package包/类
private static AbstractLibrary createLibraryEntry(File binary, File source, File javadoc, EclipseClasspath classpath, ModuleVersionIdentifier id) {
    FileReferenceFactory referenceFactory = classpath.getFileReferenceFactory();

    FileReference binaryRef = referenceFactory.fromFile(binary);
    FileReference sourceRef = referenceFactory.fromFile(source);
    FileReference javadocRef = referenceFactory.fromFile(javadoc);

    final AbstractLibrary out = binaryRef.isRelativeToPathVariable() ? new Variable(binaryRef) : new Library(binaryRef);

    out.setJavadocPath(javadocRef);
    out.setSourcePath(sourceRef);
    out.setExported(false);
    out.setModuleVersion(id);
    return out;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:16,代码来源:EclipseDependenciesCreator.java

示例5: configureEclipseClasspathTask

import org.gradle.plugins.ide.eclipse.model.EclipseClasspath; //导入依赖的package包/类
/**
 * Configure the Eclipse classpath task
 *
 * @param eclipseClasspath Eclipse classpath task to configure
 * @param eclipseConfigPlugin Eclipse configuration plugin to configure task
 */
@Mutate
public void configureEclipseClasspathTask(@Each GenerateEclipseClasspath eclipseClasspath,
        EclipseConfigPlugin eclipseConfigPlugin) {
    EclipseClasspath classpath = eclipseClasspath.getClasspath();

    classpath.setDownloadSources(true);
    classpath.setDownloadJavadoc(true);
    classpath.getContainers().remove(EclipseWtpPlugin.WEB_LIBS_CONTAINER);
    classpath.getFile().withXml(xml -> eclipseConfigPlugin.configureClasspathXml(Validate.notNull(xml)));
}
 
开发者ID:jochenseeber,项目名称:gradle-project-config,代码行数:17,代码来源:EclipseConfigPlugin.java

示例6: configureEclipseClasspath

import org.gradle.plugins.ide.eclipse.model.EclipseClasspath; //导入依赖的package包/类
private void configureEclipseClasspath(final Project project, final EclipseModel model) {
    model.setClasspath(instantiator.newInstance(EclipseClasspath.class, project));
    ((IConventionAware) model.getClasspath()).getConventionMapping().map("defaultOutputDir", new Callable<File>() {
        @Override
        public File call() {
            return new File(project.getProjectDir(), "bin");
        }

    });

    final EclipsePlugin eclipsePlugin = this;
    project.getPlugins().withType(JavaBasePlugin.class, new Action<JavaBasePlugin>() {
        @Override
        public void execute(JavaBasePlugin javaBasePlugin) {
            maybeAddTask(project, eclipsePlugin, ECLIPSE_CP_TASK_NAME, GenerateEclipseClasspath.class, new Action<GenerateEclipseClasspath>() {
                @Override
                public void execute(final GenerateEclipseClasspath task) {
                    //task properties:
                    task.setDescription("Generates the Eclipse classpath file.");
                    task.setInputFile(project.file(".classpath"));
                    task.setOutputFile(project.file(".classpath"));

                    //model properties:
                    task.setClasspath(model.getClasspath());
                    task.getClasspath().setFile(new XmlFileContentMerger(task.getXmlTransformer()));
                    task.getClasspath().setSourceSets(project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets());

                    AfterEvaluateHelper.afterEvaluateOrExecute(project, new Action<Project>() {
                        @Override
                        public void execute(Project p) {
                            // keep the ordering we had in earlier gradle versions
                            Set<String> containers = Sets.newLinkedHashSet();
                            containers.add("org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/" + model.getJdt().getJavaRuntimeName() + "/");
                            containers.addAll(task.getClasspath().getContainers());
                            task.getClasspath().setContainers(containers);
                        }

                    });

                    project.getPlugins().withType(JavaPlugin.class, new Action<JavaPlugin>() {
                        @Override
                        public void execute(JavaPlugin javaPlugin) {
                            configureJavaClasspath(project, task);
                        }

                    });

                    configureScalaDependencies(project, task);
                }

            });
        }

    });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:56,代码来源:EclipsePlugin.java

示例7: EclipseDependenciesCreator

import org.gradle.plugins.ide.eclipse.model.EclipseClasspath; //导入依赖的package包/类
public EclipseDependenciesCreator(EclipseClasspath classpath) {
    this.dependenciesExtractor = new IdeDependenciesExtractor();
    this.classpath = classpath;
    ServiceRegistry serviceRegistry = ((ProjectInternal) classpath.getProject()).getServices();
    this.projectDependencyBuilder = new ProjectDependencyBuilder(CompositeBuildIdeProjectResolver.from(serviceRegistry));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:7,代码来源:EclipseDependenciesCreator.java

示例8: ClasspathFactory

import org.gradle.plugins.ide.eclipse.model.EclipseClasspath; //导入依赖的package包/类
public ClasspathFactory(EclipseClasspath classpath) {
    this.classpath = classpath;
    this.dependenciesCreator = new EclipseDependenciesCreator(classpath);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:ClasspathFactory.java

示例9: getClasspath

import org.gradle.plugins.ide.eclipse.model.EclipseClasspath; //导入依赖的package包/类
/**
 * The Eclipse Classpath model containing the information required to generate the classpath file.
 */
@Internal
public EclipseClasspath getClasspath() {
    return classpath;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:GenerateEclipseClasspath.java

示例10: setClasspath

import org.gradle.plugins.ide.eclipse.model.EclipseClasspath; //导入依赖的package包/类
public void setClasspath(EclipseClasspath classpath) {
    this.classpath = classpath;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:GenerateEclipseClasspath.java


注:本文中的org.gradle.plugins.ide.eclipse.model.EclipseClasspath类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。