本文整理汇总了Java中hudson.plugins.git.extensions.impl.RelativeTargetDirectory.getWorkingDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java RelativeTargetDirectory.getWorkingDirectory方法的具体用法?Java RelativeTargetDirectory.getWorkingDirectory怎么用?Java RelativeTargetDirectory.getWorkingDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hudson.plugins.git.extensions.impl.RelativeTargetDirectory
的用法示例。
在下文中一共展示了RelativeTargetDirectory.getWorkingDirectory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: perform
import hudson.plugins.git.extensions.impl.RelativeTargetDirectory; //导入方法依赖的package包/类
/**
* Calls the SCM-specific function according to the chosen SCM. Only called for Non pipeline jobs
*
* @param build The Build
* @param launcher The Launcher
* @param listener The BuildListener
* @return boolean True on success.
* @throws InterruptedException An foreseen issue
*/
@Override
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException {
AbstractProject<?, ?> proj = build.getProject();
if (proj instanceof MatrixConfiguration) {
listener.getLogger().println(LOG_PREFIX + "MatrixConfiguration/sub - skipping publisher - leaving it to root job");
} else {
GitSCM scm = (GitSCM)proj.getScm();
RelativeTargetDirectory rtd = scm.getExtensions().get(RelativeTargetDirectory.class);
try {
FilePath wsForUs = rtd != null ? rtd.getWorkingDirectory(scm, proj, build.getWorkspace(), build.getEnvironment(listener), listener) : build.getWorkspace();
printWarningIfUnsupported(proj.getClass(), listener);
if(wsForUs != null) {
perform((Run) build, wsForUs, launcher, listener);
} else {
throw new InterruptedException("[PREINT] Fatal: Workspace is null");
}
} catch (IOException ex) {
listener.getLogger().println("[PREINT] FATAL: Unable to determine workspace");
throw new InterruptedException("[PREINT] FATAL: Unable to determine workspace");
}
}
return true;
}
示例2: resolveWorkspace
import hudson.plugins.git.extensions.impl.RelativeTargetDirectory; //导入方法依赖的package包/类
/**
* Returns the workspace
*
* @param build The Build
* @param listener The Listener
* @return a FilePath representing the workspace
* @throws InterruptedException Unforeseen issue
* @throws IOException Unforeseen IO issue
*/
public FilePath resolveWorkspace(AbstractBuild<?, ?> build, BuildListener listener) throws InterruptedException, IOException {
FilePath workspace = build.getWorkspace();
GitSCM scm = findScm(build, listener);
RelativeTargetDirectory dir = scm.getExtensions().get(RelativeTargetDirectory.class);
if (dir != null) {
workspace = dir.getWorkingDirectory(scm, build.getProject(), workspace, build.getEnvironment(listener), listener);
}
LOGGER.log(Level.FINE, "Resolved workspace to {0}", workspace);
return workspace;
}