本文整理汇总了Java中org.gradle.api.tasks.TaskInputs类的典型用法代码示例。如果您正苦于以下问题:Java TaskInputs类的具体用法?Java TaskInputs怎么用?Java TaskInputs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TaskInputs类属于org.gradle.api.tasks包,在下文中一共展示了TaskInputs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: source
import org.gradle.api.tasks.TaskInputs; //导入依赖的package包/类
@Override
public TaskInputs source(final Object... paths) {
DeprecationLogger.nagUserOfDiscontinuedMethod("TaskInputs.source(Object...)", "Please use TaskInputs.files(Object...).skipWhenEmpty() instead.");
taskMutator.mutate("TaskInputs.source(Object...)", new Runnable() {
@Override
public void run() {
addSpec(paths, true);
}
});
return this;
}
示例2: sourceDir
import org.gradle.api.tasks.TaskInputs; //导入依赖的package包/类
@Override
public TaskInputs sourceDir(final Object path) {
DeprecationLogger.nagUserOfDiscontinuedMethod("TaskInputs.sourceDir(Object)", "Please use TaskInputs.dir(Object).skipWhenEmpty() instead.");
taskMutator.mutate("TaskInputs.sourceDir(Object)", new Runnable() {
@Override
public void run() {
addSpec(resolver.resolveFilesAsTree(path), true);
}
});
return this;
}
示例3: property
import org.gradle.api.tasks.TaskInputs; //导入依赖的package包/类
public TaskInputs property(final String name, final Object value) {
taskMutator.mutate("TaskInputs.property(String, Object)", new Runnable() {
public void run() {
properties.put(name, value);
}
});
return this;
}
示例4: properties
import org.gradle.api.tasks.TaskInputs; //导入依赖的package包/类
public TaskInputs properties(final Map<String, ?> newProps) {
taskMutator.mutate("TaskInputs.properties(Map)", new Runnable() {
public void run() {
properties.putAll(newProps);
}
});
return this;
}
示例5: files
import org.gradle.api.tasks.TaskInputs; //导入依赖的package包/类
public TaskInputs files(final Object... paths) {
taskMutator.mutate("TaskInputs.files(Object...)", new Runnable() {
public void run() {
inputFiles.from(paths);
}
});
return this;
}
示例6: file
import org.gradle.api.tasks.TaskInputs; //导入依赖的package包/类
public TaskInputs file(final Object path) {
taskMutator.mutate("TaskInputs.file(Object)", new Runnable() {
public void run() {
inputFiles.from(path);
}
});
return this;
}
示例7: dir
import org.gradle.api.tasks.TaskInputs; //导入依赖的package包/类
public TaskInputs dir(final Object dirPath) {
taskMutator.mutate("TaskInputs.dir(Object)", new Runnable() {
public void run() {
inputFiles.from(resolver.resolveFilesAsTree(dirPath));
}
});
return this;
}
示例8: source
import org.gradle.api.tasks.TaskInputs; //导入依赖的package包/类
public TaskInputs source(final Object... paths) {
taskMutator.mutate("TaskInputs.source(Object...)", new Runnable() {
public void run() {
sourceFiles.from(paths);
}
});
return this;
}
示例9: sourceDir
import org.gradle.api.tasks.TaskInputs; //导入依赖的package包/类
public TaskInputs sourceDir(final Object path) {
taskMutator.mutate("TaskInputs.sourceDir(Object)", new Runnable() {
public void run() {
sourceFiles.from(resolver.resolveFilesAsTree(path));
}
});
return this;
}
示例10: sourceDir
import org.gradle.api.tasks.TaskInputs; //导入依赖的package包/类
public TaskInputs sourceDir(Object path) {
taskStatusNagger.nagIfTaskNotInConfigurableState("TaskInputs.sourceDir(Object)");
sourceFiles.from(resolver.resolveFilesAsTree(path));
return this;
}
示例11: GeneratePomFileTask
import org.gradle.api.tasks.TaskInputs; //导入依赖的package包/类
public GeneratePomFileTask()
{
super();
setGroup(PublishingPlugin.PUBLISH_TASK_GROUP);
final Project project = getProject();
buildUtil = new BuildUtil(project);
final TaskInputs inputs = getInputs();
inputs.property("groupId", project.getGroup());
inputs.property("artifactId", project.getName());
inputs.property("version", project.getVersion());
inputs.property("name", buildUtil.getLongName());
inputs.property("description", project.getDescription());
inputs.property("url", buildUtil.getExtraPropertyValue(ExtProp.Website));
inputs.property("authorName", buildUtil.getExtraPropertyValue(ExtProp.AuthorName));
inputs.property("orgName", buildUtil.getExtraPropertyValue(ExtProp.OrgName));
inputs.property("orgUrl", buildUtil.getExtraPropertyValue(ExtProp.OrgUrl));
inputs.property("github", buildUtil.getExtraPropertyValue(ExtProp.Github));
getOutputs().file(pomFile);
doLast(new Closure<Void>(this)
{
@Override
@SuppressWarnings({"ResultOfMethodCallIgnored", "MethodDoesntCallSuperMethod"})
public Void call()
{
pomFile.getParentFile().mkdirs();
PomXml pomXml = createPom();
try {
writePomXml(pomXml);
}
catch (JAXBException e) {
throw new GradleException("error creating pom", e);
}
return null;
}
});
}
示例12: createPom
import org.gradle.api.tasks.TaskInputs; //导入依赖的package包/类
private PomXml createPom()
{
final TaskInputs inputs = getInputs();
String effectiveArtifactId = (String) inputs.getProperties().get("artifactId");
if (!depConfig.isDefaultConfig()) {
effectiveArtifactId += '-' + depConfig.getName();
}
final PomXml pom = new PomXml();
pom.setGroupId((String) inputs.getProperties().get("groupId"));
pom.setArtifactId(effectiveArtifactId);
pom.setVersion((String) inputs.getProperties().get("version"));
pom.setName((String) inputs.getProperties().get("name"));
if (inputs.getProperties().containsKey("classifier")) {
pom.setClassifier((String) inputs.getProperties().get("classifier"));
}
pom.setDescription((String) inputs.getProperties().get("description"));
pom.setUrl((String) inputs.getProperties().get("url"));
final List<PomXml.DependencyXml> dependencies = new ArrayList<>();
final Configuration cfg = new ClasspathBuilder(getProject()).buildMainRuntimeConfiguration(depConfig);
for (Dependency d : cfg.getAllDependencies()) {
if (!(d instanceof ExternalDependency)) {
throw new GradleException("Incompatible dependency: " + d);
}
final ExternalDependency jar = (ExternalDependency) d;
final Iterator<DependencyArtifact> artifactIterator = jar.getArtifacts().iterator();
final DependencyArtifact artifcat = artifactIterator.hasNext() ? artifactIterator.next() : null;
final String depClassifier = artifcat != null ? artifcat.getClassifier() : null;
PomXml.DependencyXml dep = new PomXml.DependencyXml(jar.getGroup(), jar.getName(), jar.getVersion(),
depClassifier, "compile");
dependencies.add(dep);
}
pom.setDependencies(dependencies);
pom.setInceptionYear("2015");
pom.setLicenses(Collections.singletonList(
new PomXml.LicenseXml("GNU General Public License, Version 3", "https://www.gnu.org/copyleft/gpl.html")));
pom.setDevelopers(Collections.singletonList(
new PomXml.DeveloperXml((String) inputs.getProperties().get("authorName"), "[email protected]")));
pom.setOrganization(new PomXml.OrganizationXml((String) inputs.getProperties().get("orgName"),
(String) inputs.getProperties().get("orgUrl")));
pom.setScm(new PomXml.ScmXml("scm:git:[email protected]:" + inputs.getProperties().get("github") + ".git",
"scm:git:[email protected]:" + inputs.getProperties().get("github") + ".git",
"[email protected]:" + inputs.getProperties().get("github") + ".git"));
return pom;
}
示例13: DefaultTaskInputPropertySpec
import org.gradle.api.tasks.TaskInputs; //导入依赖的package包/类
public DefaultTaskInputPropertySpec(TaskInputs taskInputs, String taskName, boolean skipWhenEmpty, FileResolver resolver, Object paths) {
this.taskInputs = taskInputs;
this.files = new TaskPropertyFileCollection(taskName, "input", this, resolver, paths);
this.skipWhenEmpty = skipWhenEmpty;
}
示例14: getTaskInputs
import org.gradle.api.tasks.TaskInputs; //导入依赖的package包/类
private TaskInputs getTaskInputs(String method) {
DeprecationLogger.nagUserOfDiscontinuedMethod("chaining of the " + method, String.format("Please use the %s method on TaskInputs directly instead.", method));
return taskInputs;
}
示例15: property
import org.gradle.api.tasks.TaskInputs; //导入依赖的package包/类
@Override
public TaskInputs property(String name, Object value) {
return getTaskInputs("property(String, Object)").property(name, value);
}