本文整理汇总了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);
}
}
示例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]));
}
}
示例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;
}