diff options
author | Ivan Dubrov <idubrov@guidewire.com> | 2014-04-30 14:49:27 -0700 |
---|---|---|
committer | Ivan Dubrov <idubrov@guidewire.com> | 2014-04-30 14:49:27 -0700 |
commit | b5cdfa25d3e04841d2a90ae6d792a2672745e3b7 (patch) | |
tree | 56a928e644ff05acc392a35d170dd64ded4b0e0b /build.gradle | |
parent | 615430e4e81681cbb25f831c6b0b4add1bfe324d (diff) | |
download | dcevm-b5cdfa25d3e04841d2a90ae6d792a2672745e3b7.tar.gz dcevm-b5cdfa25d3e04841d2a90ae6d792a2672745e3b7.zip |
Migrating to Mercurial MQ
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 70 |
1 files changed, 43 insertions, 27 deletions
diff --git a/build.gradle b/build.gradle index efa1d056..500cb9b5 100644 --- a/build.gradle +++ b/build.gradle @@ -33,47 +33,63 @@ project('hotspot') { } } - task clone(description: 'Clone HotSpot repository') { - onlyIf { !file('hotspot').exists() } + task init(description: 'Initialize HotSpot repository') << { + file('hotspot').mkdir() + exec { + executable 'hg' + args 'init' + ignoreExitValue = true + } + } + + task pull(description: 'Pull OpenJDK HotSpot changes') { doLast { def hotspotRepository = hotspotTag.contains('jdk7') ? 'http://hg.openjdk.java.net/jdk7u/jdk7u/hotspot' : 'http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot' exec { - workingDir '..' executable 'hg' - args 'clone', hotspotRepository + args 'pull', hotspotRepository } } } - task patch(description: 'Patch HotSpot sources', dependsOn: clone) << { - exec { - executable 'hg' - args 'pull' - } - exec { - executable 'hg' - args 'update', '-C', '-r', hotspotTag - } - new ByteArrayOutputStream().withStream { os -> + task patch(description: 'Patch HotSpot sources', dependsOn: pull) { + + doLast { exec { - workingDir 'hotspot' executable 'hg' - args 'status' - standardOutput os + args 'qpop', '-a' } - // Purge unversioned files - def str = os.toString() - def matcher = str =~ /(?m)^\?\s+(.*)$/ - matcher.each { - ant.delete(file: new File(file('hotspot'), it[1])) + exec { + executable 'hg' + args 'update', '-C', '-r', hotspotTag + } + new ByteArrayOutputStream().withStream { os -> + exec { + workingDir 'hotspot' + executable 'hg' + args 'status' + standardOutput os + } + // Purge unversioned files + def str = os.toString() + def matcher = str =~ /(?m)^\?\s+(.*)$/ + matcher.each { + ant.delete(file: new File(file('hotspot'), it[1])) + } + } + def guards = [flavor, hotspotTag.contains('jdk7') ? 'jdk7' : 'jdk8', + hotspotTag, flavor + '-' + hotspotTag] + exec { + executable 'hg' + args 'qselect' + args guards + } + exec { + executable 'hg' + args 'qpush', '-a' } - } - // Use hg import since ant.patchfile requires 'patch' to be installed - exec { - executable 'hg' - args 'import', '--no-commit', "../patches/${flavor}-${hotspotTag}.patch" } } |