Skip to content

Instantly share code, notes, and snippets.

@mojavelinux
Created August 26, 2010 17:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mojavelinux/551773 to your computer and use it in GitHub Desktop.
Save mojavelinux/551773 to your computer and use it in GitHub Desktop.
#!/usr/bin/env groovy
def modifyFile(file, Closure processText) {
def text = file.text
file.write(processText(text))
}
def phase2_dir = 'import-phase2'
def root = new File(phase2_dir)
def metafiles = root.eachFileRecurse({
if (it.file && it.name ==~ /^(readme.txt|pom\.xml$)/) {
modifyFile(it, { text ->
text = (text =~ /http:\/\/anonsvn\.jboss\.org\/repos\/(weld|seam\/modules)\/([a-z]+)(\/[a-z]*)*/).replaceAll('git://github.com/seam/$2.git')
text = (text =~ /https:\/\/svn\.jboss\.org\/repos\/(weld|seam\/modules)\/([a-z]+)(\/[a-z]*)*/).replaceAll('git@github.com:seam/$2.git')
text = text.replaceAll(/github\.com(:|\/)seam\/remoting/, 'github.com$1seam/js-remoting')
text = text.replaceAll(/github\.com(:|\/)seam\/xml/, 'github.com$1seam/xml-config')
text = (text =~ /http:\/\/fisheye\.jboss\.org\/browse\/(([Ss]eam\/)+modules|weld)\/([a-z]+)(\/[a-z]*)*/).replaceAll('http://github.com/seam/$3')
text = (text =~ /http:\/\/anonsvn\.jboss\.org\/repos\/seam\/([a-z]+\/)*(parent|examples|dist)(\/trunk(\/[a-z\-]*)?)?/).replaceAll('git://github.com/seam/$2.git')
text = (text =~ /https:\/\/svn\.jboss\.org\/repos\/seam\/([a-z]+\/)*(parent|examples|dist)(\/trunk(\/[a-z\-]*)?)?/).replaceAll('git@github.com:seam/$2.git')
text = text.replaceAll(/http:\/\/fisheye\.jboss\.org\/browse\/[Ss]eam(\/[a-z\-]*)*/, "http://github.com/seam")
text = text.replaceAll("http://anonsvn.jboss.org/repos/seam", "http://github.com/seam")
return text
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment