Highlights include:
  - Make sure gutter backgrounds stick to the rest of the gutter during
    horizontal scrolling.
  - JavaScript mode: Fix some small parsing bugs and improve TypeScript
    support.
  - The "jade" mode has been renamed to "pug".
Change-Id: I5079f75490586aec851d5cf99860a91b1a5d590b
		
	
		
			
				
	
	
		
			142 lines
		
	
	
		
			4.4 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			142 lines
		
	
	
		
			4.4 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
include_defs('//lib/maven.defs')
 | 
						|
include_defs('//lib/codemirror/cm.defs')
 | 
						|
 | 
						|
VERSION = '5.18.2'
 | 
						|
TOP = 'META-INF/resources/webjars/codemirror/%s' % VERSION
 | 
						|
TOP_MINIFIED = 'META-INF/resources/webjars/codemirror-minified/%s' % VERSION
 | 
						|
 | 
						|
maven_jar(
 | 
						|
  name = 'codemirror-minified',
 | 
						|
  id = 'org.webjars.npm:codemirror-minified:' + VERSION,
 | 
						|
  sha1 = '6755af157a7eaf2401468906bef67bbacc3c97f6',
 | 
						|
  attach_source = False,
 | 
						|
  license = 'codemirror-minified',
 | 
						|
  visibility = [],
 | 
						|
)
 | 
						|
 | 
						|
maven_jar(
 | 
						|
  name = 'codemirror-original',
 | 
						|
  id = 'org.webjars.npm:codemirror:' + VERSION,
 | 
						|
  sha1 = '18c721ae88eed27cddb458c42f5d221fa3d9713e',
 | 
						|
  attach_source = False,
 | 
						|
  license = 'codemirror-original',
 | 
						|
  visibility = [],
 | 
						|
)
 | 
						|
 | 
						|
DIFF_MATCH_PATCH_VERSION = '20121119-1'
 | 
						|
DIFF_MATCH_PATCH_TOP = ('META-INF/resources/webjars/google-diff-match-patch/%s'
 | 
						|
    % DIFF_MATCH_PATCH_VERSION)
 | 
						|
 | 
						|
maven_jar(
 | 
						|
  name = 'diff-match-patch',
 | 
						|
  id = 'org.webjars:google-diff-match-patch:' + DIFF_MATCH_PATCH_VERSION,
 | 
						|
  sha1 = '0cf1782dbcb8359d95070da9176059a5a9d37709',
 | 
						|
  license = 'Apache2.0',
 | 
						|
  attach_source = False,
 | 
						|
)
 | 
						|
 | 
						|
for archive, suffix, top in [('codemirror-original', '', TOP), ('codemirror-minified', '_r', TOP_MINIFIED)]:
 | 
						|
  # Main JavaScript and addons
 | 
						|
  genrule(
 | 
						|
    name = 'cm' + suffix,
 | 
						|
    cmd = ';'.join([
 | 
						|
        "echo '/** @license' >$OUT",
 | 
						|
        'unzip -p $(location :%s) %s/LICENSE >>$OUT' % (archive, top),
 | 
						|
        "echo '*/' >>$OUT",
 | 
						|
      ] +
 | 
						|
      ['unzip -p $(location :%s) %s/%s >>$OUT' % (archive, top, n) for n in CM_JS] +
 | 
						|
      ['unzip -p $(location :%s) %s/addon/%s >>$OUT' % (archive, top, n)
 | 
						|
       for n in CM_ADDONS]
 | 
						|
    ),
 | 
						|
    out = 'cm%s.js' % suffix,
 | 
						|
  )
 | 
						|
 | 
						|
  # Main CSS
 | 
						|
  genrule(
 | 
						|
    name = 'css' + suffix,
 | 
						|
    cmd = ';'.join([
 | 
						|
        "echo '/** @license' >$OUT",
 | 
						|
        'unzip -p $(location :%s) %s/LICENSE >>$OUT' % (archive, top),
 | 
						|
        "echo '*/' >>$OUT",
 | 
						|
      ] +
 | 
						|
      ['unzip -p $(location :%s) %s/%s >>$OUT' % (archive, top, n)
 | 
						|
       for n in CM_CSS]
 | 
						|
    ),
 | 
						|
    out = 'cm%s.css' % suffix,
 | 
						|
  )
 | 
						|
 | 
						|
  # Modes
 | 
						|
  for n in CM_MODES:
 | 
						|
    genrule (
 | 
						|
      name = 'mode_%s%s' % (n, suffix),
 | 
						|
      cmd = ';'.join([
 | 
						|
          "echo '/** @license' >$OUT",
 | 
						|
          'unzip -p $(location :%s) %s/LICENSE >>$OUT' % (archive, top),
 | 
						|
          "echo '*/' >>$OUT",
 | 
						|
          'unzip -p $(location :%s) %s/mode/%s/%s.js >>$OUT' % (archive, top, n, n),
 | 
						|
        ]
 | 
						|
      ),
 | 
						|
      out = 'mode_%s%s.js' % (n, suffix),
 | 
						|
    )
 | 
						|
 | 
						|
  # Themes
 | 
						|
  for n in CM_THEMES:
 | 
						|
    genrule(
 | 
						|
      name = 'theme_%s%s' % (n, suffix),
 | 
						|
      cmd = ';'.join([
 | 
						|
          "echo '/** @license' >$OUT",
 | 
						|
          'unzip -p $(location :%s) %s/LICENSE >>$OUT' % (archive, top),
 | 
						|
          "echo '*/' >>$OUT",
 | 
						|
          'unzip -p $(location :%s) %s/theme/%s.css >>$OUT' % (archive, top, n)
 | 
						|
        ]
 | 
						|
      ),
 | 
						|
      out = 'theme_%s%s.css' % (n, suffix),
 | 
						|
    )
 | 
						|
 | 
						|
  # Merge Addon bundled with diff-match-patch
 | 
						|
  genrule(
 | 
						|
    name = 'addon_merge%s' % suffix,
 | 
						|
    cmd = ';'.join([
 | 
						|
        "echo '/** @license' >$OUT",
 | 
						|
        'unzip -p $(location :%s) %s/LICENSE >>$OUT' % (archive, top),
 | 
						|
        "echo '*/\n' >>$OUT",
 | 
						|
        "echo '// The google-diff-match-patch library is from https://google-diff-match-patch.googlecode.com/svn-history/r106/trunk/javascript/diff_match_patch.js\n' >> $OUT",
 | 
						|
        "echo '/** @license' >>$OUT",
 | 
						|
        'cat $(location //lib:LICENSE-Apache2.0) >>$OUT',
 | 
						|
        "echo '*/' >>$OUT",
 | 
						|
        'unzip -p $(location :diff-match-patch) %s/diff_match_patch.js >>$OUT' % DIFF_MATCH_PATCH_TOP,
 | 
						|
        "echo ';' >> $OUT",
 | 
						|
        'unzip -p $(location :%s) %s/addon/merge/merge.js >>$OUT' % (archive, top)
 | 
						|
      ]
 | 
						|
    ),
 | 
						|
    out = 'addon_merge%s.js' % suffix,
 | 
						|
  )
 | 
						|
 | 
						|
  # Jar packaging
 | 
						|
  genrule(
 | 
						|
    name = 'jar' + suffix,
 | 
						|
    cmd = ';'.join([
 | 
						|
      'cd $TMP',
 | 
						|
      'mkdir -p net/codemirror/{addon,lib,mode,theme}',
 | 
						|
      'cp $(location :css%s) net/codemirror/lib/cm.css' % suffix,
 | 
						|
      'cp $(location :cm%s) net/codemirror/lib/cm.js' % suffix]
 | 
						|
      + ['cp $(location :mode_%s%s) net/codemirror/mode/%s.js' % (n, suffix, n)
 | 
						|
         for n in CM_MODES]
 | 
						|
      + ['cp $(location :theme_%s%s) net/codemirror/theme/%s.css' % (n, suffix, n)
 | 
						|
         for n in CM_THEMES]
 | 
						|
      + ['cp $(location :addon_merge%s) net/codemirror/addon/merge_bundled.js' % suffix]
 | 
						|
      + ['zip -qr $OUT net/codemirror/{addon,lib,mode,theme}']),
 | 
						|
    out = 'codemirror%s.jar' % suffix,
 | 
						|
  )
 | 
						|
 | 
						|
  prebuilt_jar(
 | 
						|
    name = 'codemirror' + suffix,
 | 
						|
    binary_jar = ':jar%s' % suffix,
 | 
						|
    deps = [
 | 
						|
      ':jar' + suffix,
 | 
						|
      '//lib:LICENSE-' + archive,
 | 
						|
    ],
 | 
						|
    visibility = ['PUBLIC'],
 | 
						|
  )
 | 
						|
 |