All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.xp_forge.maven.plugins.xp.TestCompileMojo Maven / Gradle / Ivy

There is a newer version: 3.3.4
Show newest version
/**
 * This file is part of the XP-Framework
 *
 * XP-Framework Maven plugin
 * Copyright (c) 2011, XP-Framework Team
 */
package net.xp_forge.maven.plugins.xp;

import java.io.File;
import java.util.Map;
import java.util.List;
import java.util.ArrayList;

/**
 * Run XP Framework XCC compiler (compile test .xp sources)
 *
 * @goal test-compile
 * @requiresDependencyResolution compile
 */
public class TestCompileMojo extends AbstractCompileMojo {

  /**
   * Set this to 'true' to bypass unit tests entirely
   * Its use is NOT RECOMMENDED, but quite convenient on occasion
   *
   * @parameter expression="${maven.test.skip}" default-value="false"
   */
  private boolean skip;

  /**
   * The source directories containing the raw PHP sources to be copied
   * Default value: [src/test/php]
   *
   * @parameter
   */
  private List testPhpSourceRoots;

  /**
   * PHP sources include pattern
   * Default value: [** /*.class.php]
   *
   * @parameter expression="${xp.compile.testPhpIncludePattern}"
   */
  private String testPhpIncludePattern;

  /**
   * The source directories containing the sources to be compiled
   * Default value: [src/test/xp]
   *
   * @parameter
   */
  private List testCompileSourceRoots;

  /**
   * {@inheritDoc}
   *
   */
  @Override
  protected List getPhpSourceRoots() {
    if (null == this.testPhpSourceRoots || this.testPhpSourceRoots.isEmpty()) {
      this.testPhpSourceRoots= new ArrayList();
      this.testPhpSourceRoots.add("src" + File.separator + "test" + File.separator + "php");
    }
    return this.testPhpSourceRoots;
  }

  /**
   * {@inheritDoc}
   *
   */
  @Override
  protected String getPhpIncludePattern() {
    return null == this.testPhpIncludePattern ? "**/*.class.php" : this.testPhpIncludePattern;
  }

  /**
   * {@inheritDoc}
   *
   */
  @Override
  protected List getCompileSourceRoots() {
    if (null == this.testCompileSourceRoots) {
      this.testCompileSourceRoots= this.project.getTestCompileSourceRoots();
    }
    return this.testCompileSourceRoots;
  }

  /**
   * {@inheritDoc}
   *
   */
  @Override
  protected String getAdditionalClasspath() {
    return this.classesDirectory.getAbsolutePath();
  }

  /**
   * {@inheritDoc}
   *
   */
  @Override
  protected File getClassesDirectory() {
    return this.testClassesDirectory;
  }

  /**
   * {@inheritDoc}
   *
   */
  @Override
  protected boolean isSkip() {
    return this.skip;
  }

  /**
   * {@inheritDoc}
   *
   */
  @Override
  protected Map getAppDirectoriesMap() {
    return null;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy