本文整理汇总了Java中hudson.tasks.BuildStep类的典型用法代码示例。如果您正苦于以下问题:Java BuildStep类的具体用法?Java BuildStep怎么用?Java BuildStep使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuildStep类属于hudson.tasks包,在下文中一共展示了BuildStep类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveFullCmd
import hudson.tasks.BuildStep; //导入依赖的package包/类
/**
* @param bs A given {@link BuildStep}.
* @return the full tokenized command line including the program name.
*/
@Nullable
public static ImmutableList<String> resolveFullCmd(BuildStep bs) {
for (BuildStepDetailsProvider<BuildStep> provider : all()) {
if (provider.isApplicable(bs)) {
String fullCmd = provider.getFullCmd(bs);
// Some build steps are not triggered by command line command,
// for example, GoogleCloudStorageUploader. For them, the fullCmd
// with be null or empty.
if (!Strings.isNullOrEmpty(fullCmd)) {
return ImmutableList.copyOf(Arrays.asList(fullCmd.split("\\s+")));
} else {
return ImmutableList.<String>of();
}
}
}
return null;
}
开发者ID:GoogleCloudPlatform,项目名称:jenkins-deployment-manager-plugin,代码行数:22,代码来源:BuildStepDetailsProvider.java
示例2: initPython
import hudson.tasks.BuildStep; //导入依赖的package包/类
private void initPython() {
if (pexec == null) {
pexec = new PythonExecutor(this);
String[] jMethods = new String[2];
jMethods[0] = "started";
jMethods[1] = "finished";
String[] pFuncs = new String[2];
pFuncs[0] = "started";
pFuncs[1] = "finished";
Class[][] argTypes = new Class[2][];
argTypes[0] = new Class[3];
argTypes[0][0] = AbstractBuild.class;
argTypes[0][1] = BuildStep.class;
argTypes[0][2] = BuildListener.class;
argTypes[1] = new Class[4];
argTypes[1][0] = AbstractBuild.class;
argTypes[1][1] = BuildStep.class;
argTypes[1][2] = BuildListener.class;
argTypes[1][3] = boolean.class;
pexec.checkAbstrMethods(jMethods, pFuncs, argTypes);
String[] functions = new String[0];
int[] argsCount = new int[0];
pexec.registerFunctions(functions, argsCount);
}
}
示例3: resolveDetails
import hudson.tasks.BuildStep; //导入依赖的package包/类
/**
* @param bs A given {@link BuildStep}.
* @return the details obtained from the {@link BuildStep}, null if there is not an extension to
* obtain details.
*/
@Nullable
public static String resolveDetails(BuildStep bs) {
for (BuildStepDetailsProvider<BuildStep> provider : all()) {
if (provider.isApplicable(bs)) {
return provider.getDetails(bs);
}
}
return null;
}
开发者ID:GoogleCloudPlatform,项目名称:jenkins-deployment-manager-plugin,代码行数:15,代码来源:BuildStepDetailsProvider.java
示例4: resolveName
import hudson.tasks.BuildStep; //导入依赖的package包/类
/**
* @param bs a {@link BuildStep}.
* @return the display name of the {@link BuildStep}, if it is a {@link Describable}, otherwise
* null.
*/
@Nullable
public static String resolveName(BuildStep bs) {
for (BuildStepDetailsProvider<BuildStep> provider : all()) {
if (provider.isApplicable(bs)) {
return provider.getName(bs);
}
}
// Default to the display name of the plugin, if there isn't
// a detail provider
return defaultName(bs);
}
开发者ID:GoogleCloudPlatform,项目名称:jenkins-deployment-manager-plugin,代码行数:18,代码来源:BuildStepDetailsProvider.java
示例5: getSupportedBuildStepClass
import hudson.tasks.BuildStep; //导入依赖的package包/类
private Class<? extends BuildStep> getSupportedBuildStepClass() {
DetailFor detailFor = getClass().getAnnotation(DetailFor.class);
requireNonNull(detailFor, "@DetailFor must be present on BuildStepDetailsProviders");
requireNonNull(detailFor.value(), "@DetailFor must have a value()");
return detailFor.value();
}
开发者ID:GoogleCloudPlatform,项目名称:jenkins-deployment-manager-plugin,代码行数:8,代码来源:BuildStepDetailsProvider.java
示例6: getDetails_noJenkins
import hudson.tasks.BuildStep; //导入依赖的package包/类
@Test
@WithoutJenkins
public void getDetails_noJenkins() {
assertThat(BuildStepDetailsProvider.all()).isEmpty();
assertNull(BuildStepDetailsProvider.resolveDetails(mock(Maven.class)));
assertNull(BuildStepDetailsProvider.resolveName(mock(BuildStep.class)));
}
开发者ID:GoogleCloudPlatform,项目名称:jenkins-deployment-manager-plugin,代码行数:8,代码来源:BuildStepDetailsProviderTest.java
示例7: defaultName
import hudson.tasks.BuildStep; //导入依赖的package包/类
protected static String defaultName(BuildStep bs) {
return bs instanceof Describable<?> ? ((Describable<?>) bs).getDescriptor().getDisplayName()
: null;
}
开发者ID:GoogleCloudPlatform,项目名称:jenkins-deployment-manager-plugin,代码行数:5,代码来源:BuildStepDetailsProvider.java
示例8: isApplicable
import hudson.tasks.BuildStep; //导入依赖的package包/类
private boolean isApplicable(Class<? extends BuildStep> buildStepClass) {
// Checks whether this extension supports the given build step class.
return getSupportedBuildStepClass().isAssignableFrom(buildStepClass);
}
开发者ID:GoogleCloudPlatform,项目名称:jenkins-deployment-manager-plugin,代码行数:5,代码来源:BuildStepDetailsProvider.java
示例9: performStep
import hudson.tasks.BuildStep; //导入依赖的package包/类
@Override
public boolean performStep(final BuildStep execution, final BuildListener listener) throws IOException, InterruptedException {
return perform(execution, listener);
}
示例10: performStep
import hudson.tasks.BuildStep; //导入依赖的package包/类
@Override
public boolean performStep(final BuildStep buildStep, final BuildListener listener) throws InterruptedException, IOException {
return perform(buildStep, listener);
}
示例11: started
import hudson.tasks.BuildStep; //导入依赖的package包/类
@Override
public void started(AbstractBuild build, BuildStep bs, BuildListener listener) {
initPython();
pexec.execPythonVoid("started", build, bs, listener);
}
示例12: finished
import hudson.tasks.BuildStep; //导入依赖的package包/类
@Override
public void finished(AbstractBuild build, BuildStep bs, BuildListener listener, boolean canContinue) {
initPython();
pexec.execPythonVoid("finished", build, bs, listener, DataConvertor.fromBool(canContinue));
}
示例13: inheritanceLookupRequired
import hudson.tasks.BuildStep; //导入依赖的package包/类
public static boolean inheritanceLookupRequired(InheritanceProject root, boolean forcedInherit) {
//In a cyclic dependency, any form of inheritance would be ill-advised
try {
if (root.hasCyclicDependency()) {
return false;
}
} catch (NullPointerException ex) {
//The project might not be loaded completely yet; this will cause
//an NPE which means no inheritance should be queried
return false;
}
/* Otherwise, an exploration is only required when one of the following
* holds:
* 1.) The user wants to force inheritance
* 2.) The project is transient and has no real own configuration
* 3.) The project is called in the context of a build
* 4.) The queue queries properties of the project
*/
//Check forced inheritance or transience
if (forcedInherit || root.getIsTransient()) {
return true;
}
//Checking the Stapler Request, because it is fast
StaplerRequest req = Stapler.getCurrentRequest();
if (req != null) {
String uri = req.getRequestURI();
//Check if we request the build page
if (uri.endsWith("/build")) {
return true;
}
//Check if we were requested by page for a run
if (runUriRegExp.matcher(uri).matches()) {
return true;
}
}
//Check via expensive stack reflection
if (Reflection.calledFromClass(
Build.class, BuildCommand.class,
Queue.class, BuildTrigger.class,
Trigger.class, BuildStep.class
) ||
Reflection.calledFromMethod(
InheritanceProject.class,
"doBuild", "scheduleBuild2", "doBuildWithParameters"
)
) {
return true;
}
//In all other cases, we don't require (or want) inheritance
return false;
}
示例14: performStep
import hudson.tasks.BuildStep; //导入依赖的package包/类
boolean performStep(BuildStep buildStep, BuildListener listener) throws InterruptedException, IOException;