-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Rule Logger #1040
Add Rule Logger #1040
Conversation
…nd assign them to the RuleFactory through the Jsonschema2Pojo#generate method.
…e all together. Now it adds the correct classpathPrefix to import all libraries from a subdirectory lib which is where copy-dependencies puts them and in general that is good practice if you were to distribute this tool.
Opps .. tests need logger now... actually it looks like the test itself maybe failed. Added some mocking to RuleFactory in a few tests. But problem may be elsewhere. |
@joelittlejohn |
jsonschema2pojo-ant/src/main/java/org/jsonschema2pojo/ant/AntRuleLogger.java
Outdated
Show resolved
Hide resolved
Strange, I have no idea why it says that this zip file was empty:
When I download this using the same link I don't get an empty file. |
I think the stack trace above it gives more hint at what is going on but still not sure how to fix it. Are you open to updating the groovy, Gradle, groovy maven plugin to resolve this issue? Or I could just not support logging under the Gradle plugin. |
The gradle plugin project failing is a weird problem because it fails only on the Travis CI server and not a local maven execution of it. |
…e already set to test scope by dependency management.
… directory. Added .gitattributes to alwasy checkout shell scripts with linux line endings. Removed .bash version because it really is not needed.
…ing.GradleConnectionException: Could not install Gradle distribution from 'http://services.gradle.org/distributions/gradle-2.3-bin.zip problem'.
jsonschema2pojo-gradle-plugin/src/test/resources/simplelogger.properties
Outdated
Show resolved
Hide resolved
script: | ||
- rm -rf ~/.gradle/wrapper/dists/gradle-2.3-bin | ||
- mvn clean install -DskipTests | ||
- mvn verify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for install
then verify
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to resolve the build issues and found this commit (81adfe7) and it mentioned that CI tests might be broken unless do a build then do a test build.
@ben-manes Is this unnecessary now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be necessary with the eclipse-groovy-compiler. I will try removing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That commit comment wrt CI failure was a one-time breakage and no longer relevant. Just required a clean if I recall correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joelittlejohn I have already removed the extra build and haven't notice any problems.
@ben-manes Thanks for your input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think all the changes in this file can be reverted, is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed the hacky gradle bin and double building stuff from Travis CI configuration but left in the caching.
@joelittlejohn Since #1041 is also failing I believe this failure is not a result of my changes. Something is broken with the build. This is a far reach but @ben-manes do you have any insight into this problem? |
I believe it is due to not following a redirect. They enforce HTTPS now and their http client probably doesn't have redirect enabled. So maybe a 1 character fix! 😄
|
I literally asked you then thought to do that myself. Lets see if it works. |
@ben-manes I also switch back to the groovy-eclipse-compiler, these days which groovy plugin should you use? I have read lots of write-ups on "which maven plugin/compiler for groovy should I use" but not being a groovy developer I am still not sure what this project should be using. I changed it because I thought it might fix my build/execution issues but it seems like it might of been unrelated now. |
I can't answer at that detail. I simply hacked together a few plugins for my needs and contributed them upstream (flyway, js2p, jooq, dependencyUpdates). I learned enough Groovy to write simple build scripts and plugins, but this was Gradle 1.x world (2012). I don't use Groovy otherwise and tried to handoff the plugins since this isn't my area of expertise. I'm happy to be a sounding board but my knowledge is fairly limited and outdated. |
I read that the gmaven(plus) plugins had more features and may support more things but I believe thease are things we don't require, so since the eclipse plugin is an official plugin we should use it instead. I believe there is other improvements to the jsonschema2pojo-gradle-plugin and maybe it should actually be build with gradle (embedded in our maven) instead but that is out of scope with something I am willing to do right now. |
@joelittlejohn I believe I have responded and/or addressed all your comments and the build looks good now. |
Great, thanks for looking at the Gradle build issues. I think we still have a few changes we need to make here, in particular any change that removes Also, is there any reason the CLI logger needs to use SLF4J rather than just |
I guess if this was jsonschema2-pojo-embedded (a fictional module) that would be integrated in another application/system then it should use SLF4J but I agree. Although there would be no way to turn off loggers for CLI if people started using info/debug/trace and it could get quit noisy. UPDATE: I updated CLI to support command line provided log level. |
@REM | ||
|
||
@echo off | ||
java -jar "%~dp0/../lib/${project.build.finalName}.jar" %* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your branch is still showing a change in this file from CRLF line endings to LF. Could you maybe git checkout origin/master jsonschema2pojo-cli/src/main/scripts/jsonschema2pojo.bat
and commit that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it was CRLF on my machine and source tree wasn't showing any changes. I had to manually remove the file and check it out like you suggested then add it via command line git commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added .bat to the .gitattributes file and renormlized that bat file. It may still show changes because it was original in the git repo as LF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Dan. Everything looks good but this is the last problem in the PR. In master
this file uses CRLF (Windows) line endings not LF:
$ file jsonschema2pojo-cli/src/main/scripts/jsonschema2pojo.bat
jsonschema2pojo-cli/src/main/scripts/jsonschema2pojo.bat: DOS batch file, UTF-8 Unicode text, with CRLF line terminators
You can also try vim -b jsonschema2pojo-cli/src/main/scripts/jsonschema2pojo.bat
to see the ^M
characters.
In your branch (this PR) changes the line endings in this file to LF.
I've actually changed my mind about this .gitattributes
file, it's adding more confusion and I don't want git doing anything to change the files under version control. Please remove .gitattributes
and also remove your changes to this file (git checkout origin/master jsonschema2pojo-cli/src/main/scripts/jsonschema2pojo.bat
). Then we're good to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
…mic what SLFJ would provide. Impelment log level functionality to CLI so it does not get flooded with high verbose logging especially if debug and verbos log levels are used.
… Gradle download problem.
…ption is choosen it will exit after printing log levels.
…treated as CRLF.
… going to use default configuration for now.
@joelittlejohn I am ready for you to take another pass of seeing if this pull request is ready to merge. |
@joelittlejohn I would like to wrap up this pull request and possibly #1041. I would like to write a RuleFactory with a custom EnumRule for my project that has the name fallback resolution as described in #999 and I want it to extend EnumRule instead of re-implementing it. |
No description provided.