Add a unique id to each product
This commit is contained in:
parent
4b3e84c72d
commit
ebb151dcea
1 changed files with 20 additions and 15 deletions
|
|
@ -24,16 +24,18 @@ class ProductInfo extends GISJsonSerialised {
|
|||
private String productname
|
||||
private String subcomponentname
|
||||
private String variant
|
||||
private String uniqueid
|
||||
|
||||
ProductInfo(script, productname = "", subcomponentname = "", variant = "") {
|
||||
ProductInfo(script, String productname = '', String subcomponentname = '', String variant = '') {
|
||||
super(script)
|
||||
this.format = '0.1'
|
||||
this.productname = productname
|
||||
this.subcomponentname = subcomponentname
|
||||
this.variant = variant
|
||||
this.uniqueid = UUID.randomUUID().toString()
|
||||
}
|
||||
|
||||
void set(String productname, String subcomponentname, String variant = '') {
|
||||
void set(String productname, String subcomponentname, String variant = '', ) {
|
||||
// Make sure the fields can be used in git tags
|
||||
def int pstatus = 0
|
||||
if (script.isUnix()) {
|
||||
|
|
@ -76,13 +78,15 @@ class ProductInfo extends GISJsonSerialised {
|
|||
this.productname = otherinfo.productname
|
||||
this.subcomponentname = otherinfo.subcomponentname
|
||||
this.variant = otherinfo.variant
|
||||
this.uniqueid = otherinfo.uniqueid
|
||||
}
|
||||
|
||||
void deserialiseJson(rawmeta) {
|
||||
//format = rawmeta['format']
|
||||
productname = rawmeta['productname']
|
||||
subcomponentname = rawmeta['subcomponentname']
|
||||
variant = rawmeta['variant'] ?: ""
|
||||
variant = rawmeta['variant'] ?: ''
|
||||
uniqueid = rawmeta['uniqueid'] ?: uniqueid
|
||||
}
|
||||
|
||||
LinkedHashMap serialisationdata() {
|
||||
|
|
@ -91,6 +95,7 @@ class ProductInfo extends GISJsonSerialised {
|
|||
'productname' : productname,
|
||||
'subcomponentname' : subcomponentname,
|
||||
'variant' : variant,
|
||||
'uniqueid': uniqueid,
|
||||
]
|
||||
return data
|
||||
}
|
||||
|
|
@ -104,7 +109,7 @@ class GitInfo extends GISJsonSerialised {
|
|||
private String remoteurl
|
||||
private String remoteinfo
|
||||
|
||||
GitInfo(script, sourcepath = "", sourcerevision = "", gitrevision = "", remoteurl = "", remoteinfo = "") {
|
||||
GitInfo(script, sourcepath = '', sourcerevision = '', gitrevision = '', remoteurl = '', remoteinfo = '') {
|
||||
super(script)
|
||||
this.format = '0.1'
|
||||
this.sourcepath = sourcepath
|
||||
|
|
@ -204,7 +209,7 @@ class JenkinsBuildInfo extends GISJsonSerialised {
|
|||
private ArrayList<JenkinsBuildParameter> parameters
|
||||
private boolean isfullbuild
|
||||
|
||||
JenkinsBuildInfo(script, String buildjobname = "", int buildnumber = 0, String buildmachine = "", String builddate = "", boolean isfullbuild = true) {
|
||||
JenkinsBuildInfo(script, String buildjobname = '', int buildnumber = 0, String buildmachine = '', String builddate = '', boolean isfullbuild = true) {
|
||||
super(script)
|
||||
this.format = '0.1'
|
||||
this.buildjobname = buildjobname
|
||||
|
|
@ -370,7 +375,7 @@ class ReleaseInfo extends GISJsonSerialised {
|
|||
private ArrayList<String> releaseitems
|
||||
private boolean released
|
||||
|
||||
ReleaseInfo(script, String releaserepoURL = "", boolean released = false) {
|
||||
ReleaseInfo(script, String releaserepoURL = '', boolean released = false) {
|
||||
super(script)
|
||||
this.format = '0.1'
|
||||
this.releaserepoURL = releaserepoURL
|
||||
|
|
@ -378,7 +383,7 @@ class ReleaseInfo extends GISJsonSerialised {
|
|||
this.released = released
|
||||
}
|
||||
|
||||
void set(String releaserepoURL = "") {
|
||||
void set(String releaserepoURL = '') {
|
||||
this.releaserepoURL = releaserepoURL
|
||||
}
|
||||
|
||||
|
|
@ -426,7 +431,7 @@ class ConfigurationInfo extends GISJsonSerialised {
|
|||
private String configurationversion
|
||||
private String configurationSHA
|
||||
|
||||
ConfigurationInfo(script, configurationname = "", configurationURL = "", configurationversion = "", configurationSHA = "") {
|
||||
ConfigurationInfo(script, configurationname = '', configurationURL = '', configurationversion = '', configurationSHA = '') {
|
||||
super(script)
|
||||
this.configurationname = configurationname
|
||||
this.configurationURL = configurationURL
|
||||
|
|
@ -456,7 +461,7 @@ class ChecksumPair extends GISJsonSerialised {
|
|||
private String filepath
|
||||
private String sum
|
||||
|
||||
ChecksumPair(script, String filepath = "", String sum = "") {
|
||||
ChecksumPair(script, String filepath = '', String sum = '') {
|
||||
super(script)
|
||||
this.filepath = filepath
|
||||
this.sum = sum
|
||||
|
|
@ -481,7 +486,7 @@ class ChecksumSet extends GISJsonSerialised {
|
|||
private String artifactpath
|
||||
private ArrayList<ChecksumPair> checksumpairs
|
||||
|
||||
ChecksumSet(script, artifactpath = "") {
|
||||
ChecksumSet(script, artifactpath = '') {
|
||||
super(script)
|
||||
this.format = '0.1'
|
||||
this.artifactpath = artifactpath
|
||||
|
|
@ -566,7 +571,7 @@ class PublishableInfo extends GISJsonSerialised {
|
|||
private String format
|
||||
private String filepath
|
||||
|
||||
PublishableInfo(script, String filepath = "") {
|
||||
PublishableInfo(script, String filepath = '') {
|
||||
super(script)
|
||||
this.format = '0.1'
|
||||
this.filepath = filepath
|
||||
|
|
@ -613,7 +618,7 @@ class MetaInfo extends GISJsonSerialised {
|
|||
private MetaInfo meta
|
||||
private String offsetpath
|
||||
|
||||
RelatedMetaInfo_v0_1(script, offsetpath = "", MetaInfo meta = null) {
|
||||
RelatedMetaInfo_v0_1(script, offsetpath = '', MetaInfo meta = null) {
|
||||
super(script, '0.1')
|
||||
this.offsetpath = offsetpath
|
||||
this.meta = meta
|
||||
|
|
@ -639,7 +644,7 @@ class MetaInfo extends GISJsonSerialised {
|
|||
private String importpath
|
||||
private String offsetpath
|
||||
|
||||
RelatedMetaInfo_v0_2(script, importpath = "", offsetpath = "") {
|
||||
RelatedMetaInfo_v0_2(script, importpath = '', offsetpath = '') {
|
||||
super(script, '0.2')
|
||||
this.importpath = importpath
|
||||
this.offsetpath = offsetpath
|
||||
|
|
@ -1106,13 +1111,13 @@ MetaInfo metareset(script) {
|
|||
return mi
|
||||
}
|
||||
|
||||
MetaInfo metafromfolder(String folder = "") {
|
||||
MetaInfo metafromfolder(String folder = '') {
|
||||
MetaInfo buildmeta = new MetaInfo(this)
|
||||
buildmeta.deserialiseJson("${folder}/${MetaInfo.metafilepath()}")
|
||||
return buildmeta
|
||||
}
|
||||
|
||||
MetaInfo metafromfolderSlurper(String folder = "") {
|
||||
MetaInfo metafromfolderSlurper(String folder = '') {
|
||||
MetaInfo buildmeta = new MetaInfo(this)
|
||||
buildmeta.deserialiseJsonSlurper("${folder}/${MetaInfo.metafilepath()}")
|
||||
return buildmeta
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue