cflint / CFLint

Static code analysis for CFML (a linter)
BSD 3-Clause "New" or "Revised" License
174 stars 84 forks source link

Machine independent new lines #13

Closed bill-bradley closed 10 years ago

bill-bradley commented 10 years ago

In the following file: https://github.com/ryaneberly/CFLint/blob/master/src/main/java/com/cflint/TextOutput.java I was looking to add machine independent new lines by replacing "\r\n" with one of the suggestions from this link: http://stackoverflow.com/questions/18549704/java-filewriter-create-a-new-line?lq=1

Not being a java developer, I'm unable to rebuild the project. I've added all the dependencies into eclipse, but when I try to run src/main/ant/build.xml by right clicking the file and running, I get an error message to provide Dfolder, which I try to do in the External Tools configuration, but I can't figure out where to add it.

Sorry if this is something simple. I'd love to be able to build this and help contribute to the project.

jjames967 commented 10 years ago

This is actually a Maven project, so you need to install Apache Maven in order to build it. http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html

jjames967 commented 10 years ago

I've added a build-instructions.txt for reference.

bill-bradley commented 10 years ago

Thanks, I followed those instructions and get this:

C:\repo\CFLint>mvn clean install [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building CFLint 0.1.8 [INFO] ------------------------------------------------------------------------ [WARNING] The POM for cfml.dictionary:cfml.dictionary:jar:0.0.1 is missing, no d ependency information available [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.311 s [INFO] Finished at: 2014-08-03T15:28:47-04:00 [INFO] Final Memory: 6M/157M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project CFLint: Could not resolve dependencies for project com.cflint:CFLint:jar:0.1.8: Failure to find cfml.dictionary:cfml.d ictionary:jar:0.0.1 in http://repo.maven.apache.org/maven2 was cached in the loc al repository, resolution will not be reattempted until the update interval of c entral has elapsed or updates are forced -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit ch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please rea d the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso lutionException

jjames967 commented 10 years ago

It's in your maven dependencies. I've attached the file structure for my .m2 directory. Make sure yours is similar (also note the file sizes).

untitled-1 untitled-2

bill-bradley commented 10 years ago

Thanks, that was the problem. They were renamed *.jar.lastUpdated I removed the .lastUpdated and now I can compile the project.

I'm going to play with the code, and maybe see if I can get this to compile on OSX too.

ryaneberly commented 10 years ago

Jerron, you rock. Thanks!

On Sun, Aug 3, 2014 at 4:39 PM, Bill Bradley notifications@github.com wrote:

Closed #13 https://github.com/ryaneberly/CFLint/issues/13.

— Reply to this email directly or view it on GitHub https://github.com/ryaneberly/CFLint/issues/13#event-148562695.

ryaneberly commented 10 years ago

opening until merged with main trunk

bill-bradley commented 10 years ago

It's been awhile since I've used Java, I'm not positive if what I did is the best approach or not, but it worked on my machine. The change made it easier to integrate with vim-syntastic. I'm interested in brushing up on Java in order to contribute further to this project.

ryaneberly commented 10 years ago

jjames967 and I have improved the build process.

You should only have to run mvn clean install now to build it.

Updated docs to follow soon, I hope.

Your contributions are welcome :-)

ryaneberly commented 10 years ago

Oh, and your code was fine, good work. The only change I made, was to call System.getProperty() once and store the result in a local variable.