diff options
author | Ivan Dubrov <idubrov@guidewire.com> | 2015-07-05 16:14:26 -0700 |
---|---|---|
committer | Ivan Dubrov <idubrov@guidewire.com> | 2015-07-05 16:14:26 -0700 |
commit | 205101f9ee0cd3b31c9083e625f587cb167fe0ba (patch) | |
tree | 92b6234a42bd4512db3fd4ad3a4d2984de0083c2 | |
parent | fde6e5661d74e262fa892a8b0ac8fa8923ff5e2f (diff) | |
download | dcevm-205101f9ee0cd3b31c9083e625f587cb167fe0ba.tar.gz dcevm-205101f9ee0cd3b31c9083e625f587cb167fe0ba.zip |
Verify Mercurial is installed
Show better error message if Mercurial is not installed or mq extension is not enabled.
Fixes #67
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | build.gradle | 41 | ||||
-rw-r--r-- | gradle/wrapper/gradle-wrapper.jar | bin | 51106 -> 52266 bytes | |||
-rw-r--r-- | gradle/wrapper/gradle-wrapper.properties | 4 |
4 files changed, 29 insertions, 18 deletions
@@ -10,7 +10,7 @@ You can download binaries [here](https://dcevm.github.io/). ## Supported versions -[pathes/](hotspot/.hg/patches/) contains patches for all supported versions. Each patch is named by concatenating prefix `full` or `light` with the OpenJDK HotSpot tag. `full` patches support full redefenition capabilities (including removal of superclasses, for example). `light` patches are easier to maintain, but they only support limited functionality (generally, additions to class hierarchies are fine, removals are not). +[hotspot/.hg/patches/](hotspot/.hg/patches/) contains patches for all supported versions. Each patch is named by concatenating prefix `full` or `light` with the OpenJDK HotSpot tag. `full` patches support full redefenition capabilities (including removal of superclasses, for example). `light` patches are easier to maintain, but they only support limited functionality (generally, additions to class hierarchies are fine, removals are not). HotSpot tag is the name of the tag in the corresponding HotSpot Mercurial repository ([Java 8](http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot)/[Java 7](http://hg.openjdk.java.net/jdk7u/jdk7u/hotspot)). diff --git a/build.gradle b/build.gradle index d40106d6..3f73ccc0 100644 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,25 @@ project('hotspot') { } } - task init(description: 'Initialize HotSpot repository') << { + task checkMercurial(description: 'Verify Mercurial is installed') << { + def os = new ByteArrayOutputStream() + try { + exec { + executable 'hg' + args 'help', 'init' + standardOutput = os + errorOutput = os + } + } catch (GradleException e) { + throw new GradleException("Failed to execute 'hg'. Make sure you have Mercurial installed!") + } + def str = os.toString() + if (!str.contains('--mq')) { + throw new GradleException("Mercurial does not have mq extension installed! Consult README.md for details.") + } + } + + task init(description: 'Initialize HotSpot repository', dependsOn: checkMercurial) << { file('hotspot').mkdir() exec { executable 'hg' @@ -45,8 +63,8 @@ project('hotspot') { task pull(description: 'Pull OpenJDK HotSpot changes', dependsOn: init) { doLast { def hotspotRepository = hotspotTag.contains('jdk7') ? - 'http://hg.openjdk.java.net/jdk7u/jdk7u/hotspot' : - 'http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot' + 'http://hg.openjdk.java.net/jdk7u/jdk7u/hotspot' : + 'http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot' exec { executable 'hg' args 'pull', hotspotRepository @@ -93,7 +111,7 @@ project('hotspot') { } } - def arguments = ['product': ['ENABLE_FULL_DEBUG_SYMBOLS=0'], + def arguments = ['product' : ['ENABLE_FULL_DEBUG_SYMBOLS=0'], 'fastdebug': ['ENABLE_FULL_DEBUG_SYMBOLS=1', 'STRIP_POLICY=no_strip', 'ZIP_DEBUGINFO_FILES=0']] ['product', 'fastdebug'].each { k -> @@ -123,21 +141,14 @@ project('hotspot') { } } -// Java projects for testing DCEVM -def setup(prjs, closure) { - prjs.each { prj -> - project(prj, closure) - } -} - -setup(['agent', 'dcevm'], { +configure([project(':agent'), project(':dcevm')]) { apply plugin: 'java' apply plugin: 'idea' repositories { mavenCentral() } -}) +} project('agent') { jar { @@ -162,7 +173,7 @@ project('native') { args "-I${jre}/../include/linux" args '-o' args 'build/libnatives.so' - args (arch == Arch.X86 ? '-m32' : '-m64') + args(arch == Arch.X86 ? '-m32' : '-m64') } else if (os == Os.MAC) { args "-I${jre}/../include/darwin" args '-o' @@ -213,7 +224,7 @@ project('dcevm') { ignoreFailures = true outputs.upToDateWhen { false } useJUnit { - excludeCategories ('com.github.dcevm.test.category.' + (flavor == 'light' ? 'Full' : 'Light')) + excludeCategories('com.github.dcevm.test.category.' + (flavor == 'light' ? 'Full' : 'Light')) } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar Binary files differindex 3c7abdf1..b5166dad 100644 --- a/gradle/wrapper/gradle-wrapper.jar +++ b/gradle/wrapper/gradle-wrapper.jar diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2352d1a6..703c33de 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Apr 24 15:01:45 PDT 2014 +#Sun Jul 05 15:22:09 PDT 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip |