Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BuildProcess

Class that does all the work of replacing BUILD_INCLUDE statments in a files contents. See Online Docs

Hierarchy

  • BuildProcess

Index

Constructors

constructor

Properties

Private breakStringProcess

breakStringProcess: BreakStringProcess

Private commentProcess

commentProcess: CommentProcess

Private fenceProcess

fenceProcess: FenceProcess

Private isRecursive

isRecursive: boolean = false

logger

logger: ILogger

Private matchOptionsProcess

matchOptionsProcess: MatchOptionsProcess

Private matchProcess

matchProcess: MatchProcess

Private textProcess

textProcess: TextProcess

verbose

verbose: boolean = false

When true verbose logging will take place. State to determine if verbose logging will be used. This options can be overriddend by IOpt.verbose

Methods

buildInclude

  • buildInclude(fileContents: string, srcPath: string, opt?: IOpt): string
  • Reads BUILD_INCLUDE statements in contenst and replaces the BUILD_INCLUDE statment base upon the parameters in the BUILD_INCLUDE statment.

    description

    See Online Docs for the many options that may be used.

    Parameters

    • fileContents: string

      The string to search and replace BUILD_INCLUDE statements If empty string is passed in for this parameter then file contents from srcPath will be read and loaded.

    • srcPath: string

      The source path of the contents. this path is required and may be use to resolve relative paths to other include files.

    • Optional opt: IOpt

      The options for the current taks If not options or empty options are passed in then default options defaultOptions will be used.

    Returns string

Private getMatchArray

Private isOptionSetAsJsString

  • Check opts for asjsstring and assigns any found options to biOpt

    description

    The only option to be set is asjsstring

    Sets option for biOpt.asJsString

    AsJsString is basicly an alias for:

    text?code=jsString&kind=encode

    example

    function getStyle() {
     var css = '// BUILD_INCLUDE("../style.min.css")[asJsString]';
     return css;
    }

    To break include into muliple lines asJsString can be combined with breakString

    function getStyle() {
    // included file will be broken into lines 100 characters per line.
    // this makes for much better readability
     var css = '// BUILD_INCLUDE("../style.min.css")[asJsString, breakstring?width=100]';
     return css;
    }

    Parameters

    • opts: string[]

      The array of options to search for break string options in

    • biOpt: IBuildIncludeOpt

      The current options. This parameter is an object and will be potentially modified by this method.

    Returns boolean

Private isOptionVerboseSet

  • Check opts for verbose and assigns any found options to biOpt

    Parameters

    • opts: string[]

      The array of options to search for break string options in

    • biOpt: IBuildIncludeOpt

      The current options. This parameter is an object and

    Returns boolean

Private processFilePath

  • processFilePath(strFile: string): string
  • Processes incoming file path.

    Parameters

    • strFile: string

      File path to process

      Path is normalized If path contains it is swaped for app root dir.

    Returns string

Private processIncludeFilePath

  • processIncludeFilePath(strFile: string, optMatch: IMatchOpt): string
  • Process File Path of build_include Normalizes the path as well.

    Parameters

    • strFile: string

      The current matched file from build_replacement ( or variation of ).

    • optMatch: IMatchOpt

      Match options for matching build_include in files.

      If the path contains it get replaced with the actual root directery in this method

    Returns string

Private processOptions

  • processOptions(indexIndent: number, indexOpt: number, match: RegExpExecArray, biOpt: IBuildIncludeOpt): boolean
  • Process options and assigns any found options into biOpt.

    Parameters

    • indexIndent: number

      The index of indent in the build_include match.

    • indexOpt: number

      The index of options in the build_include match.

    • match: RegExpExecArray

      The current buld_includ ( or variation of ) match.

    • biOpt: IBuildIncludeOpt

      The current options. This parameter is an object and will be potentially modified by this method.

    Returns boolean

    Returns true if any options were found: Otherwise, false.

Private removeLnB

  • removeLnB(str: string): string
  • Replaces all instance of the \r\n then replaces all \n then finally replaces all \r. It goes through and removes all types of line breaks

    Parameters

    • str: string

      String to replace line breaks in

    Returns string

Private setVerbose

  • setVerbose(verbose: boolean): void
  • Sets the verbose state of logging.

    Parameters

    • verbose: boolean

      if true verbose loggign will take place; Otherwise, verbose logging will be disabled.

      If state is currently in a recursive procdess thatn verbose options will not change.

    Returns void

Private unixifyPath

  • unixifyPath(filepath: string): string
  • Converts a path to Unix style if this is windows and

    Parameters

    • filepath: string

      Path to convert from window to unix style

    Returns string

Generated using TypeDoc