Adds a new CONCAT_TEXT rule to jar tool to handle text files that might be missing the last newline.

Review Request #2875 — Created Sept. 24, 2015 and submitted

zundel
pants
zundel/fix-jar-tool-concat-text
2251, 2257
3ab1973...
pants-reviews
areitz, gmalmquist, jsirois

Insures that non-empty text files always end with a newline. This handles META-INF/services files that do not end with a newline that appear in the while.

A followon change will publish jar-tool and change pants to use CONCAT_TEXT to modify services files.

CI running at https://travis-ci.org/pantsbuild/pants/builds/81860566
Added unit tests
Locally, used the jersey-core and jersey-multipart jars which have META-INF/services files with missing newlines:

java -jar dist/jar-tool.jar output.jar -jars=./jersey-core-1.19.jar,jersey-multipart-1.19.jar -policies='^META-INF/services/=CONCAT_TEXT'
ZU
JS
  1. 
      
  2. Perhaps s/Assumes/Treats/, works just fine for text.  Not all text formats are line delimited for example.
  3. Similar - assumes these entries are line-delimited text files.
  4. src/python/pants/version.py (Diff revision 1)
     
     
    revert
  5. 
      
AR
  1. Thanks for this Eric.

  2. nit: maybe this should be the same text as above, but with ", appending newlines if needed" tacked onto the end?

  3. nit: s/TOOD/TODO

  4. 
      
ZU
ZU
Review request changed

Status: Closed (submitted)

Change Summary:

Commit 04124013263f341d2570ff4d91ee8e781e640402

Loading...