当前位置: 首页>>代码示例>>Java>>正文


Java RelativeTargetDirectory.getWorkingDirectory方法代码示例

本文整理汇总了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;
}
 
开发者ID:Praqma,项目名称:pretested-integration-plugin,代码行数:33,代码来源:PretestedIntegrationPostCheckout.java

示例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;
}
 
开发者ID:Praqma,项目名称:pretested-integration-plugin,代码行数:22,代码来源:GitBridge.java


注:本文中的hudson.plugins.git.extensions.impl.RelativeTargetDirectory.getWorkingDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。