jfrog / artifactory-gradle-plugin

JFrog Gradle plugin for Build Info extraction and Artifactory publishing.
Apache License 2.0
20 stars 15 forks source link

When a cpp plugin is applied, set cpp module type #95

Closed yahavi closed 6 months ago

yahavi commented 7 months ago

Depends on https://github.com/jfrog/build-info/pull/773 (will not compile before it) Fix #91

When the cpp-application or cpp-library plugin are applied to a project, set the module type to cpp.

yahavi commented 6 months ago

Thanks for sharing your thoughts, @enaess! Your feedback is appreciated.

It seems like the NativeBasePlugin might not fit the specific CPP use case very well. Perhaps considering an alternative approach by allowing manual module type setting could be beneficial.

For instance, setting the module type manually could look something like this:

configure<ArtifactoryPluginConvention> {
   publish {
       defaults {
           moduleType("CPP")
       }
   }
}

And within the project scope:

tasks.named<ArtifactoryTask>("artifactoryPublish") {
   setModuleType("CPP")
}

This could offer more flexibility and customization for the CPP use case. We would appreciate your feedback on this approach.

enaess commented 6 months ago

I have a plugin that I apply that will apply the artifactory plugin, I can fix this up there for the individual projects that applies the cpp/library plugin to set the module type to CPP -- I don't really care whichever way we chose here ..

Looking through the code now, configuring the ModuleType.CPP for the defaults doesn't exist, in fact it probably doesn't have the right wiring in place to take any overrides, no? This is being called from the GradleModuleExtractor not the ArtifactoryTask ...

Is this something you can fix rather quick and dirty and do another release of the plugin?

yahavi commented 6 months ago

Hey @enaess, I'm a bit unclear on this. Will the approach of setting the module type manually in the project solve your issue? If it will, we can incorporate the above example it into the Artifactory plugin.

enaess commented 6 months ago

I think it will. Please a PR asap would be preferable @yahavi

yahavi commented 6 months ago

@enaess Thanks for your feedback. We created https://github.com/jfrog/artifactory-gradle-plugin/pull/99 to add this improvement.