Is there a way to wire custom field metadata into the generateMetadataConstants gradle task?
My suggestion for simplicity is to always keep the custom FieldMetadata in their own project, separate from your DataService. Then in your DataService to use a custom FM, obviously you add:
implementation 'my.custom:field.metadata:1.0'
in your build.gradle (where that string is the maven coordinates to your published custom FM project). To also make the custom FM available to the metadata constants parser if using the metadata plugin LEAF provides, you’ll need to add:
leafMetadataJar 'my.custom:field.metadata:1.0'
which will make the custom FM task available when the constants parser is ran.
Sounds like a plan! Thanks!
Humm… I’m trying to use project references instead and the gradle plugin seems to not see my new type. Shouldn’t it look like this in my dependencies section?
leafMetadataDelayed project(":security-marking-custom-field")
implementation project(":security-marking-custom-field")
edit: Where I said leafMetadataJar originally, I should have said leafMetadataDelayed, so I went ahead and fixed that above.
@abdelhakeem.d.badran If Chris’s custom FieldMetadata is defined in that project “security-marking-custom-field”, and he in another project wants to bring that in (to use the custom FieldMetadata AND to generate MetadataConstants files), is that leafMetadataJar the right configuration?
I was trying to avoid having to send him a bunch of custom Gradle code by just separating the concerns of the custom FM and the Data Service project that actually uses it. I think what I described is possible bc we were able to do that on another project. But I’m less sure now if I got the instructions above correct.
I think the proper configuration might actually be leafMetadataDelayed, since that’s the one used for the classpath in the generateMetadataConstants task
Ooo. Could you try to change to this then, @bozicc?
leafMetadataDelayed project(":security-marking-custom-field")
implementation project(":security-marking-custom-field")
Everything works great. I had a weird hiccup but I ran the build again and it worked. Thanks all!