From 98025b3e92cd9a8c04822418f70ece4a7c4d66f8 Mon Sep 17 00:00:00 2001 From: Tobias Schulte Date: Mon, 21 Sep 2015 22:05:42 +0200 Subject: [PATCH] chore: extract publish-plugin into it's own gradle file --- build.gradle | 9 +++++---- gradle/publish-plugin.gradle | 21 +++++++++++++++++++++ gradle/publishing.gradle | 21 --------------------- 3 files changed, 26 insertions(+), 25 deletions(-) create mode 100644 gradle/publish-plugin.gradle diff --git a/build.gradle b/build.gradle index 5a94e4c..bf3def6 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,7 @@ apply plugin: 'com.github.ben-manes.versions' apply from: 'gradle/credentials.gradle' apply from: 'gradle/compile.gradle' apply from: 'gradle/publishing.gradle' +apply from: 'gradle/publish-plugin.gradle' apply from: 'gradle/bintray.gradle' apply from: 'gradle/artifactory.gradle' apply from: 'gradle/code-quality.gradle' @@ -32,8 +33,8 @@ apply from: 'compile-dependencies.gradle' dependencies { testCompile 'com.netflix.nebula:nebula-test:2.2.2', { - exclude module: 'groovy-all' - } + exclude module: 'groovy-all' + } } // workaround for tests to run (see http://stackoverflow.com/questions/29377544/my-gradle-project-depends-on-commons-io-2-4-but-gradle-puts-gradle-home-common) @@ -43,10 +44,10 @@ sourceSets { } } -group='de.gliderpilot.gradle.semantic-release' +group = 'de.gliderpilot.gradle.semantic-release' semanticRelease { - changeLogService.ghToken = ghToken + changeLog.ghToken = project.ext.ghToken } task integTest { diff --git a/gradle/publish-plugin.gradle b/gradle/publish-plugin.gradle new file mode 100644 index 0000000..8973286 --- /dev/null +++ b/gradle/publish-plugin.gradle @@ -0,0 +1,21 @@ +apply plugin: 'com.gradle.plugin-publish' + +pluginBundle { + website = 'https://github.com/tschulte/gradle-semantic-release-plugin' + vcsUrl = 'https://github.com/tschulte/gradle-semantic-release-plugin' + description = 'At its core semantic-release is a set of conventions that gives you entirely automated, semver-compliant package publishing.' + tags = ['semver', 'release', 'semantic-release'] + + plugins { + semanticReleasePlugin { + id = 'de.gliderpilot.semantic-release' + displayName = 'semantic-release' + } + } +} + +tasks.publishPlugins { + onlyIf { + !project.version.toString().endsWith('-SNAPSHOT') + } +} diff --git a/gradle/publishing.gradle b/gradle/publishing.gradle index bf55d47..374e874 100644 --- a/gradle/publishing.gradle +++ b/gradle/publishing.gradle @@ -1,6 +1,5 @@ // configuration of the Maven artifacts apply plugin: 'maven-publish' -apply plugin: 'com.gradle.plugin-publish' import java.text.SimpleDateFormat Date buildTimeAndDate = new Date() @@ -80,23 +79,3 @@ publishing { } } } - -pluginBundle { - website = 'https://github.com/tschulte/gradle-semantic-release-plugin' - vcsUrl = 'https://github.com/tschulte/gradle-semantic-release-plugin' - description = 'At its core semantic-release is a set of conventions that gives you entirely automated, semver-compliant package publishing.' - tags = ['semver', 'release', 'semantic-release'] - - plugins { - semanticReleasePlugin { - id = 'de.gliderpilot.semantic-release' - displayName = 'semantic-release' - } - } -} - -tasks.publishPlugins { - onlyIf { - !project.version.toString().endsWith('-SNAPSHOT') - } -}