jfrog / artifactory-gradle-plugin

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

Allow setting the module type of the published module #99

Closed yahavi closed 5 months ago

yahavi commented 6 months ago

Allow setting the module type manually:

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

And within the project scope:

tasks.named<ArtifactoryTask>("artifactoryPublish") {
   setModuleType("CPP")
}
enaess commented 6 months ago

I'll give this a spin today @yahavi

github-actions[bot] commented 6 months ago
[![👍 Frogbot scanned this pull request and found that it did not add vulnerable dependencies.](https://raw.githubusercontent.com/jfrog/frogbot/master/resources/v2/noVulnerabilityBannerPR.png)](https://docs.jfrog-applications.jfrog.io/jfrog-applications/frogbot)

[🐸 JFrog Frogbot](https://docs.jfrog-applications.jfrog.io/jfrog-applications/frogbot)
enaess commented 6 months ago

@yahavi This works fine and I have a change locally to enable this in our plugin. Please commit and put out another version of the artifactory-gradle-plugin asap.

enaess commented 6 months ago
      project.getTasks().getByName("artifactoryPublish", t -> {
          ((ArtifactoryTask) t).setModuleType("CPP");
      });

      /* Comment out the above, and enable this and it doesn't seem to work, the defaults action is empty when we call it. Wrapping it into a project.afterEvaluate() doesn't fix it either.
      project.getExtensions().getByType(ArtifactoryPluginConvention.class).publish(
              p -> p.defaults(
                      f -> f.setModuleType("CPP")));
      */
  };

However, this does seem to work for us, we'll configure the artifactoryPublish task and move on from that.

enaess commented 6 months ago

@yahavi Any update on this?