diff --git a/src/main/groovy/net/gleske/jervis/lang/lifecycleGenerator.groovy b/src/main/groovy/net/gleske/jervis/lang/lifecycleGenerator.groovy index 2fda17b5..33ae0b8b 100644 --- a/src/main/groovy/net/gleske/jervis/lang/lifecycleGenerator.groovy +++ b/src/main/groovy/net/gleske/jervis/lang/lifecycleGenerator.groovy @@ -512,7 +512,12 @@ env: if(!toolchain_obj.supportedTool(toolchain, tempchain)) { throw new UnsupportedToolException("${toolchain}: ${tempchain}") } - output += " ${toolchain}${i})\n" + if(toolchain_obj.isFriendlyLabel(toolchain)) { + output += " ${toolchain}:${tempchain})\n" + } + else { + output += " ${toolchain}${i})\n" + } if(tempchain in toolchain_keys) { output += ' ' + toolchain_obj.toolchains[toolchain][tempchain].join('\n ') + '\n ;;\n' } diff --git a/src/test/groovy/net/gleske/jervis/lang/lifecycleGeneratorTest.groovy b/src/test/groovy/net/gleske/jervis/lang/lifecycleGeneratorTest.groovy index 6b224d93..9f91760a 100644 --- a/src/test/groovy/net/gleske/jervis/lang/lifecycleGeneratorTest.groovy +++ b/src/test/groovy/net/gleske/jervis/lang/lifecycleGeneratorTest.groovy @@ -268,6 +268,11 @@ class lifecycleGeneratorTest extends GroovyTestCase { shouldFail(UnsupportedToolException) { generator.generateToolchainSection() } + //test for friendly labels + URL url = this.getClass().getResource('/good_toolchains_friendly.json'); + generator.loadToolchains(url.getFile()) + generator.loadYamlString('language: ruby\njdk: [openjdk6, openjdk7]') + assert '#\n# TOOLCHAINS SECTION\n#\n#gemfile toolchain section\nexport BUNDLE_GEMFILE="${PWD}/Gemfile"\n#env toolchain section\n#rvm toolchain section\nsome commands\n#jdk toolchain section\ncase ${jdk} in\n jdk:openjdk6)\n more commands\n ;;\n jdk:openjdk7)\n some commands\n ;;\nesac\n' == generator.generateToolchainSection() } @Test public void test_lifecycleGenerator_generateToolchainSection_nonmatrix() { //basic language test