• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ScmFile类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.maven.scm.ScmFile的典型用法代码示例。如果您正苦于以下问题:Java ScmFile类的具体用法?Java ScmFile怎么用?Java ScmFile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ScmFile类属于org.apache.maven.scm包,在下文中一共展示了ScmFile类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: calculateChangedModules

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
/**
 * Calculate the modules which needed to be rebuilt based on the list of changes from SCM.
 * 
 * @param projectRootpath Root path of the project.
 * @return The list of modules which needed to be rebuilt.
 */
public List<MavenProject> calculateChangedModules( Path projectRootpath )
{
    // TODO: Think about if we got only pom packaging modules? Do we
    // need to do something special there?
    List<MavenProject> result = new ArrayList<>();
    for ( MavenProject project : projectList )
    {
        Path relativize = projectRootpath.relativize( project.getBasedir().toPath() );
        for ( ScmFile fileItem : changeList )
        {
            boolean startsWith = new File( fileItem.getPath() ).toPath().startsWith( relativize );
            logger.debug( "startswith: " + startsWith + " " + fileItem.getPath() + " " + relativize );
            if ( startsWith )
            {
                if ( !result.contains( project ) )
                {
                    result.add( project );
                }
            }
        }
    }
    return result;
}
 
开发者ID:khmarbaise,项目名称:incremental-module-builder,代码行数:30,代码来源:ModuleCalculator.java


示例2: shouldResultInThreeModules

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
@Ignore
public void shouldResultInThreeModules()
{
    // TODO: Think about this test case. What
    // should be returned for the root module ?
    // If i call mvn -pl root ... it will not work?
    Path root = baseDir.toPath();
    List<ScmFile> changeList = Arrays.asList( 
      new ScmFile( "domain/subdomain/pom.xml", ScmFileStatus.MODIFIED ),
      new ScmFile( "domain/pom.xml", ScmFileStatus.MODIFIED ),
      new ScmFile( "pom.xml", ScmFileStatus.MODIFIED ) 
    );
    moduleCalculator = new ModuleCalculator( projectList, changeList );
    List<MavenProject> changedModules = moduleCalculator.calculateChangedModules( root );

    assertThat( changedModules ).hasSize( 3 ).containsOnly( domain, subdomain, parent );
}
 
开发者ID:khmarbaise,项目名称:incremental-module-builder,代码行数:18,代码来源:ModuleCalculatorTest.java


示例3: shouldResultInASingleModule

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
@Test
public void shouldResultInASingleModule()
{
    Path root = baseDir.toPath();
    List<ScmFile> changeList =
        Arrays.asList( new ScmFile( "domain/src/main/java/com/test.java", ScmFileStatus.MODIFIED ) );
    moduleCalculator = new ModuleCalculator( projectList, changeList );
    List<MavenProject> changedModules = moduleCalculator.calculateChangedModules( root );

    assertThat( changedModules ).hasSize( 1 ).containsExactly( domain );
}
 
开发者ID:khmarbaise,项目名称:incremental-module-builder,代码行数:12,代码来源:ModuleCalculatorTest.java


示例4: shouldResultInTwoModules

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
@Test
public void shouldResultInTwoModules()
{
    Path root = baseDir.toPath();
    List<ScmFile> changeList =
        Arrays.asList( new ScmFile( "domain/src/main/java/com/test.java", ScmFileStatus.MODIFIED ),
                       new ScmFile( "assembly/pom.xml", ScmFileStatus.MODIFIED ) );
    moduleCalculator = new ModuleCalculator( projectList, changeList );
    List<MavenProject> changedModules = moduleCalculator.calculateChangedModules( root );

    assertThat( changedModules ).hasSize( 2 ).containsOnly( domain, assembly );
}
 
开发者ID:khmarbaise,项目名称:incremental-module-builder,代码行数:13,代码来源:ModuleCalculatorTest.java


示例5: shouldResultInTwoModulesTwoChangesInSingleModule

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
@Test
public void shouldResultInTwoModulesTwoChangesInSingleModule()
{
    Path root = baseDir.toPath();
    List<ScmFile> changeList =
        Arrays.asList( new ScmFile( "domain/src/main/java/com/test.java", ScmFileStatus.MODIFIED ),
                       new ScmFile( "domain/src/main/java/Anton.java", ScmFileStatus.MODIFIED ),
                       new ScmFile( "assembly/pom.xml", ScmFileStatus.MODIFIED ) );

    moduleCalculator = new ModuleCalculator( projectList, changeList );
    List<MavenProject> changedModules = moduleCalculator.calculateChangedModules( root );

    assertThat( changedModules ).hasSize( 2 ).containsOnly( domain, assembly );
}
 
开发者ID:khmarbaise,项目名称:incremental-module-builder,代码行数:15,代码来源:ModuleCalculatorTest.java


示例6: shouldResultInTwoModulesDomainAndSubDomain

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
@Test
public void shouldResultInTwoModulesDomainAndSubDomain()
{
    Path root = baseDir.toPath();
    List<ScmFile> changeList = Arrays.asList( new ScmFile( "domain/subdomain/pom.xml", ScmFileStatus.MODIFIED ),
                                              new ScmFile( "domain/pom.xml", ScmFileStatus.MODIFIED ) );
    moduleCalculator = new ModuleCalculator( projectList, changeList );
    List<MavenProject> changedModules = moduleCalculator.calculateChangedModules( root );

    assertThat( changedModules ).hasSize( 2 ).containsOnly( domain, subdomain );
}
 
开发者ID:khmarbaise,项目名称:incremental-module-builder,代码行数:12,代码来源:ModuleCalculatorTest.java


示例7: handleEvent

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
/**
 * Creates a {@link ScmFile} for each event with the exception of directories.
 * Directory events are ignored.
 */
public void handleEvent( SVNEvent event, double progress )
{
    ScmFileStatus status = SvnJavaUtil.getScmFileStatus( event.getExpectedAction() );

    // Do nothing for events without files
    if ( event.getFile() == null || event.getExpectedAction() == SVNEventAction.COMMIT_DELTA_SENT
        || event.getExpectedAction() == SVNEventAction.COMMIT_COMPLETED || event.getNodeKind() != SVNNodeKind.FILE )
    {
        return;
    }

    if ( status == null )
    {
        if ( logger.isInfoEnabled() )
        {
            logger.info( "Unknown SVN file status: '" + event.getExpectedAction() + "' for file: "
                             + event.getFile().getAbsolutePath() );
        }

        status = ScmFileStatus.UNKNOWN;
    }

    if ( logger.isDebugEnabled() )
    {
        logger.debug( StringUtils.defaultString( status, event.getContentsStatus().toString() ) + " - "
                          + event.getFile().getAbsolutePath() );
    }

    String currentFile = event.getFile().getAbsolutePath();
    if ( currentFile.startsWith( baseDirectory.getAbsolutePath() ) )
    {
        currentFile = currentFile.substring( baseDirectory.getAbsolutePath().length() + 1 );
    }

    files.add( new ScmFile( currentFile, status ) );
}
 
开发者ID:olamy,项目名称:maven-scm-provider-svnjava,代码行数:41,代码来源:ScmFileEventHandler.java


示例8: doCommit

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
/**
 * FIXME remove when upgrading to scm 1.8 as the method commit has been to protected
 */
protected void doCommit( File workingDirectory, ScmRepository repository )
    throws Exception
{
    CheckInScmResult result = getScmManager().checkIn( repository, new ScmFileSet( workingDirectory ), "No msg" );

    assertTrue( "Check result was successful, output: " + result.getCommandOutput(), result.isSuccess() );

    List<ScmFile> committedFiles = result.getCheckedInFiles();

    assertEquals( "Expected 2 files in the committed files list " + committedFiles, 2, committedFiles.size() );
}
 
开发者ID:olamy,项目名称:maven-scm-provider-svnjava,代码行数:15,代码来源:SvnJavaStatusCommandTckTest.java


示例9: testList

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
@Test
public void testList()
    throws Exception
{
    ScmManager scmManager = (ScmManager) lookup( ScmManager.ROLE );
    String url = System.getProperty( "svnUrl" );
    String scmUrl = "scm:javasvn:" + url;
    SvnJavaScmProviderRepository repository =
        new SvnJavaScmProviderRepository( SVNURL.parseURIEncoded( url ), scmUrl );

    SvnJavaScmProvider provider = (SvnJavaScmProvider) scmManager.getProviderByUrl( scmUrl );

    ScmFileSet fileSet = new ScmFileSet( new File( "." ), new File( "." ) );

    ListScmResult listScmResult = provider.list( repository, fileSet, null );

    System.out.println( listScmResult.getFiles() );

    boolean containsPom = false;

    for ( ScmFile scmFile : listScmResult.getFiles() )
    {
        if ( StringUtils.equals( scmFile.getPath(), "pom.xml" ) )
        {
            containsPom = true;
        }
    }

    assertTrue( "pom.xml not in list result", containsPom );
}
 
开发者ID:olamy,项目名称:maven-scm-provider-svnjava,代码行数:31,代码来源:SvnJavaListCommandTest.java


示例10: doLocalModificationExist

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
private boolean doLocalModificationExist( StringBuilder message )
    throws MojoExecutionException
{
    boolean result = false;

    getLog().debug( "Verifying there are no local modifications ..." );

    List<ScmFile> changedFiles;

    try
    {
        changedFiles = getStatus();
    }
    catch ( ScmException e )
    {
        throw new MojoExecutionException( "An error has occurred while checking scm status.", e );
    }

    if ( !changedFiles.isEmpty() )
    {
        for ( ScmFile file : changedFiles )
        {
            message.append( file.toString() );

            message.append( System.lineSeparator() );
        }

        result = true;
    }

    return result;
}
 
开发者ID:mojohaus,项目名称:buildnumber-maven-plugin,代码行数:33,代码来源:CreateMojo.java


示例11: update

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
public List<ScmFile> update()
    throws MojoExecutionException
{
    try
    {
        ScmRepository repository = getScmRepository();

        ScmProvider scmProvider = scmManager.getProviderByRepository( repository );

        UpdateScmResult result = scmProvider.update( repository, new ScmFileSet( scmDirectory ) );

        if ( result == null )
        {
            return Collections.emptyList();
        }

        checkResult( result );

        if ( result instanceof UpdateScmResultWithRevision )
        {
            String revision = ( (UpdateScmResultWithRevision) result ).getRevision();
            getLog().info( "Got a revision during update: " + revision );
            this.revision = revision;
        }

        return result.getUpdatedFiles();
    }
    catch ( ScmException e )
    {
        throw new MojoExecutionException( "Couldn't update project. " + e.getMessage(), e );
    }

}
 
开发者ID:mojohaus,项目名称:buildnumber-maven-plugin,代码行数:34,代码来源:CreateMojo.java


示例12: localChanges

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
private Set<String> localChanges(Set<ScmFileStatus> statusToInclude, ScmRepository repository, File scmRoot) throws ScmException {
  final StatusScmResult status = this.manager.status(repository,
          new ScmFileSet(scmRoot));
  Set<String> affected = new LinkedHashSet<>();
  for (final ScmFile file : status.getChangedFiles()) {
    if (statusToInclude.contains(file.getStatus())) {
      affected.add(file.getPath());
    }
  }
  return affected;
}
 
开发者ID:hcoles,项目名称:pitest,代码行数:12,代码来源:ScmMojo.java


示例13: setFileWithStatus

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
private void setFileWithStatus(final ScmFileStatus status)
    throws ScmException {
  when(this.manager.status(any(ScmRepository.class), any(ScmFileSet.class)))
      .thenReturn(
          new StatusScmResult("", Arrays.asList(new ScmFile(
              "foo/bar/Bar.java", status))));
}
 
开发者ID:hcoles,项目名称:pitest,代码行数:8,代码来源:ScmMojoTest.java


示例14: testUnknownAndDeletedClassesAreNotMutationTested

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
public void testUnknownAndDeletedClassesAreNotMutationTested()
    throws Exception {
  setupConnection();
  when(this.manager.status(any(ScmRepository.class), any(ScmFileSet.class)))
      .thenReturn(
          new StatusScmResult("", Arrays.asList(new ScmFile(
              "foo/bar/Bar.java", ScmFileStatus.DELETED), new ScmFile(
              "foo/bar/Bar.java", ScmFileStatus.UNKNOWN))));
  this.testee.execute();
  verify(this.executionStrategy, never()).execute(any(File.class),
      any(ReportOptions.class), any(PluginServices.class), anyMap());
}
 
开发者ID:hcoles,项目名称:pitest,代码行数:13,代码来源:ScmMojoTest.java


示例15: createScmDiffResultWrapper

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
private ScmResultWrapper createScmDiffResultWrapper(final DiffScmResult diff)
{
  return new AbstractScmResultWrapper(diff)
  {
    @Override
  public List<ScmFile> getChangedFiles()
    {
      return diff.getChangedFiles();
    }
  };
}
 
开发者ID:release-engineering,项目名称:buildmetadata-maven-plugin,代码行数:12,代码来源:MavenScmRevisionNumberFetcher.java


示例16: createScmStatusResultWrapper

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
private ScmResultWrapper createScmStatusResultWrapper(
    final StatusScmResult diff)
{
  return new AbstractScmResultWrapper(diff)
  {
    @Override
  public List<ScmFile> getChangedFiles()
    {
      return diff.getChangedFiles();
    }
  };
}
 
开发者ID:release-engineering,项目名称:buildmetadata-maven-plugin,代码行数:13,代码来源:MavenScmRevisionNumberFetcher.java


示例17: createLocallyModifiedInfo

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
private LocallyModifiedInfo createLocallyModifiedInfo(
    final ScmResultWrapper result)
{
  final List<ScmFile> changedFiles = filter(result.getChangedFiles());
  final boolean locallyModified = !changedFiles.isEmpty();
  if (getLog().isDebugEnabled())
  {
    getLog().debug("  Modifications have" + (locallyModified ? "" : " not")
              + " been found.");
  }
  return new LocallyModifiedInfo(locallyModified, locallyModified
      ? toString(createSortedFiles(changedFiles)) : null);
}
 
开发者ID:release-engineering,项目名称:buildmetadata-maven-plugin,代码行数:14,代码来源:MavenScmRevisionNumberFetcher.java


示例18: createSortedFiles

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
private static Set<ScmFile> createSortedFiles(final List<ScmFile> changedFiles)
{
  final Set<ScmFile> set = new TreeSet<ScmFile>(new Comparator<ScmFile>()
  {
    @Override
  public int compare(final ScmFile o1, final ScmFile o2)
    {
      return o2.compareTo(o1);
    }
  });

  set.addAll(changedFiles);

  return set;
}
 
开发者ID:release-engineering,项目名称:buildmetadata-maven-plugin,代码行数:16,代码来源:MavenScmRevisionNumberFetcher.java


示例19: filter

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
private List<ScmFile> filter(final List<ScmFile> files)
{
  if (this.scmAccessInfo.isIgnoreDotFilesInBaseDir())
  {
    filterDotFiles(files);
  }
  return files;
}
 
开发者ID:release-engineering,项目名称:buildmetadata-maven-plugin,代码行数:9,代码来源:MavenScmRevisionNumberFetcher.java


示例20: filterDotFiles

import org.apache.maven.scm.ScmFile; //导入依赖的package包/类
private void filterDotFiles(final List<ScmFile> files)
{
  for (final Iterator<ScmFile> i = files.iterator(); i.hasNext();)
  {
    final ScmFile file = i.next();
    final String path = file.getPath();
    if (path.length() > 0 && path.charAt(0) == '.')
    {
      i.remove();
    }
  }
}
 
开发者ID:release-engineering,项目名称:buildmetadata-maven-plugin,代码行数:13,代码来源:MavenScmRevisionNumberFetcher.java



注:本文中的org.apache.maven.scm.ScmFile类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RequestLogImpl类代码示例发布时间:2022-05-22
下一篇:
Java VibrationModule类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap