Home Reference Source
public class | source

RunnerFile

This service is in charge of creating, validating and updating the runner file this plugin uses to store the information about the builded targets and how to execute them.

Constructor Summary

Public Constructor
public

constructor(info: Object, pathUtils: PathUtils)

Class constructor.

Member Summary

Public Members
public

The file default template.

public

The name of the runner file.

public

The path to the runner file.

Method Summary

Public Methods
public

Checks whether the file exists or not.

public

Get the name of the runner file.

public

Read the contents of the runner file.

public

setFilename(newName: string)

Set the name of the runner file.

public

update(target: Target, version: string, directory: string): Target

Updates the runner file with a new build information.

public

updateVersion(version: string): *

Updates the runner file with a new version of the project.

Public Constructors

public constructor(info: Object, pathUtils: PathUtils) source

Class constructor.

Params:

NameTypeAttributeDescription
info Object

The plugin package.json information, to use the plugin version on the file.

pathUtils PathUtils

To build the paths to the file.

Public Members

public fileTemplate: RunnerFileContents source

The file default template.

public filename: string source

The name of the runner file.

public filepath: string source

The path to the runner file.

Public Methods

public exists(): boolean source

Checks whether the file exists or not.

Return:

boolean

public getFilename(): string source

Get the name of the runner file.

Return:

string

public read(): RunnerFileContents source

Read the contents of the runner file. If the file doesn't exist, it will create it with the default template (this.fileTemplate).

public setFilename(newName: string) source

Set the name of the runner file.

Params:

NameTypeAttributeDescription
newName string

The new name.

TODO:

  • Update the `filepath`

public update(target: Target, version: string, directory: string): Target source

Updates the runner file with a new build information.

Params:

NameTypeAttributeDescription
target Target

The target information.

version string

The project version.

directory string

The project distribution directory.

Return:

Target (nullable: true)

If the target type was node, it will return the information saved on the file, otherwise, it will return null.

public updateVersion(version: string): * source

Updates the runner file with a new version of the project.

Params:

NameTypeAttributeDescription
version string

The project version.

Return:

*