briefcase icon indicating copy to clipboard operation
briefcase copied to clipboard

Application build failed on Windows because of RegexpMultiline rule in checkstyle file.

Open kkrawczyk123 opened this issue 8 years ago • 5 comments

Software versions

Briefcase v1.8.0, Java v1.8.0_151, operating system - Windows 7.

Problem description

Application build failed when tried to use gradlew build command. Problem is caused by RegexpMultiline mode and after removing it from checkstyle file application build finished successfully.

Lines removed from checkstyle.xml:

<module name="RegexpMultiline">
    <property name="format" value="\r\n"/>
    <property name="message" value="Do not use Windows line endings"/>
</module>

Steps to reproduce the problem

  1. Go to command line.
  2. Use gradlew build command.

Expected behavior

Building process should finish successfully.

Other information

Problem does not show up on Ubuntu system.

kkrawczyk123 avatar Nov 23 '17 09:11 kkrawczyk123

Hello @yanokwa I just rebased to the latest master and I wasn't able to reproduce this issue. The build passed with no errors. Note: OS is windows 10 and not windows 7

icemc avatar Feb 10 '18 21:02 icemc

Thanks, @icemc. @kkrawczyk123 Since you filed the issue, can you see if you can reproduce this?

yanokwa avatar Feb 12 '18 01:02 yanokwa

@yanokwa Yes , I checked on windows 10 and I still can reproduce this issue. I created new repository, cloned code forom git and tried gradlew.buld . This is my result: chceckstyle

When I removed lines from checkstyle.xml as in description above, build was successfull.

kkrawczyk123 avatar Feb 15 '18 12:02 kkrawczyk123

Was able to reproduce this on my new machine running windows 10

icemc avatar Feb 24 '18 01:02 icemc

I was also able to reproduce this issue on Win 10 Pro. I used a linux utility dos2unix to test and see how many files need to be converted to use Unix line endings (CRLF -> LF) and it looks like a few files in the repo need to be converted. After they were converted, the project was able to pass gradlew check -x test. There were failing unit tests and it appears the reason is because the path separator isn't compatible between windows and linux (eg. C:\Users\testUser\Video vs /usr/local/path, respectively). So, in the failing unit tests, wherever a directory or file is mentioned, you would have to replace the / with File.separator.

I believe this issue can be resolved by following these steps:

  1. Convert project repo files to use Unix line endings (should just be 2 files)
  2. Fix failing unit tests by replacing files and/or directories mentioned in a unit test with File.separator in the path.

poketim avatar May 14 '20 02:05 poketim