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();
 }
Esempio 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);
   }
 }
Esempio 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;
   }
 }
Esempio 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;
   }
 }
Esempio 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;
  }
 public DefaultCppSourceSet source(Closure closure) {
   ConfigureUtil.configure(closure, source);
   return this;
 }
 public DefaultCppSourceSet exportedHeaders(Closure closure) {
   ConfigureUtil.configure(closure, exportedHeaders);
   return this;
 }
Esempio n. 9
0
 public void repositories(Closure configureClosure) {
   ConfigureUtil.configure(configureClosure, repositoryHandler);
 }
Esempio n. 10
0
 public void dependencies(Closure configureClosure) {
   ConfigureUtil.configure(configureClosure, dependencyHandler);
 }
Esempio 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());
 }
Esempio 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);
 }
Esempio 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;
 }
Esempio 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);
 }
Esempio n. 17
0
 public void execute(Object o) {
   ConfigureUtil.configure(cl, o);
 }
Esempio 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);
 }