From f326c904ff922ff41cee212b409bab2ae5631b7d Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 4 Mar 2015 14:52:04 +0900 Subject: [PATCH] Add support to consume CodeMirror from org.webjars on Maven Central CodeMirror is available as a JAR file on Maven Central under the org.webjars group ID. Add support in the download wrapper to consume CodeMirror from this location and extract from the JAR file rather than a ZIP file. The support to download as a ZIP file from the Gerrit bucket is kept for backward compatibility in case we want to use our own build of the library at any point in the future. Change-Id: Ie21b72b57fe1a90894c4aadd7ef4bdc91d055cd5 --- lib/codemirror/BUCK | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/codemirror/BUCK b/lib/codemirror/BUCK index dc163c2239..cfb43ff172 100644 --- a/lib/codemirror/BUCK +++ b/lib/codemirror/BUCK @@ -2,12 +2,19 @@ include_defs('//lib/maven.defs') include_defs('//lib/codemirror/cm.defs') include_defs('//lib/codemirror/closure.defs') +REPO = GERRIT VERSION = 'd0a2ddaa04' SHA1 = '1df573141fcceec039d0260d2d66a5b15d663f9a' -URL = GERRIT + 'net/codemirror/codemirror-%s.zip' % VERSION -ZIP = 'codemirror-%s.zip' % VERSION -TOP = 'codemirror-%s' % VERSION +if REPO == MAVEN_CENTRAL: + URL = REPO + 'org/webjars/codemirror/%s/codemirror-%s.jar' % (VERSION, VERSION) + TOP = 'META-INF/resources/webjars/codemirror/%s' % VERSION + ZIP = 'codemirror-%s.jar' % VERSION +else: + URL = REPO + 'net/codemirror/codemirror-%s.zip' % VERSION + TOP = 'codemirror-%s' % VERSION + ZIP = 'codemirror-%s.zip' % VERSION + CLOSURE_VERSION = 'v20141120'