JUnit5Compile

Pipeline stage which compiles Java source files with the JUnit Platform JAR.

Parameters

distro

Distro image to use for compiling the classes.

config

The configuration to instantiate this class.

Constructors

Link copied to clipboard
constructor(distro: LangDockerfile.Java, config: JUnit5Compile.Config)

Types

Link copied to clipboard
data class Config(val fileList: List<PathSpec>, val classpath: List<String>?, val flags: List<String>?, val outDir: String?, val junitVersion: String?) : ConfigUnit

Properties

Link copied to clipboard
protected lateinit var _runner: Runner
Link copied to clipboard
Link copied to clipboard
protected open val allowNetwork: Boolean

Whether the container is allowed network access.

Link copied to clipboard
open val className: String
Link copied to clipboard
private val classpath: List<String>
Link copied to clipboard
private val classpathOpts: List<String>
Link copied to clipboard
open val cmdLang: CmdLang

Command language used for constructing the command specification.

Link copied to clipboard

Handler describing how the stage performs necessary IO actions to retrieve stage execution outputs.

Link copied to clipboard
protected override val cmdSpec: CmdBuilder

Command to execute during the pipeline stage.

Link copied to clipboard
private val compile: CmdUtils.Var
Link copied to clipboard
private val compileDirMode: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
protected val distro: BaseDockerfile

Base distro image for this pipeline stage.

Link copied to clipboard
protected lateinit var docker: DockerDaemon

Instance to the Docker daemon.

Link copied to clipboard
protected open override val dockerfileSpec: DockerfileBuilder.() -> Unit

Additional specifications to add to the Dockerfile.

Link copied to clipboard
protected open val environmentVars: List<String>

Environment variables to provide to the runtime environment.

Link copied to clipboard

Convenience property for retrieving exitcode of a variable.

Link copied to clipboard
private val fileListStr: String
Link copied to clipboard
protected override val hasDynamicDockerfileSpec: Boolean

Whether the dockerfileSpec contains directives which are evaluated at pipeline execution time.

Link copied to clipboard
protected var hasTimedOut: Boolean
Link copied to clipboard
protected var hostPath: Path?

Path to mount to the host system as part of the pipeline, if this stage accepts/emits a HostVolume.

Link copied to clipboard
protected val imageTag: String?

Image tag to use for caching pipeline stage images.

Link copied to clipboard
Link copied to clipboard
private val isCacheImage: Boolean = true

Whether to cache this image in the local Docker registry.

Link copied to clipboard
Link copied to clipboard
protected val logger: Logger
Link copied to clipboard
Link copied to clipboard
private val mappedFileList: List<String>
Link copied to clipboard
protected open val mntMountMode: AccessMode

Mode to mount the mountPath as.

Link copied to clipboard
protected val mountPath: Path? = null

Path to mount to the host system for supplementary use, if any.

Link copied to clipboard
private val optionsList: List<String>
Link copied to clipboard
private val outDir: String
Link copied to clipboard

The logger output are stored in logs of outputLogger after stage execution

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private val pathList: List<PathSpec>
Link copied to clipboard
Link copied to clipboard
open override val reportUnit: Compile.Report
Link copied to clipboard

The system resources which control what the container is allowed to access.

Link copied to clipboard
open override val runner: DockerRunner
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private val srcList: CmdUtils.Var
Link copied to clipboard

Convenience property for retrieving stderr content of a variable line-by-line.

Link copied to clipboard

Convenience property for retrieving stdout content of a variable line-by-line.

Link copied to clipboard
protected open val volMountMode: AccessMode

Mode to mount the in-place volume as.

Link copied to clipboard
protected override val workingDir: String

Working directory of the container.

Functions

Link copied to clipboard
fun buildCmd(configure: CmdBuilder.() -> Unit): CmdBuilder

Builder method for CmdBuilder using the command language cmdLang of the stage.

Link copied to clipboard

Builder method for CmdBuilder using the command language cmdLang of the stage.

Link copied to clipboard
fun buildCompileCmd(preCmdSpec: CmdBuilder.() -> Unit = {}, postCmdSpec: CmdBuilder.() -> Unit = {}, compileCmdSpec: CmdBuilder.() -> String): CmdBuilder

Wrapper for building cmdSpec in concrete compile classes that exports compilation command results.

Link copied to clipboard

Configures the container during execution of the pipeline.

Link copied to clipboard
protected fun <R> CmdUtils.Var.Result<R>.contentOrDefault(default: R): R

Returns the content of this result (stdout, stderr, or exitCode); Otherwise returns a default value generated by default.

Link copied to clipboard
protected suspend override fun execute(input: StageResult): StageResult
Link copied to clipboard
Link copied to clipboard
private suspend fun getDockerfile(): Path

Base Dockerfile for all pipeline stage.

Link copied to clipboard
protected suspend fun getDockerImage(force: Boolean = false): DockerImage

Builds a Docker image based on the Dockerfile specification as defined by this stage, overwriting any previously cached image if exists.

Link copied to clipboard
private suspend fun getHostConfig(inVolume: DockerVolume?): Pair<HostConfig, DockerVolume?>

Determines the host configuration of the container.

Link copied to clipboard
fun installPackages(additionalPackages: List<String> = emptyList(), vararg packages: String): DockerfileBuilder.() -> Unit

Dockerfile spec for installing packages

Link copied to clipboard
protected suspend fun logContainerInfo(image: DockerImage, hostConfig: HostConfig)

Logs the information used to create the container for this pipeline stage.

Link copied to clipboard
protected fun markStageAsTimedOut()
Link copied to clipboard
protected open suspend override fun onExecComplete()
Link copied to clipboard
protected fun onExecFailed(tr: Throwable)
Link copied to clipboard
protected open override fun onExecFailedImpl(tr: Throwable)
Link copied to clipboard
protected open fun onInitParserContext(configContext: ConfigParsable.Context)
Link copied to clipboard
protected suspend fun postExecCleanup(startTime: Instant, success: Boolean)

Performs cleanup after the execution of the container.

Link copied to clipboard
Link copied to clipboard
fun putRunner(runner: Runner)
Link copied to clipboard
private suspend fun removeContainer()

Removes the container and temporary log volume created by this pipeline stage.

Link copied to clipboard
protected open suspend fun runContainer(input: StageResult, hostConfig: HostConfig, outVolume: DockerVolume?): DockerVolume?

Builds the Docker image backing this pipeline stage, and runs the container.

Link copied to clipboard
private fun transformResult(outVolume: DockerVolume?): StageResult

Transforms the result of the stage into a StageResult.

Link copied to clipboard
fun Var(baseName: String): CmdUtils.Var

Variable builder inheriting the CmdLang of this stage.