[ 
https://issues.apache.org/jira/browse/LUCENE-814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476030
 ] 

Doron Cohen commented on LUCENE-814:
------------------------------------

Hoss is right about both:

1) "ant fixcrlf" is much simpler to use,and does the job. I wish I have 
discovered that task before fighting with the replace tasks. 

2) QueryParser.jj has svn:eol-style native and hence when extracted under DOS, 
has Windows eols. There, "ant javacc" which runs as a Win app, would create 
Windows eols, all dandy. But if Cygwin is used for checkout, jj has Unix eols, 
however here "ant javacc" still runs as Win app, and the result file is a mix 
of eol styles. 

I think there is no fixed (non native) setting for jj that would sattisfy all 
situations. Also, I think this is why Eclipse svn plugin (subclipse) sometimes 
shows a file as entirely modified (comparing to repository head) - may be 
related to checkout with cygwin while Eclipse runs as Win app.

So I see three options:
1 - leave as is (do not fix)
2 - add target to build.xml to allow easily fixing eol (what one can do with 
sed)
3 - fix eol-style to be the same as that of the jj file (worth the effort?)

Preferences?

> javacc on Win32 (cygwin) creates wrong line endings - fix them with 'ant 
> replace'
> ---------------------------------------------------------------------------------
>
>                 Key: LUCENE-814
>                 URL: https://issues.apache.org/jira/browse/LUCENE-814
>             Project: Lucene - Java
>          Issue Type: Task
>          Components: Build
>         Environment: Windows, Cygwin
>            Reporter: Doron Cohen
>         Assigned To: Doron Cohen
>            Priority: Minor
>             Fix For: 2.1
>
>         Attachments: 814.javacc.line.ends.patch
>
>
> "ant javacc" in Windows/Cygwin generates files with wrong line endings (\r  
> or \r\n instead of *Nix's \n). 
> I managed to get rid of those using    perl -p -e 's/(\r\n|\n|\r)/\n/g'
> Some useful info on line ending issues is in 
> http://en.wikipedia.org/wiki/Newline
> After wasting some time to get rid of those, I modified javacc-QueryParser 
> build.xml task to take care of that.
> So now QueryParser files created with "ant javacc" are fixed (if required) to 
> have \n as line ends.
> Should probably do that also for the other javacc targets: javacc-HTMLParser 
> and javacc-StandardAnalyzer(?)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to