1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-09-16 09:26:22 +02:00

Rename dlang to dub (#762)

This commit is contained in:
andre2007
2019-07-03 11:27:07 +02:00
committed by Oliver Nocon
parent 9e539e68ee
commit 44f745d327
11 changed files with 17 additions and 17 deletions

View File

@@ -56,7 +56,7 @@ steps:
timestampTemplate: '%Y%m%d%H%M%S'
tagPrefix: 'build_'
commitVersion: true
dlang:
dub:
filePath: 'dub.json'
versioningTemplate: '${version}-${timestamp}${commitId?"+"+commitId:""}'
docker:

View File

@@ -46,7 +46,7 @@ def getNpmGAV(file = 'package.json') {
return result
}
def getDlangGAV(file = 'dub.json') {
def getDubGAV(file = 'dub.json') {
def result = [:]
def descriptor = readJSON(file: file)

View File

@@ -12,8 +12,8 @@ abstract class ArtifactVersioning implements Serializable {
public static getArtifactVersioning(buildTool, script, configuration) {
switch (buildTool) {
case 'dlang':
return new DlangArtifactVersioning(script, configuration)
case 'dub':
return new DubArtifactVersioning(script, configuration)
case 'docker':
return new DockerArtifactVersioning(script, configuration)
case 'golang':

View File

@@ -1,7 +1,7 @@
package com.sap.piper.versioning
class DlangArtifactVersioning extends ArtifactVersioning {
protected DlangArtifactVersioning(script, configuration) {
class DubArtifactVersioning extends ArtifactVersioning {
protected DubArtifactVersioning(script, configuration) {
super(script, configuration)
}

View File

@@ -111,15 +111,15 @@ class DescriptorUtilsTest extends BasePiperTest {
}
@Test
void testGetDlangGAV() {
void testGetDubGAV() {
helper.registerAllowedMethod("readJSON", [Map.class], {
searchConfig ->
def packageJsonFile = new File("test/resources/DescriptorUtils/dlang/${searchConfig.file}")
def packageJsonFile = new File("test/resources/DescriptorUtils/dub/${searchConfig.file}")
return new JsonUtils().jsonStringToGroovyObject(packageJsonFile.text)
})
def gav = descriptorUtils.getDlangGAV('dub.json')
def gav = descriptorUtils.getDubGAV('dub.json')
assertEquals(gav.group, 'com.sap.dlang')
assertEquals(gav.artifact, 'hdi-deploy')

View File

@@ -115,8 +115,8 @@ class WhitesourceConfigurationHelperTest extends BasePiperTest {
}
@Test
void testExtendConfigurationFileUnifiedAgentDlang() {
WhitesourceConfigurationHelper.extendUAConfigurationFile(nullScript, utils, [scanType: 'dlang', whitesource: [configFilePath: './config',serviceUrl: "http://some.host.whitesource.com/api/", orgToken: 'abcd', productName: 'DIST - name1', productToken: '1234', userKey: '0000']], "./")
void testExtendConfigurationFileUnifiedAgentDub() {
WhitesourceConfigurationHelper.extendUAConfigurationFile(nullScript, utils, [scanType: 'dub', whitesource: [configFilePath: './config',serviceUrl: "http://some.host.whitesource.com/api/", orgToken: 'abcd', productName: 'DIST - name1', productToken: '1234', userKey: '0000']], "./")
assertThat(jwfr.files['./config.847f9aec2f93de9000d5fa4e6eaace2283ae6377'],
allOf(
containsString("apiKey=abcd"),
@@ -126,7 +126,7 @@ class WhitesourceConfigurationHelperTest extends BasePiperTest {
)
)
assertThat(jlr.log, containsString("[Whitesource] Configuration for scanType: 'dlang' is not yet hardened, please do a quality assessment of your scan results."))
assertThat(jlr.log, containsString("[Whitesource] Configuration for scanType: 'dub' is not yet hardened, please do a quality assessment of your scan results."))
}
@Test

View File

@@ -11,9 +11,9 @@ import util.Rules
import static org.junit.Assert.assertEquals
import static org.junit.Assert.assertTrue
class DlangArtifactVersioningTest extends BasePiperTest{
class DubArtifactVersioningTest extends BasePiperTest{
JenkinsReadJsonRule readJsonRule = new JenkinsReadJsonRule(this, 'test/resources/versioning/DlangArtifactVersioning/')
JenkinsReadJsonRule readJsonRule = new JenkinsReadJsonRule(this, 'test/resources/versioning/DubArtifactVersioning/')
JenkinsWriteJsonRule writeJsonRule = new JenkinsWriteJsonRule(this)
@Rule
@@ -24,7 +24,7 @@ class DlangArtifactVersioningTest extends BasePiperTest{
@Test
void testVersioning() {
DlangArtifactVersioning av = new DlangArtifactVersioning(nullScript, [filePath: 'dub.json'])
DubArtifactVersioning av = new DubArtifactVersioning(nullScript, [filePath: 'dub.json'])
assertEquals('1.2.3', av.getVersion())
av.setVersion('1.2.3-20180101')
assertTrue(writeJsonRule.files['dub.json'].contains('1.2.3-20180101'))

View File

@@ -22,7 +22,7 @@ import groovy.text.SimpleTemplateEngine
'artifactType',
/**
* Defines the tool which is used for building the artifact.
* @possibleValues `dlang`, `docker`, `golang`, `maven`, `mta`, `npm`, `pip`, `sbt`
* @possibleValues `dub`, `docker`, `golang`, `maven`, `mta`, `npm`, `pip`, `sbt`
*/
'buildTool',
/**

View File

@@ -435,7 +435,7 @@ private resolveProjectIdentifiers(script, descriptorUtils, config) {
case 'golang':
gav = descriptorUtils.getGoGAV(config.buildDescriptorFile, new URI(script.commonPipelineEnvironment.getGitHttpsUrl()))
break
case 'dlang':
case 'dub':
break
case 'maven':
gav = descriptorUtils.getMavenGAV(config.buildDescriptorFile)