Skip to content

HHH-19638: Document the Ant enhancement task in User Guide tooling section #10622

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

Merged
merged 1 commit into from
Jul 30, 2025

Conversation

koentsje
Copy link
Member

@koentsje koentsje commented Jul 24, 2025

Create a test for 'org.hibernate.tool.enhance.EnhancementTask' that covers all the configuration settings


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-19638

@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Jul 24, 2025

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.

@koentsje koentsje requested a review from sebersole July 24, 2025 14:16
Copy link
Member

@sebersole sebersole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just the testing. I'll leave that to you as I have no knowledge of integration testing Ant tasks inside JUnit - I'll trust your judgement there.

Were you planning on a second PR for the User Guide changes? Just not sure if I should apply this and look for a second, or wait for more commits.

@@ -8,6 +8,6 @@ plugins {
description = 'Annotation Processor to generate JPA 2 static metamodel classes'

dependencies {
compileOnly libs.ant
implementation libs.ant
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This affects the user's build in terms of Ant version though, right? I forget the impact, if any, that might have. Just a question.

private boolean methodIsPresentInClass(String methodName, String className) throws Exception {
Class<?> classToCheck = getTestClassLoader().loadClass( className );
try {
Object m = classToCheck.getMethod( methodName, new Class[] {} );

Check notice

Code scanning / CodeQL

Unread local variable Note test

Variable 'Object m' is never read.

private void copyJavFiles() throws Exception {
File srcDir = new File(projectDir, "src");
srcDir.mkdir();

Check notice

Code scanning / CodeQL

Ignored error status of call Note test

Method copyJavFiles ignores exceptional return value of File.mkdir.
…ction

  - Create a test for 'org.hibernate.tool.enhance.EnhancementTask' that covers all the configuration settings (except for 'failOnError')
  - Describe how to add the task definition to your Ant build, with minimal example
  - Add a description and short example for each of the configuration attributes and/or elements
@koentsje
Copy link
Member Author

@sebersole I have added the documentation to the PR. Also, I rolled back the implementation libs.ant change in the Gradle file and I added a testImplementation libs.ant instead to address your concern that the implementation would be dependent on the version of Ant.

@sebersole
Copy link
Member

address your concern that the implementation would be dependent on the version of Ant

More I was asking. But thanks for changing it :)

@sebersole sebersole merged commit 99bb944 into hibernate:main Jul 30, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants