From b21822f9acb7e2d7e735164e9d85f976bf9a2955 Mon Sep 17 00:00:00 2001 From: Patrick van Dissel Date: Fri, 17 Apr 2015 23:21:46 +0200 Subject: [PATCH] Clean up plugin publish configuration --- build.gradle | 5 ++- gradle.properties | 2 +- gradle/buildscript.gradle | 8 ----- gradle/publishing.gradle | 63 --------------------------------- plugin/plugin.gradle | 74 +++++++++++++++++++++------------------ 5 files changed, 43 insertions(+), 109 deletions(-) delete mode 100644 gradle/buildscript.gradle delete mode 100644 gradle/publishing.gradle diff --git a/build.gradle b/build.gradle index f559781..fbeb682 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,6 @@ -buildscript { - apply from: file('gradle/buildscript.gradle'), to: buildscript +plugins { + id "com.github.hierynomus.license" version "0.11.0" } -apply from: script('license') description 'Jenkins JobDSL plugin for Gradle' diff --git a/gradle.properties b/gradle.properties index b31ef9a..b6ec0ef 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=0.4.0 +version=0.4.1 diff --git a/gradle/buildscript.gradle b/gradle/buildscript.gradle deleted file mode 100644 index d548943..0000000 --- a/gradle/buildscript.gradle +++ /dev/null @@ -1,8 +0,0 @@ -repositories { - jcenter() -} - -dependencies { - classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.7.0' - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.3' -} diff --git a/gradle/publishing.gradle b/gradle/publishing.gradle deleted file mode 100644 index 6b818f0..0000000 --- a/gradle/publishing.gradle +++ /dev/null @@ -1,63 +0,0 @@ -apply plugin: 'maven-publish' -apply plugin: 'bintray' - -publishing { - publications { - main(MavenPublication) { - if (plugins.hasPlugin('war')) { - from components.web - } else { - from components.java - } - artifact sourcesJar - artifact javadocJar - artifact groovydocJar - - pom.withXml { - asNode().with { - appendNode('name', 'Jenkins JobDSL plugin for Gradle') - appendNode('description', 'A Gradle plugin that let\'s you build and generate your Jenkins JobDSL scripts') - appendNode('url', 'http://github.com/pvdissel/gradle-jenkins-jobdsl') - appendNode('licenses').with { - appendNode('license').with { - appendNode('name', 'The Apache Software License, Version 2.0') - appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0') - } - } - appendNode('developers').with { - appendNode('developer').with { - appendNode('id', 'pvdissel') - appendNode('name', 'Patrick van Dissel') - appendNode('email', 'pvdissel@gmail.com') - } - } - appendNode('scm').with { - appendNode('connection', 'git://github.com/pvdissel/gradle-jenkins-jobdsl.git') - appendNode('developerConnection', 'git@github.com:pvdissel/gradle-jenkins-jobdsl.git') - appendNode('url', 'http://github.com/pvdissel/gradle-jenkins-jobdsl') - } - } - } - } - } - repositories { - mavenLocal() - } -} - -if (project.hasProperty('bintrayUser') && project.hasProperty('bintrayKey')) { - bintray { - user = project.bintrayUser - key = project.bintrayKey - publications = ['main'] - pkg { - repo = 'gradle-plugins' - name = 'nl.ikoodi.gradle.plugin:gradle-jenkins-jobdsl' - desc = 'A Gradle plugin that let\'s you build and generate your Jenkins JobDSL scripts' - licenses = ['Apache-2.0'] - labels = ['gradle', 'plugins'] - } - } -} - -bintrayUpload.dependsOn('generatePomFileForMainPublication', 'build') diff --git a/plugin/plugin.gradle b/plugin/plugin.gradle index 2163788..0b842a9 100644 --- a/plugin/plugin.gradle +++ b/plugin/plugin.gradle @@ -1,45 +1,51 @@ -apply plugin: 'groovy' -apply plugin: 'maven-publish' +plugins { + id 'groovy' + id 'com.gradle.plugin-publish' version '0.9.0' + id "com.github.ben-manes.versions" version "0.8" +} + +ext { + libraries = [:] + versions = [:] +} + +versions += [ + spock : '1.0-groovy-2.3', + jenkinsJobDsl: '1.28', +] + +libraries += [ + jenkinsJobDsl: "org.jenkins-ci.plugins:job-dsl-core:${versions.jenkinsJobDsl}", + logging : 'ch.qos.logback:logback-classic:1.1.2', + spock : "org.spockframework:spock-core:${versions.spock}", + spockDeps : [ + 'org.objenesis:objenesis:2.1', + 'cglib:cglib-nodep:3.1', + ], +] dependencies { compile gradleApi() - compile 'org.codehaus.groovy:groovy:2.3.0' - compile 'org.jenkins-ci.plugins:job-dsl-core:1.26' + compile localGroovy() + compile libraries.jenkinsJobDsl - testCompile('org.spockframework:spock-core:0.7-groovy-2.0') { - exclude module: 'groovy-all' + testCompile(libraries.spock) { + exclude group: 'org.codehaus.groovy', module: 'groovy-all' + exclude group: 'org.hamcrest', module: 'hamcrest-core' } + testCompile libraries.spockDeps } -apply from: script('publishing') +pluginBundle { + website = 'https://github.com/pvdissel/gradle-jenkins-jobdsl' + vcsUrl = 'https://github.com/pvdissel/gradle-jenkins-jobdsl' + description = 'A Gradle plugin that let\'s you build and generate your Jenkins JobDSL scripts' + tags = ['jenkins', 'jobdsl'] -archivesBaseName = "${rootProject.name}" - -publishing { - publications { - main(MavenPublication) { - artifactId project.archivesBaseName + plugins { + jenkinsJobDsl { + id = 'nl.ikoodi.jenkins.jobdsl' + displayName = 'Gradle Jenkins JobDSL Plugin' } } } - -task sourcesJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allSource -} - -task javadocJar(type: Jar) { - classifier = 'javadoc' - from javadoc.outputs.files -} - -task groovydocJar(type: Jar) { - classifier = 'groovydoc' - from groovydoc.outputs.files -} - -artifacts { - archives sourcesJar - archives javadocJar - archives groovydocJar -}