Skip to content

Conversation

@timo-a
Copy link
Contributor

@timo-a timo-a commented Apr 21, 2025

This is a friendly rebase of #217 to resume work on solving #212. Initially it is simply a rebase of the original PR by @Berlizov (feel free to reset your branch on my rebased version of yours and continue work on the original PR).

I have an interest in having that feature implemented very soon and also released as soon as possible¹ and am willing to contribute within my capacity. Let me know what I can do to get this feature merged!

[1] Do we really need another 10 features for another Milestone before can see a new release? Having #194 of Milestone 3 available through plugins would already be a benefit because JDK 17+ (and thus Spring Boot 3+) users won't have to employ the template workaround anymore. Surely some of the issues currently in M-4 can be postponed onto a later minor release?


Co-authored-by: Eugeen Berlizov <[email protected]>

@scordio scordio self-requested a review April 21, 2025 22:31
@scordio scordio added this to the 3.0.0-M4 milestone Apr 21, 2025
@scordio
Copy link
Member

scordio commented Apr 21, 2025

[1] Do we really need another 10 features for another Milestone before can see a new release?

No, all those features aren't mandatory. We can definitely release M4 with this enhancement, but we don't plan to have a non-milestone release very soon for this project because we'd like to make some fundamental changes to its internals.

Just FYI, there is a way to use milestone versions with the existing plugins, see #194 (comment). Would that help your needs, in the short term? I would be happy to finalize this change, release a new milestone, and properly document the workaround at assertj/assertj-assertions-generator-maven-plugin#93.

@timo-a
Copy link
Contributor Author

timo-a commented Apr 22, 2025

Using Milestone versions with existing plugin releases would be great! I had seen @reitzig's comment but I don't understand how he forced the milestone release on it.
(I assumed each plugin release has the generator version hard coded, and thus assumed he must have meant he compiled his own local release. I could not find an attribute or anything in the docs)

So I would need some pointers on how to configure the plugin, I need to do this with the grade plugin by the way.

@scordio
Copy link
Member

scordio commented Apr 22, 2025

Let me spend some time on it, I'll get back to you.

@reitzig
Copy link

reitzig commented Apr 23, 2025

I had seen @reitzig's comment but I don't understand how he forced the milestone release on it.

Ah, my bad, I wasn't very clear about that. IIRC I added the new library as dependency (don't recall whether for the project or the plugin), and maybe blacklisted the original version declared by the plugin.

I can check the project sources when I'm back at my work machine, but that'll be a few weeks. 🏝️

@scordio
Copy link
Member

scordio commented Apr 23, 2025

I added a Maven example at assertj/assertj-assertions-generator-maven-plugin#93 (comment).

I'll try to achieve the same with Gradle. Not my comfort zone, though, so I might try to bother @Nava2 for some help 🙂

@scordio
Copy link
Member

scordio commented Apr 24, 2025

@timo-a see #194 (comment) for a Gradle workaround.

@Nava2
Copy link
Contributor

Nava2 commented Apr 24, 2025

@scordio / @reitzig unfortunately the plugin + library are deeply coupled. If you wanted to run with a newer version, we can run it in CI or you can compile the plugin locally and publish it with ./gradlew publishToMavenLocal with the new library version.

@scordio
Copy link
Member

scordio commented Apr 24, 2025

@Nava2 what I've written at #194 (comment) seems to work fine in a sample project. Or do you see it differently?

For completeness, here's my full build:

plugins {
    id("java")
    id("org.assertj.generator") version "1.1.0"
}

group = "io.github.scordio"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
}

dependencies {
    testImplementation("org.assertj:assertj-core:3.27.3")
}

tasks.test {
    useJUnitPlatform()
}

buildscript {
    configurations.all {
        resolutionStrategy {
            force("org.assertj:assertj-assertions-generator:3.0.0-M3")
        }
    }
}

Version 3.0.0-M3 kicks in correctly and I can see @javax.annotation.processing.Generated in the resulting classes.

@Nava2
Copy link
Contributor

Nava2 commented Apr 24, 2025

Oh, apologies. That would work. Sorry, I'm a little out of it today! Both are options.

@timo-a
Copy link
Contributor Author

timo-a commented May 8, 2025

Thanks for illustrating how to use Milestones in the plugins and limiting 3.0.0-M4 to the essentials @scordio! Is there any chance you could review this PR soon? It'd be great to have M4 released by the end of May and I would be available to implement suggested changes until then.

@scordio
Copy link
Member

scordio commented May 8, 2025

I plan to go through it & release M4 this week 🙂

@scordio scordio self-assigned this May 12, 2025
@scordio scordio changed the title Record-like getters support #212 #216 rebased Add support for Record-like getters May 13, 2025
@scordio scordio merged commit cf5f727 into assertj:main May 13, 2025
3 checks passed
@scordio
Copy link
Member

scordio commented May 13, 2025

Many thanks for your work, @Berlizov and @timo-a! 3.0.0-M4 is now published.

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.

Blank parameter name in case of get() with @GenerateAssertion Generate assertions for Java records

5 participants