Skip to content
Permalink
Browse files

[JENKINS-37215] Apply symbols where available.

  • Loading branch information...
jglick committed Feb 5, 2018
1 parent f3594f9 commit 646016200a6aaeabdf2207f7fa75e9a8579918fb
Showing with 6 additions and 3 deletions.
  1. +2 −2 pom.xml
  2. +4 −1 src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/html.groovy
@@ -28,7 +28,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.1</version>
<version>3.4</version>
<relativePath />
</parent>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
@@ -105,7 +105,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>structs</artifactId>
<version>1.12</version>
<version>1.14-20180205.130907-1</version> <!-- TODO https://github.com/jenkinsci/structs-plugin/pull/35 -->
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
@@ -1,5 +1,6 @@
package org.jenkinsci.plugins.workflow.cps.Snippetizer

import org.jenkinsci.plugins.structs.SymbolLookup
import org.jenkinsci.plugins.structs.describable.ArrayType
import org.jenkinsci.plugins.structs.describable.AtomicType
import org.jenkinsci.plugins.structs.describable.DescribableModel
@@ -161,8 +162,10 @@ def describeType(ParameterType type, int headerLevel) throws Exception {
} else {
dl(class:'schema') {
for (Map.Entry<String, DescribableModel> entry : ((HeterogeneousObjectType) type).getTypes().entrySet()) {
Set<String> symbols = SymbolLookup.getSymbolValue(entry.getValue().getType());
String symbol = symbols.isEmpty() ? DescribableModel.CLAZZ + ": '" + entry.getKey() + "'" : symbols.iterator().next();
dt {
code(DescribableModel.CLAZZ + ": '" + entry.key + "'")
code(symbol)
}
dd{
generateHelp(entry.value, nextHeaderLevel);

0 comments on commit 6460162

Please sign in to comment.
You can’t perform that action at this time.