lingua-franca 0.10.1
Lingua Franca code generator
Loading...
Searching...
No Matches
org.lflang.generator.docker.DockerComposeGenerator Class Reference

Code generator for docker-compose configurations. More...

Inherited by org.lflang.generator.docker.FedDockerComposeGenerator.

Public Member Functions

boolean build ()
 Build using docker compose.
boolean buildIfRequested ()
 Build, unless building was disabled.
void createLauncher ()
 Create a launcher script that invokes Docker.
 DockerComposeGenerator (LFGeneratorContext context)
void writeDockerComposeFile (List< DockerData > services) throws IOException
 Write the docker-compose.yml file with a default network called "lf".
void writeDockerComposeFile (List< DockerData > services, String networkName) throws IOException
 Write the docker-compose.yml file.

Protected Member Functions

String generateDockerNetwork (String networkName)
 Return a string that represents the network portion of the docker-compose configuration.
String generateDockerServices (List< DockerData > services)
 Return a string that represents the services portion of the docker-compose configuration.
String getBuildContext (DockerData data)
 Return the name of the service represented by the given data.
String getContainerName (DockerData data)
 Return the name of the container for the given data.
String getServiceDescription (DockerData data)
 Turn given docker data into a string.
String getServiceName (DockerData data)
 Return the name of the service represented by the given data.

Protected Attributes

final LFGeneratorContext context
 Context of the code generator.

Detailed Description

Code generator for docker-compose configurations.

Author
Marten Lohstroh
Steven Wong

Constructor & Destructor Documentation

◆ DockerComposeGenerator()

org.lflang.generator.docker.DockerComposeGenerator.DockerComposeGenerator ( LFGeneratorContext context)

Member Function Documentation

◆ build()

boolean org.lflang.generator.docker.DockerComposeGenerator.build ( )

Build using docker compose.

Returns
true if successful,false otherwise.

◆ buildIfRequested()

boolean org.lflang.generator.docker.DockerComposeGenerator.buildIfRequested ( )

Build, unless building was disabled.

Returns
false if building failed, true otherwise

◆ createLauncher()

void org.lflang.generator.docker.DockerComposeGenerator.createLauncher ( )

Create a launcher script that invokes Docker.

◆ generateDockerNetwork()

String org.lflang.generator.docker.DockerComposeGenerator.generateDockerNetwork ( String networkName)
protected

Return a string that represents the network portion of the docker-compose configuration.

Parameters
networkNameName of the default network

◆ generateDockerServices()

String org.lflang.generator.docker.DockerComposeGenerator.generateDockerServices ( List< DockerData > services)
protected

Return a string that represents the services portion of the docker-compose configuration.

Parameters
servicesA list of docker data representing the services to render

Reimplemented in org.lflang.generator.docker.FedDockerComposeGenerator.

◆ getBuildContext()

String org.lflang.generator.docker.DockerComposeGenerator.getBuildContext ( DockerData data)
protected

Return the name of the service represented by the given data.

Reimplemented in org.lflang.generator.docker.FedDockerComposeGenerator.

◆ getContainerName()

String org.lflang.generator.docker.DockerComposeGenerator.getContainerName ( DockerData data)
protected

Return the name of the container for the given data.

Reimplemented in org.lflang.generator.docker.FedDockerComposeGenerator.

◆ getServiceDescription()

String org.lflang.generator.docker.DockerComposeGenerator.getServiceDescription ( DockerData data)
protected

Turn given docker data into a string.

Reimplemented in org.lflang.generator.docker.FedDockerComposeGenerator.

◆ getServiceName()

String org.lflang.generator.docker.DockerComposeGenerator.getServiceName ( DockerData data)
protected

Return the name of the service represented by the given data.

Reimplemented in org.lflang.generator.docker.FedDockerComposeGenerator.

◆ writeDockerComposeFile() [1/2]

void org.lflang.generator.docker.DockerComposeGenerator.writeDockerComposeFile ( List< DockerData > services) throws IOException

Write the docker-compose.yml file with a default network called "lf".

Parameters
servicesA list of all the services.

◆ writeDockerComposeFile() [2/2]

void org.lflang.generator.docker.DockerComposeGenerator.writeDockerComposeFile ( List< DockerData > services,
String networkName ) throws IOException

Write the docker-compose.yml file.

Parameters
servicesA list of all the services to include.
networkNameThe name of the network to which docker will connect the services.

Member Data Documentation

◆ context

final LFGeneratorContext org.lflang.generator.docker.DockerComposeGenerator.context
protected

Context of the code generator.


The documentation for this class was generated from the following file:
  • /Users/runner/work/lingua-franca/lingua-franca/core/src/main/java/org/lflang/generator/docker/DockerComposeGenerator.java