getodk / briefcase

ODK Briefcase is a Java application for fetching and pushing forms and their contents. It helps make billions of data points from ODK portable. Contribute and make the world a better place! ✨💼✨
https://docs.getodk.org/briefcase-intro
Other
60 stars 153 forks source link

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

Open kkrawczyk123 opened 6 years ago

kkrawczyk123 commented 6 years ago

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.

icemc commented 6 years ago

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

yanokwa commented 6 years ago

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

kkrawczyk123 commented 6 years ago

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

icemc commented 6 years ago

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

poketim commented 4 years ago

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.