Java源码示例:org.gradle.api.internal.ClosureBackedAction
示例1
private void registerConfigurationAction(final Closure<?> action) {
modelRegistry.mutate(new ModelMutator<Object>() {
public ModelReference<Object> getSubject() {
return ModelReference.untyped(modelPath);
}
public void mutate(Object object, Inputs inputs) {
new ClosureBackedAction<Object>(action).execute(object);
}
public ModelRuleDescriptor getDescriptor() {
return new SimpleModelRuleDescriptor("model." + modelPath);
}
public List<ModelReference<?>> getInputs() {
return Collections.emptyList();
}
});
}
示例2
private void registerConfigurationAction(final Closure<?> action) {
modelRegistry.mutate(new ModelMutator<Object>() {
public ModelReference<Object> getSubject() {
return ModelReference.untyped(modelPath);
}
public void mutate(Object object, Inputs inputs) {
new ClosureBackedAction<Object>(action).execute(object);
}
public ModelRuleDescriptor getDescriptor() {
return new SimpleModelRuleDescriptor("model." + modelPath);
}
public List<ModelReference<?>> getInputs() {
return Collections.emptyList();
}
});
}
示例3
public void configure(Closure<?> action) {
executingDsl.set(true);
try {
new ClosureBackedAction<Object>(action).execute(this);
} finally {
executingDsl.set(false);
}
}
示例4
public void mutate(final Object object, Inputs inputs) {
RuleInputAccessBacking.runWithContext(inputs, new Runnable() {
public void run() {
new ClosureBackedAction<Object>(action).execute(object);
}
});
}
示例5
public void configure(Closure<?> action) {
executingDsl.set(true);
try {
new ClosureBackedAction<Object>(action).execute(this);
} finally {
executingDsl.set(false);
}
}
示例6
public void configure(Closure<?> action) {
executingDsl.set(true);
try {
new ClosureBackedAction<Object>(action).execute(this);
} finally {
executingDsl.set(false);
}
}
示例7
public void configure(Closure<?> action) {
executingDsl.set(true);
try {
new ClosureBackedAction<Object>(action).execute(this);
} finally {
executingDsl.set(false);
}
}
示例8
public void mutate(final Object object, Inputs inputs) {
RuleInputAccessBacking.runWithContext(inputs, new Runnable() {
public void run() {
new ClosureBackedAction<Object>(action).execute(object);
}
});
}
示例9
public ManifestMergeSpec eachEntry(Closure<?> mergeAction) {
return eachEntry(new ClosureBackedAction<ManifestMergeDetails>(mergeAction));
}
示例10
public MavenArtifactRepository maven(Closure closure) {
return maven(new ClosureBackedAction<MavenArtifactRepository>(closure));
}
示例11
public GroovyMavenDeployer mavenDeployer(Closure configureClosure) {
return container.addRepository(createMavenDeployer(), DEFAULT_MAVEN_DEPLOYER_NAME, new ClosureBackedAction<GroovyMavenDeployer>(configureClosure));
}
示例12
public GroovyMavenDeployer mavenDeployer(Map<String, ?> args, Closure configureClosure) {
//noinspection unchecked
return container.addRepository(createMavenDeployer(), DEFAULT_MAVEN_DEPLOYER_NAME, Actions.<GroovyMavenDeployer>composite(
new ConfigureByMapAction<GroovyMavenDeployer>(args), new ClosureBackedAction<GroovyMavenDeployer>(configureClosure)
));
}
示例13
public MavenResolver mavenInstaller(Closure configureClosure) {
return container.addRepository(createMavenInstaller(), DEFAULT_MAVEN_INSTALLER_NAME, new ClosureBackedAction<MavenResolver>(configureClosure));
}
示例14
public MavenResolver mavenInstaller(Map<String, ?> args, Closure configureClosure) {
//noinspection unchecked
return container.addRepository(createMavenInstaller(), DEFAULT_MAVEN_INSTALLER_NAME, Actions.<MavenResolver>composite(
new ConfigureByMapAction<MavenResolver>(args), new ClosureBackedAction<MavenResolver>(configureClosure)
));
}
示例15
public DefaultMavenPom whenConfigured(final Closure closure) {
whenConfiguredActions.add(new ClosureBackedAction<MavenPom>(closure));
return this;
}
示例16
public MavenResolver mavenInstaller(Closure configureClosure) {
return container.addRepository(createMavenInstaller(), DEFAULT_MAVEN_INSTALLER_NAME, new ClosureBackedAction<MavenResolver>(configureClosure));
}
示例17
public void afterExecute(Closure action) {
afterExecute.add(new ClosureBackedAction<GradleExecuter>(action));
}
示例18
public void credentials(Closure closure) {
credentials(new ClosureBackedAction<PasswordCredentials>(closure));
}
示例19
public void beforeDeployment(Closure action) {
beforeDeploymentActions.add(new ClosureBackedAction<MavenDeployment>(action));
}
示例20
public void allComponents(final Closure closure) {
allComponents(new ClosureBackedAction<ResolvedComponentResult>(closure));
}
示例21
public FlatDirectoryArtifactRepository flatDir(Closure configureClosure) {
return flatDir(new ClosureBackedAction<FlatDirectoryArtifactRepository>(configureClosure));
}
示例22
public MavenArtifactRepository maven(Closure closure) {
return maven(new ClosureBackedAction<MavenArtifactRepository>(closure));
}
示例23
public DefaultMavenPom whenConfigured(final Closure closure) {
whenConfiguredActions.add(new ClosureBackedAction<MavenPom>(closure));
return this;
}
示例24
public void allComponents(final Closure closure) {
allComponents(new ClosureBackedAction<ResolvedComponentResult>(closure));
}
示例25
public void add(Closure action) {
add(new ClosureBackedAction<ProjectInternal>(action));
}
示例26
public ExecResult javaexec(Closure closure) {
return processOperations.javaexec(new ClosureBackedAction<JavaExecSpec>(closure));
}
示例27
public T configure(Closure configuration) {
return configure(new ClosureBackedAction<T>(configuration));
}
示例28
public WorkResult copy(Closure closure) {
return copy(new ClosureBackedAction<CopySpec>(closure));
}
示例29
public CopySpec copySpec(Closure closure) {
return fileOperations.copySpec(new ClosureBackedAction<CopySpec>(closure));
}
示例30
public ExecResult javaexec(Closure closure) {
return processOperations.javaexec(new ClosureBackedAction<JavaExecSpec>(closure));
}