Skip to content

Commit

Permalink
[JENKINS-37389] add @symbol("custom") to CustomTool's descriptor
Browse files Browse the repository at this point in the history
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"
  • Loading branch information
agabrys authored and Adam Gabryś committed Jan 19, 2022
1 parent 45cb1c1 commit 2229f5f
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -211,6 +212,7 @@ public void check() throws CustomToolException {
}

@Extension
@Symbol("custom")
public static class DescriptorImpl extends ToolDescriptor<CustomTool> {

public DescriptorImpl() {
Expand Down

0 comments on commit 2229f5f

Please sign in to comment.