Home Manual Reference Source
public class | source

BuildVersion

This service uses the project configuration settings in order manage the project version.

Constructor Summary

Public Constructor
public

constructor(events: Events, projectConfiguration: ProjectConfigurationSettings, versionUtils: VersionUtils)

Class constructor.

Member Summary

Public Members
public

A local reference for the events service.

public

All the project settings.

public

A local reference for the versionUtils service.

Method Summary

Public Methods
public

Create the revision file.

public

Get the name of the variable where the build engine should define the version.

public

Look for the project version first on the revision file, then on the environment variable and finally fallbacks to development if none of the other could be found.

Public Constructors

public constructor(events: Events, projectConfiguration: ProjectConfigurationSettings, versionUtils: VersionUtils) source

Class constructor.

Params:

NameTypeAttributeDescription
events Events

To fire an event when the revision file is created.

projectConfiguration ProjectConfigurationSettings

To read the version settings.

versionUtils VersionUtils

To load the version and write the revision file.

Public Members

public events: Events source

A local reference for the events service.

public projectConfiguration: ProjectConfigurationSettings source

All the project settings.

public versionUtils: VersionUtils source

A local reference for the versionUtils service.

Public Methods

public createRevision(force: boolean): Promise<string, Error> source

Create the revision file. This method emits the revision-file-created event and sends the contents of the file as a argument.

Params:

NameTypeAttributeDescription
force boolean
  • optional
  • default: false

Force the service to create the file even if the feature is disabled.

Return:

Promise<string, Error>

public getDefinitionVariable(): string source

Get the name of the variable where the build engine should define the version.

Return:

string

public getVersion(): string source

Look for the project version first on the revision file, then on the environment variable and finally fallbacks to development if none of the other could be found.

Return:

string