public WorkResult copy(Closure closure) {
   FileCopyAction copyAction = new FileCopyAction(instantiator, resolver);
   CopySpecInternal copySpec = copyAction.getCopySpec();
   copySpec.from(this);
   ConfigureUtil.configure(closure, copySpec);
   return copyAction.copy();
 }
Ejemplo n.º 2
0
  /**
   * Configures the manifest for this JAR archive.
   *
   * <p>The given closure is executed to configure the manifest. The {@link
   * org.gradle.api.java.archives.Manifest} is passed to the closure as its delegate.
   *
   * @param configureClosure The closure.
   * @return This.
   */
  public Jar manifest(Closure<?> configureClosure) {
    if (getManifest() == null) {
      manifest = new DefaultManifest(((ProjectInternal) getProject()).getFileResolver());
    }

    ConfigureUtil.configure(configureClosure, getManifest());
    return this;
  }
 @Override
 public Object invokeMethod(String name, Object... arguments)
     throws groovy.lang.MissingMethodException {
   if (isConfigureMethod(name, arguments)) {
     return ConfigureUtil.configure((Closure) arguments[0], getByName(name));
   } else {
     return super.invokeMethod(name, arguments);
   }
 }
Ejemplo n.º 4
0
 public CopySpec from(Object sourcePath, Closure c) {
   if (c == null) {
     from(sourcePath);
     return this;
   } else {
     CopySpecImpl child = addChild();
     child.from(sourcePath);
     ConfigureUtil.configure(c, child);
     return child;
   }
 }
Ejemplo n.º 5
0
 public CopySpecImpl into(Object destPath, Closure configureClosure) {
   if (configureClosure == null) {
     into(destPath);
     return this;
   } else {
     CopySpecImpl child = addChild();
     child.into(destPath);
     ConfigureUtil.configure(configureClosure, child);
     return child;
   }
 }
Ejemplo n.º 6
0
  private TestFramework useTestFramework(
      TestFramework testFramework, Closure testFrameworkConfigure) {
    if (testFramework == null) {
      throw new IllegalArgumentException("testFramework is null!");
    }

    this.testFramework = testFramework;

    if (testFrameworkConfigure != null) {
      ConfigureUtil.configure(testFrameworkConfigure, this.testFramework.getOptions());
    }

    return this.testFramework;
  }
Ejemplo n.º 7
0
 public DefaultCppSourceSet source(Closure closure) {
   ConfigureUtil.configure(closure, source);
   return this;
 }
Ejemplo n.º 8
0
 public DefaultCppSourceSet exportedHeaders(Closure closure) {
   ConfigureUtil.configure(closure, exportedHeaders);
   return this;
 }
Ejemplo n.º 9
0
 public void repositories(Closure configureClosure) {
   ConfigureUtil.configure(configureClosure, repositoryHandler);
 }
Ejemplo n.º 10
0
 public void dependencies(Closure configureClosure) {
   ConfigureUtil.configure(configureClosure, dependencyHandler);
 }
Ejemplo n.º 11
0
 /**
  * Adds content to this JAR archive's META-INF directory.
  *
  * <p>The given closure is executed to configure a {@code CopySpec}. The {@link
  * org.gradle.api.file.CopySpec} is passed to the closure as its delegate.
  *
  * @param configureClosure The closure.
  * @return The created {@code CopySpec}
  */
 public CopySpec metaInf(Closure<?> configureClosure) {
   return ConfigureUtil.configure(configureClosure, getMetaInf());
 }
Ejemplo n.º 12
0
 /**
  * Enables advanced configuration like tinkering with the output XML or affecting the way that the
  * contents of an existing .classpath file is merged with Gradle build information. The object
  * passed to the whenMerged{} and beforeMerged{} closures is of type {@link Classpath}.
  *
  * <p>See {@link EclipseProject} for an example.
  */
 public void file(Closure closure) {
   ConfigureUtil.configure(closure, file);
 }
Ejemplo n.º 13
0
 public TestFrameworkOptions options(Closure testFrameworkConfigure) {
   TestFrameworkOptions options = getTestFramework().getOptions();
   ConfigureUtil.configure(testFrameworkConfigure, testFramework.getOptions());
   return options;
 }
 public T getByName(String name, Closure configureClosure) throws UnknownDomainObjectException {
   T t = getByName(name);
   ConfigureUtil.configure(configureClosure, t);
   return t;
 }
Ejemplo n.º 15
0
 /**
  * Configured the credentials to be used when cloning the repo. This will be passed a {@link
  * PasswordCredentials} instance.
  *
  * @param closure the configuration closure
  */
 @SuppressWarnings("rawtypes")
 public void credentials(Closure closure) {
   ConfigureUtil.configure(closure, getCredentials());
 }
 public void layout(String layoutName, Closure config) {
   layout(layoutName);
   ConfigureUtil.configure(config, layout);
 }
Ejemplo n.º 17
0
 public void execute(Object o) {
   ConfigureUtil.configure(cl, o);
 }
Ejemplo n.º 18
0
 /**
  * Allows configuring the logging of the test execution, for example log eagerly the standard
  * output, etc.
  *
  * <pre autoTested=''>
  * apply plugin: 'java'
  *
  * //makes the standard streams (err and out) visible at console when running tests
  * test.testLogging {
  *   showStandardStreams = true
  * }
  * </pre>
  *
  * @param closure configure closure
  */
 public void testLogging(Closure closure) {
   ConfigureUtil.configure(closure, testLogging);
 }