Skip to content

Commit

Permalink
Clarify intent of keeping stage descriptions for build ops stable
Browse files Browse the repository at this point in the history
See #1006
  • Loading branch information
bamboo committed Aug 9, 2018
1 parent 9f2f138 commit c42c710
Showing 1 changed file with 25 additions and 2 deletions.
Expand Up @@ -218,7 +218,12 @@ class ResidualProgramCompiler(

fun emitStage2ProgramFor(scriptFile: File, originalPath: String) {

val precompiledScriptClass = compileScript(scriptFile, originalPath, stage2ScriptDefinition, "BODY")
val precompiledScriptClass = compileScript(
scriptFile,
originalPath,
stage2ScriptDefinition,
StableDisplayNameFor.stage2
)

program<ExecutableProgram> {

Expand Down Expand Up @@ -504,7 +509,12 @@ class ResidualProgramCompiler(
fun compileStage1(source: ProgramSource, scriptDefinition: KotlinScriptDefinition): String {
withTemporaryScriptFileFor(source.path, source.text) { scriptFile ->
val originalScriptPath = source.path
return compileScript(scriptFile, originalScriptPath, scriptDefinition, "CLASSPATH")
return compileScript(
scriptFile,
originalScriptPath,
scriptDefinition,
StableDisplayNameFor.stage1
)
}
}

Expand All @@ -522,6 +532,19 @@ class ResidualProgramCompiler(
})
}

/**
* Stage descriptions for build operations.
*
* Changes to these constants must be coordinated with the GE team.
*/
private
object StableDisplayNameFor {

const val stage1 = "CLASSPATH"

const val stage2 = "BODY"
}

private
val stage1ScriptDefinition
get() = scriptDefinitionFromTemplate(
Expand Down

0 comments on commit c42c710

Please sign in to comment.