本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
示例6: forLaunchables
import org.gradle.tooling.model.Launchable; //導入依賴的package包/類
public BuildLauncher forLaunchables(Launchable... launchables) {
return forLaunchables(Arrays.asList(launchables));
}
示例7: preprocessLaunchables
import org.gradle.tooling.model.Launchable; //導入依賴的package包/類
protected void preprocessLaunchables(Iterable<? extends Launchable> launchables) {
}
示例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);