diff --git a/.gitignore b/.gitignore index 727da0f..cf7873e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .gradle +build.gradle.orig build *.iml *.un~ diff --git a/README.md b/README.md index 44bb351..fda4d36 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ buildscript { //load the plugin plugins { - id "com.github.mahnkong.gteg2neo4j" version "1.1.3" + id "com.github.mahnkong.gteg2neo4j" version "1.1.4" } //apply the plugin diff --git a/build.gradle b/build.gradle index 66429df..ce2132a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,24 +1,16 @@ -buildscript { - repositories { - maven { url "https://plugins.gradle.org/m2/" } - } - dependencies { - classpath "com.gradle.publish:plugin-publish-plugin:0.9.4" - } -} - plugins { id "com.jfrog.bintray" version "1.6" + id "com.gradle.plugin-publish" version "0.9.4" } -group = 'com.github.mahnkong' -version = '1.1.3' - apply plugin: 'groovy' apply plugin: 'maven' apply plugin: 'maven-publish' apply plugin: "com.gradle.plugin-publish" +group = 'com.github.mahnkong' +version = '1.1.4' + repositories { jcenter() maven { url "http://m2.neo4j.org/content/groups/public" } @@ -26,6 +18,8 @@ repositories { ext { neo4jVersion = '2.3.2' + scmUrl = 'https://github.com/mahnkong/gradle-teg2neo4j-plugin' + projectDescription = 'A Gradle-Plugin which enables the "Gradle Task Execution Graph" of a project\'s build to be stored inside a Neo4j instance' } sourceCompatibility = 1.7 @@ -61,10 +55,42 @@ jar { from "LICENSE" } +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives javadocJar + archives sourcesJar +} + publishing { publications { artifacts(MavenPublication) { from components.java + + artifact sourcesJar + artifact javadocJar + + pom.withXml { + asNode().appendNode('name', project.name) + asNode().appendNode('description', project.ext.projectDescription) + asNode().appendNode('url', project.ext.scmUrl) + asNode().appendNode('scm'). + appendNode('url', project.ext.scmUrl).parent(). + appendNode('connection', "scm:git:${project.ext.scmUrl}.git") + asNode().appendNode('licenses').appendNode('license'). + appendNode('name', 'Apache License, Version 2.0').parent(). + appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.html') + asNode().appendNode('developers').appendNode('developer'). + appendNode('id', 'mahnkong') + } } } repositories { @@ -73,14 +99,14 @@ publishing { } pluginBundle { - website = 'https://github.com/mahnkong/gradle-teg2neo4j-plugin' - vcsUrl = 'https://github.com/mahnkong/gradle-teg2neo4j-plugin' - description = 'A Gradle-Plugin which enables the "Gradle Task Execution Graph" of a project\'s build to be stored inside a Neo4j instance' + website = project.ext.scmUrl + vcsUrl = project.ext.scmUrl tags = ['neo4j', 'task', 'graph'] plugins { gteg2neo4jPlugin { - id = 'com.github.mahnkong.gteg2neo4j' + id = "${group}.gteg2neo4j" + description = project.ext.projectDescription displayName = 'Gradle TaskExecutionGraph to Neo4j plugin' } } @@ -95,9 +121,9 @@ bintray { pkg { repo = "maven" // it is the name that appears in bintray when logged - name = "gradle-teg2neo4j-plugin" - websiteUrl = 'https://github.com/mahnkong/gradle-teg2neo4j-plugin' - vcsUrl = 'https://github.com/mahnkong/gradle-teg2neo4j-plugin' + name = project.name + websiteUrl = project.ext.scmUrl + vcsUrl = project.ext.scmUrl licenses = ["Apache-2.0"] publish = true version { @@ -113,3 +139,6 @@ bintray { } } } + +bintrayUpload.dependsOn('test') +publishPlugins.dependsOn('test')