當前位置: 首頁>>代碼示例>>Java>>正文


Java SrcVersion.isSrcVersion方法代碼示例

本文整理匯總了Java中org.srcdeps.core.SrcVersion.isSrcVersion方法的典型用法代碼示例。如果您正苦於以下問題:Java SrcVersion.isSrcVersion方法的具體用法?Java SrcVersion.isSrcVersion怎麽用?Java SrcVersion.isSrcVersion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.srcdeps.core.SrcVersion的用法示例。


在下文中一共展示了SrcVersion.isSrcVersion方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: execute

import org.srcdeps.core.SrcVersion; //導入方法依賴的package包/類
@Override
public void execute(DependencyResolveDetails dep) {
    ModuleVersionSelector requested = dep.getRequested();
    final String version = requested.getVersion();
    if (SrcVersion.isSrcVersion(version)) {
        final SrcdepsService srcdepsService = Wiring.getInjector().getInstance(SrcdepsService.class);
        srcdepsService.buildIfNecessary(requested.getGroup(), requested.getName(), version);
    }
}
 
開發者ID:srcdeps,項目名稱:srcdeps-gradle-plugin,代碼行數:10,代碼來源:SrcdepsResolver.java

示例2: assertNotSrcdeps

import org.srcdeps.core.SrcVersion; //導入方法依賴的package包/類
private static void assertNotSrcdeps(String group, String artifact, String version, String[] violation)
        throws LifecycleExecutionException {
    if (SrcVersion.isSrcVersion(version)) {
        throw new LifecycleExecutionException(String.format(
                "This build was configured to fail if there is a source dependency [%s:%s:%s] and %s [%s]", group,
                artifact, version, violation[0], violation[1]));
    }
}
 
開發者ID:srcdeps,項目名稱:srcdeps-maven,代碼行數:9,代碼來源:SrcdepsEnforcer.java

示例3: find

import org.srcdeps.core.SrcVersion; //導入方法依賴的package包/類
/**
 * In case the {@link #delegate} does not find the given artifact and the given artifact's version string is a
 * srcdeps version string, then the version is built from source and returned.
 *
 * @see org.eclipse.aether.repository.LocalRepositoryManager#find(org.eclipse.aether.RepositorySystemSession,
 *      org.eclipse.aether.repository.LocalArtifactRequest)
 */
@Override
public LocalArtifactResult find(RepositorySystemSession session, LocalArtifactRequest request) {
    log.debug("Srcdeps looking up locally {}", request.getArtifact());
    final LocalArtifactResult result = delegate.find(session, request);

    Artifact artifact = request.getArtifact();
    String version = artifact.getVersion();
    if (!result.isAvailable() && SrcVersion.isSrcVersion(version)) {

        final Configuration configuration = configurationProducer.getConfiguration();

        if (!configuration.isSkip()) {
            final ScmRepository scmRepo = findScmRepo(configuration.getRepositories(), artifact.getGroupId(), artifact.getArtifactId(),
                    version);
            SrcVersion srcVersion = SrcVersion.parse(version);
            try (PathLock projectBuildDir = buildDirectoriesManager.openBuildDirectory(scmRepo.getIdAsPath(),
                    srcVersion)) {

                /* query the delegate again, because things may have changed since we requested the lock */
                final LocalArtifactResult result2 = delegate.find(session, request);
                if (result2.isAvailable()) {
                    return result2;
                } else {
                    /* no change in the local repo, let's build */
                    BuilderIo builderIo = scmRepo.getBuilderIo();
                    IoRedirects ioRedirects = IoRedirects.builder() //
                            .stdin(IoRedirects.parseUri(builderIo.getStdin())) //
                            .stdout(IoRedirects.parseUri(builderIo.getStdout())) //
                            .stderr(IoRedirects.parseUri(builderIo.getStderr())) //
                            .build();

                    List<String> buildArgs = enhanceBuildArguments(scmRepo.getBuildArguments(),
                            configurationProducer.getConfigurationLocation(),
                            delegate.getRepository().getBasedir().getAbsolutePath());

                    BuildRequest buildRequest = BuildRequest.builder() //
                            .dependentProjectRootDirectory(configurationProducer.getMultimoduleProjectRootDirectory()) //
                            .projectRootDirectory(projectBuildDir.getPath()) //
                            .scmUrls(scmRepo.getUrls()) //
                            .srcVersion(srcVersion) //
                            .buildArguments(buildArgs) //
                            .timeoutMs(scmRepo.getBuildTimeout().toMilliseconds()) //
                            .skipTests(scmRepo.isSkipTests()) //
                            .forwardProperties(configuration.getForwardProperties()) //
                            .addDefaultBuildArguments(scmRepo.isAddDefaultBuildArguments()) //
                            .verbosity(scmRepo.getVerbosity()) //
                            .ioRedirects(ioRedirects) //
                            .versionsMavenPluginVersion(scmRepo.getMaven().getVersionsMavenPluginVersion())
                            .gradleModelTransformer(scmRepo.getGradle().getModelTransformer()).build();
                    buildService.build(buildRequest);

                    /* check once again if the delegate sees the newly built artifact */
                    final LocalArtifactResult newResult = delegate.find(session, request);
                    if (!newResult.isAvailable()) {
                        log.error(
                                "Srcdeps build succeeded but the artifact {} is still not available in the local repository",
                                artifact);
                    }
                    return newResult;
                }

            } catch (BuildException | IOException e) {
                log.error("Srcdeps could not build " + request, e);
            }

        }

    }

    return result;
}
 
開發者ID:srcdeps,項目名稱:srcdeps-maven,代碼行數:79,代碼來源:SrcdepsLocalRepositoryManager.java


注:本文中的org.srcdeps.core.SrcVersion.isSrcVersion方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。