當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。