-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
HHH-19754 - Migrate XjcPlugin to using direct Java calls #10872
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 0 additions & 51 deletions
local-build-plugins/src/main/groovy/org/hibernate/build/xjc/XjcPlugin.java
Oops, something went wrong.
71 changes: 0 additions & 71 deletions
local-build-plugins/src/main/groovy/org/hibernate/build/xjc/XjcTask.groovy
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
local-build-plugins/src/main/java/org/hibernate/build/xjc/XjcListenerImpl.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* Copyright Red Hat Inc. and Hibernate Authors | ||
*/ | ||
package org.hibernate.build.xjc; | ||
|
||
import com.sun.tools.xjc.XJCListener; | ||
import org.gradle.api.Project; | ||
import org.xml.sax.SAXParseException; | ||
|
||
/** | ||
* Event listener for the XJC process. | ||
* | ||
* @author Steve Ebersole | ||
*/ | ||
public class XjcListenerImpl extends XJCListener { | ||
private final String schemaName; | ||
private final Project project; | ||
private boolean hadErrors; | ||
|
||
public XjcListenerImpl(String schemaName, Project project) { | ||
this.schemaName = schemaName; | ||
this.project = project; | ||
} | ||
|
||
public boolean hadErrors() { | ||
return hadErrors; | ||
} | ||
|
||
@Override | ||
public void generatedFile(String fileName, int current, int total) { | ||
project.getLogger().info( "XJC generated file ({}) : {}", schemaName, fileName ); | ||
} | ||
|
||
@Override | ||
public void message(String msg) { | ||
project.getLogger().info( "XJC message ({}) : {}", schemaName, msg ); | ||
} | ||
|
||
@Override | ||
public void info(SAXParseException exception) { | ||
project.getLogger().info( "XJC info ({})", schemaName, exception ); | ||
} | ||
|
||
@Override | ||
public void warning(SAXParseException exception) { | ||
project.getLogger().warn( "XJC warning ({})",schemaName, exception ); | ||
} | ||
|
||
@Override | ||
public void error(SAXParseException exception) { | ||
hadErrors = true; | ||
project.getLogger().error( "XJC error ({})", schemaName, exception ); | ||
} | ||
|
||
@Override | ||
public void fatalError(SAXParseException exception) { | ||
hadErrors = true; | ||
project.getLogger().error( "XJC fatal error ({})", schemaName, exception ); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.