本文整理匯總了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;
}