pluginBundle and plugin-publish-plugin to artifactory


(Willie) #1

ok, i 4.4 fixed the bug of pluginBundle dealing with plugins that rely on other plugins. So im in the process of converting my build to this. So there’s about 25 subprojects in this thing publishing about 35 plugins.

now im following the documentation for the plugin-publish-plugin and i have a big problem. These are internal plugins, not public, so i need to publish them to our artifactory server, not the plugin site.

I had this working once before, publishing to artifactory, but i ran into that dependency issue and had to back it out, now I can’t remember how in the world i configured it.

here’s the snip of my build im trying to get to work at the moment. This appears in the subproject (sorry, corp so i can’t post the whole thing)

gradlePlugin {
    //noinspection GroovyAssignabilityCheck
    plugins {
      syzygyCore {
        id = 'core'
        implementationClass = "gradle.core.plugins.CorePlugin"
      }
    }
  }

  pluginBundle {
    website = "https://gitlab.me.com/my_gradle"
    vcsUrl = "https://gitlab.me.com/my_gradle"

    //noinspection GroovyAssignabilityCheck
    plugins {
      Core {
        id          = "core"
        displayName = 'Demo Custom Gradle Plugin '
        description = "project.description"
        tags = ['individual', 'tags', 'per', 'plugin']
      }
    }
  }

anyone remember how to get this to work with artifactory? I can’t even get the thing to publish in the correct format locally. Im adding the plugin-publish-plugin and maven plugin to all projects. I can push the jars to artifactory just fine, its just the plugin bundle, can’t get it to go.


(Willie) #2

after additional playing around, i was able to finally get the thing to publish to maven local. the publishToMavenLocal task does work now.

Still need to publish to artifactory tho


(Willie) #3

after stumbling in the dark all day, it would appear this method does the trick

ext.addPluginPublish = { innerProject ->
  Set markers = []

  innerProject.with {
    afterEvaluate {
      println name
      println gradlePlugin.plugins.size()

      gradlePlugin.plugins.each {
        def pubMarker = it.name + 'PluginMarkerMaven'
        println pubMarker
        markers << pubMarker
      }

      artifactoryPublish {
        dependsOn "publishToMavenLocal"
        doLast {
          publications(markers as String[])
        }
      }
    }
  }
}