示例#1
0
    def applyPatches(self, pomFile):
        pom = Pom(pomFile)

        before = repr(pom)
        self.patchTool.apply(pom)
        after = repr(pom)

        if before == after:
            log.debug('No changes in %s' % pomFile)
            return

        log.info('Patching %s' % pomFile)
        pom.save()
 def applyPatches(self, pomFile):
     pom = Pom(pomFile)
     
     before = repr(pom)
     self.patchTool.apply(pom)
     after = repr(pom)
     
     if before == after:
         log.debug('No changes in %s' % pomFile)
         return
     
     log.info('Patching %s' % pomFile)
     pom.save()
示例#3
0
def test_removeNonOptional():
    pom = Pom('org.eclipse.birt.core-2.6.2.pom')

    tool = RemoveNonOptional()
    tool.run(pom)

    expected = 'withoutNonOptional.pom'
    tmp = '../tmp/%s' % expected
    pom.save(tmp)

    pos = repr(pom).find('<optional>false</optional>')
    eq_(-1, pos, 'POM still contains non-optional elements')

    compareFiles(expected, tmp)
def test_removeNonOptional():
    pom = Pom('org.eclipse.birt.core-2.6.2.pom')
    
    tool = RemoveNonOptional()
    tool.run(pom)
    
    expected = 'withoutNonOptional.pom'
    tmp = '../tmp/%s' % expected
    pom.save(tmp)

    pos = repr(pom).find('<optional>false</optional>')
    eq_(-1, pos, 'POM still contains non-optional elements')
    
    compareFiles(expected, tmp)
def test_ApplyPatches():
    
    loader = PatchLoader('../patches')
    loader.addRemoveNonOptional()
    loader.run()
    
    eq_('[RemoveNonOptional(), PatchSet(../patches/eclipse-3.6.2.patches), StripQualifiers()]', repr(loader.patches))
    
    pom = Pom('org.eclipse.birt.core-2.6.2.pom')
    
    tool = PatchTool(loader.patches)
    tool.apply(pom)
    
    expected = 'patchedPom.pom'
    tmp = '../tmp/%s' % expected
    pom.save(tmp)

    compareFiles(expected, tmp)
示例#6
0
def test_ApplyPatches():

    loader = PatchLoader('../patches')
    loader.addRemoveNonOptional()
    loader.run()

    eq_(
        '[RemoveNonOptional(), PatchSet(../patches/eclipse-3.6.2.patches), StripQualifiers()]',
        repr(loader.patches))

    pom = Pom('org.eclipse.birt.core-2.6.2.pom')

    tool = PatchTool(loader.patches)
    tool.apply(pom)

    expected = 'patchedPom.pom'
    tmp = '../tmp/%s' % expected
    pom.save(tmp)

    compareFiles(expected, tmp)