Repository: groovy Updated Branches: refs/heads/master 03cb2ca6c -> ee0044aa3
Minor refactoring Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/ee0044aa Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/ee0044aa Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/ee0044aa Branch: refs/heads/master Commit: ee0044aa352b5fe3aff39c88c6767c33b1ccf5c8 Parents: 03cb2ca Author: sunlan <[email protected]> Authored: Mon Sep 4 21:39:30 2017 +0800 Committer: sunlan <[email protected]> Committed: Mon Sep 4 21:40:01 2017 +0800 ---------------------------------------------------------------------- build.gradle | 10 +++++++++- src/main/antlr/GroovyLexer.g4 | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/ee0044aa/build.gradle ---------------------------------------------------------------------- diff --git a/build.gradle b/build.gradle index 35a333f..391775a 100644 --- a/build.gradle +++ b/build.gradle @@ -88,7 +88,7 @@ allprojects { group = 'org.codehaus.groovy' version = groovyVersion repositories { - if (!InetAddress.getByName('twitter.com').isReachable(3000)) { + if (isBuildInChina()) { // Try to use Aliyun maven repository when building in China maven { url 'http://maven.aliyun.com/nexus/content/groups/public' } } @@ -524,6 +524,14 @@ licenseReport { ] } +def isBuildInChina() { + try { + return !InetAddress.getByName('www.twitter.com').isReachable(3000) + } catch(e) { + return true + } +} + // UNCOMMENT THE FOLLOWING TASKS IF YOU WANT TO RUN LICENSE CHECKING //task licenseFormatCustom(type:nl.javadude.gradle.plugins.license.License) { // source = fileTree(dir:"src").include ("**/*.java",'**/*.groovy','**/*.html','**/*.css','**/*.xml','**/*.properties','**/*.properties') http://git-wip-us.apache.org/repos/asf/groovy/blob/ee0044aa/src/main/antlr/GroovyLexer.g4 ---------------------------------------------------------------------- diff --git a/src/main/antlr/GroovyLexer.g4 b/src/main/antlr/GroovyLexer.g4 index 6c8fd33..18e7b31 100644 --- a/src/main/antlr/GroovyLexer.g4 +++ b/src/main/antlr/GroovyLexer.g4 @@ -614,7 +614,7 @@ SignedInteger fragment Sign - : [+\-] + : [+-] ; fragment
