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


Java Launchable类代码示例

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


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

示例1: setLaunchables

import org.gradle.tooling.model.Launchable; //导入依赖的package包/类
public Builder setLaunchables(Iterable<? extends Launchable> launchables) {
    Set<String> taskPaths = new LinkedHashSet<String>();
    List<InternalLaunchable> launchablesParams = Lists.newArrayList();
    for (Launchable launchable : launchables) {
        Object original = new ProtocolToModelAdapter().unpack(launchable);
        if (original instanceof InternalLaunchable) {
            // A launchable created by the provider - just hand it back
            launchablesParams.add((InternalLaunchable) original);
        } else if (original instanceof TaskListingLaunchable) {
            // A launchable synthesized by the consumer - unpack it into a set of task names
            taskPaths.addAll(((TaskListingLaunchable) original).getTaskNames());
        } else if (launchable instanceof Task) {
            // A task created by a provider that does not understand launchables
            taskPaths.add(((Task) launchable).getPath());
        } else {
            throw new GradleException("Only Task or TaskSelector instances are supported: "
                + (launchable != null ? launchable.getClass() : "null"));
        }
    }
    // Tasks are ignored by providers if launchables is not null
    this.launchables = launchablesParams.isEmpty() ? null : launchablesParams;
    tasks = Lists.newArrayList(taskPaths);
    return this;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:25,代码来源:ConsumerOperationParameters.java

示例2: setLaunchables

import org.gradle.tooling.model.Launchable; //导入依赖的package包/类
public Builder setLaunchables(Iterable<? extends Launchable> launchables) {
    Set<String> taskPaths = new LinkedHashSet<String>();
    List<InternalLaunchable> launchablesParams = Lists.newArrayList();
    for (Launchable launchable : launchables) {
        Object original = new ProtocolToModelAdapter().unpack(launchable);
        if (original instanceof InternalLaunchable) {
            // A launchable created by the provider - just hand it back
            launchablesParams.add((InternalLaunchable) original);
        } else if (original instanceof TaskListingLaunchable) {
            // A launchable synthesized by the consumer - unpack it into a set of task names
            taskPaths.addAll(((TaskListingLaunchable) original).getTaskNames());
        } else if (launchable instanceof Task) {
            // A task created by a provider that does not understand launchables
            taskPaths.add(((Task) launchable).getPath());
        } else {
            throw new GradleException("Only Task or TaskSelector instances are supported: "
                    + (launchable != null ? launchable.getClass() : "null"));
        }
    }
    this.launchables = launchablesParams;
    tasks = Lists.newArrayList(taskPaths);
    return this;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:24,代码来源:ConsumerOperationParameters.java

示例3: forLaunchables

import org.gradle.tooling.model.Launchable; //导入依赖的package包/类
public BuildLauncher forLaunchables(Iterable<? extends Launchable> launchables) {
    Set<String> taskPaths = new LinkedHashSet<String>();
    List<InternalLaunchable> launchablesParams = Lists.newArrayList();
    for (Launchable launchable : launchables) {
        if (launchable instanceof Task) {
            taskPaths.add(((Task) launchable).getPath());
        } else if (launchable instanceof TaskListingLaunchable) {
            taskPaths.addAll(((TaskListingLaunchable) launchable).getTaskNames());
        } else if (!(launchable instanceof TaskSelector)) {
            throw new GradleException("Only Task or TaskSelector instances are supported: "
                    + (launchable != null ? launchable.getClass() : "null"));
        }
        maybeAddLaunchableParameter(launchablesParams, launchable);
    }
    operationParamsBuilder.setTasks(new ArrayList<String>(taskPaths));
    operationParamsBuilder.setLaunchables(launchablesParams);
    return this;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:19,代码来源:DefaultBuildLauncher.java

示例4: getPublicTasks

import org.gradle.tooling.model.Launchable; //导入依赖的package包/类
/**
 * Returns unmodifiable list with public tasks from Gradle project.
 *
 * @param projectModel
 *         gradle project model
 * @return unmodifiable list which contains public tasks
 * @see GradleTask
 * @see Task
 * @see Launchable
 */
public static List<String> getPublicTasks(GradleProject projectModel) {
    checkNotNull(projectModel);

    List<String> tasks = projectModel.getTasks()
                                     .stream()
                                     .filter(Launchable::isPublic)
                                     .map(Task::getPath)
                                     .collect(Collectors.toList());

    return unmodifiableList(tasks);
}
 
开发者ID:vzhukovskii,项目名称:che-gradle-plugin,代码行数:22,代码来源:GradleProjectManager.java

示例5: maybeAddLaunchableParameter

import org.gradle.tooling.model.Launchable; //导入依赖的package包/类
private void maybeAddLaunchableParameter(List<InternalLaunchable> launchablesParams, Launchable launchable) {
    Object original = launchable;
    try {
        if (Proxy.isProxyClass(launchable.getClass())) {
            original = new ProtocolToModelAdapter().unpack(launchable);
        }
    } catch (IllegalArgumentException iae) {
        // ignore: launchable created on consumer side for older provider
    }
    if (original instanceof InternalLaunchable) {
        launchablesParams.add((InternalLaunchable) original);
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:14,代码来源:DefaultBuildLauncher.java

示例6: forLaunchables

import org.gradle.tooling.model.Launchable; //导入依赖的package包/类
public BuildLauncher forLaunchables(Launchable... launchables) {
    return forLaunchables(Arrays.asList(launchables));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:DefaultBuildLauncher.java

示例7: preprocessLaunchables

import org.gradle.tooling.model.Launchable; //导入依赖的package包/类
protected void preprocessLaunchables(Iterable<? extends Launchable> launchables) {
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:3,代码来源:DefaultBuildLauncher.java

示例8: forLaunchables

import org.gradle.tooling.model.Launchable; //导入依赖的package包/类
/**
 * Sets the launchables to execute. If no entries are specified, the project's default tasks are executed.
 *
 * @param launchables The launchables for this build.
 * @return this
 * @since 1.12
 */
@Incubating
BuildLauncher forLaunchables(Launchable... launchables);
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:BuildLauncher.java


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