Skip to content

Instantly share code, notes, and snippets.

@tomdcc
Created September 22, 2015 07:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomdcc/5b5afc8e30081aa3ebbe to your computer and use it in GitHub Desktop.
Save tomdcc/5b5afc8e30081aa3ebbe to your computer and use it in GitHub Desktop.
Example for publishing a Gradle plugin to the plugin portal while downloading it from somewhere else
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.gradle.publish:plugin-publish-plugin:0.9.1"
}
}
apply plugin: "com.gradle.plugin-publish"
repositories {
// your private repo here
maven { url "https://plugins.gradle.org/m2/" }
}
// download our custom jar from a repo
configurations {
downloaded
}
dependencies {
// path to the artifact in your private repo
downloaded "gradle.plugin.test.foobar:example-plugin:1.7"
}
// clear out defaults from java plugin
configurations.archives.artifacts.clear()
artifacts {
// add downloaded jar to the archives configuration set of artifacts
archives configurations.downloaded.resolve()[0]
}
group = 'org.examples'
version = '2.0'
pluginBundle {
plugins {
website = 'http://foo.com/'
description = 'Downloaded plugin'
vcsUrl = 'https://github.com/foo/bar'
tags = ['downloaded']
downloadedPlugin {
id = 'org.samples.examples.helloworld'
displayName = 'Downloaded Plugin'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment