-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-27299] Define disabled in ParameterizedJob rather than Abstr…
…actProject (#2866) * Offering default methods on ParameterizedJob. * Javadoc typo. * Cleaner use of default methods in ParameterizedJob. * Need to pick up jenkinsci/bridge-method-injector#15 to be able to build. * Sketch of pulling disabled functionality into ParameterizedJob. * EnableJobCommandTest.groovy → EnableJobCommandTest.java, and replacing deprecated Remoting-based CLI calls with CLICommandInvoker. * All CLI commands could be broken by a missing CLI.*.shortDescription key on just one! * Forgot to move CLI method short descriptions to new package. * Needed a @CLIResolver for ParameterizedJob. Adding an OptionHandler while we are here. * Trying to fix up access-modifier versions; started failing in CI today for unknown reasons. * Introduced <p:makeDisabled/> by analogy with <p:config-disableBuild/>. * Using new type bounds. * access-modifier 1.11 released. * MatrixProject and MavenModuleSet both expect to have access to makeDisabled.jelly. * Trying to generalize some more. * Minor simplification. * [JENKINS-34716] Generalizing doPolling and schedulePolling. * isBuildable * Obsolete comment. * Updated comments. * bridge-method-injector 1.17 * Unfortunately AbstractProject.schedulePolling cannot delegate to SCMTriggerItem. * bridge-method-injector 1.17
- Loading branch information
1 parent
37dfa99
commit 3af0cc6
Showing
72 changed files
with
365 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
core/src/main/java/hudson/cli/handlers/ParameterizedJobOptionHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright 2017 CloudBees, Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
package hudson.cli.handlers; | ||
|
||
import jenkins.model.ParameterizedJobMixIn; | ||
import org.kohsuke.MetaInfServices; | ||
import org.kohsuke.accmod.Restricted; | ||
import org.kohsuke.accmod.restrictions.DoNotUse; | ||
import org.kohsuke.args4j.CmdLineParser; | ||
import org.kohsuke.args4j.OptionDef; | ||
import org.kohsuke.args4j.spi.OptionHandler; | ||
import org.kohsuke.args4j.spi.Setter; | ||
|
||
/** | ||
* Refer to {@link jenkins.model.ParameterizedJobMixIn.ParameterizedJob} by its name. | ||
*/ | ||
@Restricted(DoNotUse.class) | ||
@MetaInfServices(OptionHandler.class) | ||
@SuppressWarnings("rawtypes") | ||
public class ParameterizedJobOptionHandler extends GenericItemOptionHandler<ParameterizedJobMixIn.ParameterizedJob> { | ||
|
||
public ParameterizedJobOptionHandler(CmdLineParser parser, OptionDef option, Setter<ParameterizedJobMixIn.ParameterizedJob> setter) { | ||
super(parser, option, setter); | ||
} | ||
|
||
@Override | ||
protected Class<ParameterizedJobMixIn.ParameterizedJob> type() { | ||
return ParameterizedJobMixIn.ParameterizedJob.class; | ||
} | ||
|
||
@Override | ||
public String getDefaultMetaVariable() { | ||
return "JOB"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.