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

net.xp_forge.maven.plugins.xp.CompileMojo 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 .xp sources)
 *
 * @goal compile
 * @requiresDependencyResolution compile
 */
public class CompileMojo extends AbstractCompileMojo {

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

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

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

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

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

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

  /**
   * {@inheritDoc}
   *
   */
  @Override
  protected String getAdditionalClasspath() {
    return null;
  }

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

  /**
   * {@inheritDoc}
   *
   */
  @Override
  protected boolean isSkip() {
    return false;
  }

  /**
   * {@inheritDoc}
   *
   */
  @Override
  protected Map getAppDirectoriesMap() {
    return AbstractXpMojo.APP_DIRECTORIES_MAP;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy