Class BuildHMCScripts

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
de.hybris.ant.taskdefs.compiling.BuildHMCScripts
All Implemented Interfaces:
Cloneable

public class BuildHMCScripts extends org.apache.tools.ant.Task
Concatenates all files with file ending *.[filetype] of all extensions with hmc module located at hmc/web/webroot/ext/[extension]/[filetype] folder (directories will be processed before files and always in alphabetical order) to one large hmc.[filetype] file at hmc/web/webroot/[filetype] at hmc extension. For the hmc extension itself, the files has to be located at hmc/web/webroot/[filetype]/src.
  • Field Summary

    Fields inherited from class org.apache.tools.ant.Task

    target, taskName, taskType, wrapper

    Fields inherited from class org.apache.tools.ant.ProjectComponent

    description, location, project
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected String
    read from file and put file content into a string
    void
    Sets the file type to process (in general js or css).
    protected void
    writeToFile(File file, String string)
    write String to file

    Methods inherited from class org.apache.tools.ant.Task

    bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType

    Methods inherited from class org.apache.tools.ant.ProjectComponent

    clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BuildHMCScripts

      public BuildHMCScripts()
  • Method Details

    • setFiletype

      public void setFiletype(String type)
      Sets the file type to process (in general js or css).
      Parameters:
      type - type to process
    • execute

      public void execute() throws org.apache.tools.ant.BuildException
      Overrides:
      execute in class org.apache.tools.ant.Task
      Throws:
      org.apache.tools.ant.BuildException
    • readFromFile

      protected String readFromFile(File file) throws IOException, FileNotFoundException
      read from file and put file content into a string
      Parameters:
      file - the file to read
      Returns:
      the file content
      Throws:
      IOException - by IO Error
      FileNotFoundException - throws if file not found
    • writeToFile

      protected void writeToFile(File file, String string) throws IOException
      write String to file
      Parameters:
      file - the file
      string - the string
      Throws:
      IOException - IO Error