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
This commit is contained in:
David Pursehouse 2015-03-04 14:52:04 +09:00
parent 325b6b5267
commit f326c904ff

View File

@ -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'