Home Manual Reference Source
public class | source

BuildCopier

Copies the project files and/or the files of a target that doesn't require bundling.

Constructor Summary

Public Constructor
public

constructor(copier: copy, appLogger: Logger, events: Events, pathUtils: PathUtils, projectConfiguration: ProjectConfigurationSettings, targets: Targets)

Class constructor.

Member Summary

Public Members
public

A local reference for the appLogger service.

public

A local reference for the copier service function.

public

A local reference for the events service.

public

A local reference for the pathUtils service.

public

All the project settings.

public

A local reference for the targets service.

Method Summary

Public Methods
public

addPrivateModules(packagePath: string, modules: Object, updateModulesToo: boolean): *

After the project files are copied, this module updates the copied package.json with local references for any given module name.

public

If copy.enabled is true on the project configuration, this method will copy the list of items on the configuration copy.items key.

public

Copy the files of an specific target.

Public Constructors

public constructor(copier: copy, appLogger: Logger, events: Events, pathUtils: PathUtils, projectConfiguration: ProjectConfigurationSettings, targets: Targets) source

Class constructor.

Params:

NameTypeAttributeDescription
copier copy

The function that copies files and directories.

appLogger Logger

Used to inform the user when files are being copied.

events Events

To trigger events reducer that may alter the items being copied.

pathUtils PathUtils

Necessary to build the paths.

projectConfiguration ProjectConfigurationSettings

To read the project information and get paths.

targets Targets

To get the information of targets from includeTargets and copy their files too.

Public Members

public appLogger: Logger source

A local reference for the appLogger service.

public copier: copy source

A local reference for the copier service function.

public events: Events source

A local reference for the events service.

public pathUtils: PathUtils source

A local reference for the pathUtils service.

public projectConfiguration: ProjectConfigurationSettings source

All the project settings.

public targets: Targets source

A local reference for the targets service.

Public Methods

public addPrivateModules(packagePath: string, modules: Object, updateModulesToo: boolean): * source

After the project files are copied, this module updates the copied package.json with local references for any given module name.

Params:

NameTypeAttributeDescription
packagePath string

The path to the main package.json.

modules Object

A dictionary with the name of modules as keys and local paths as values.

updateModulesToo boolean
  • optional
  • default: true

If true, it will also update the package.json of each of the modules with references each others local paths.

Return:

*

Promise<undefined,Error>

public copyFiles(): Promise<undefined, Error> source

If copy.enabled is true on the project configuration, this method will copy the list of items on the configuration copy.items key. This method emits the event reducer project-files-to-copy with the list of items to copy and expects an Array on return.

Return:

Promise<undefined, Error>

public copyTargetFiles(target: Target): Promise<undefined, Error> source

Copy the files of an specific target.

Params:

NameTypeAttributeDescription
target Target

The target information.

Return:

Promise<undefined, Error>