From b9203a9db079ee468ce22b22d4454319e7bce12e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Gabry=C5=9B?= Date: Wed, 19 Jan 2022 11:48:22 +0100 Subject: [PATCH] [JENKINS-37389] add @Symbol("custom") to CustomTool's descriptor The `@Symbol` annotation defines a unique identifier which is used by DSL. Whit this commit it is possible to distinguish a difference between tools when the the `tool` step is called. Example: * tool name: 'myTool', type: 'jdk' <- returns JDK with id "myTool" * tool name: 'myTool', type: 'custom' <- returns custom tool with id "myTool" --- .../com/cloudbees/jenkins/plugins/customtools/CustomTool.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/cloudbees/jenkins/plugins/customtools/CustomTool.java b/src/main/java/com/cloudbees/jenkins/plugins/customtools/CustomTool.java index 67b7af0..561abb2 100644 --- a/src/main/java/com/cloudbees/jenkins/plugins/customtools/CustomTool.java +++ b/src/main/java/com/cloudbees/jenkins/plugins/customtools/CustomTool.java @@ -53,6 +53,7 @@ import jenkins.MasterToSlaveFileCallable; import jenkins.plugins.customtools.util.envvars.VariablesSubstitutionHelper; +import org.jenkinsci.Symbol; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.stapler.DataBoundConstructor; @@ -211,6 +212,7 @@ public void check() throws CustomToolException { } @Extension + @Symbol("custom") public static class DescriptorImpl extends ToolDescriptor { public DescriptorImpl() {