Skip to content

Commit

Permalink
Modified build script to embed pom.xml in published JAR
Browse files Browse the repository at this point in the history
  • Loading branch information
tkrullmann committed Mar 3, 2015
1 parent 42db664 commit 630a942
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 44 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A plugin for the Gradle build system that allows specifying test sets (like inte
To use the TestSets plugin, include the following lines in your build script:

plugins {
id 'org.unbroken-dome.test-sets' version '1.0.0'
id 'org.unbroken-dome.test-sets' version '1.0.1'
}

The TestSets plugin will only work in conjunction with the `java` and/or `groovy` plugin.
Expand Down
90 changes: 47 additions & 43 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,66 @@ plugins {

group = 'org.unbroken-dome.gradle-plugins'
archivesBaseName = 'gradle-testsets-plugin'
version = '1.0.0'
version = '1.0.1'


sourceCompatibility = '1.8'
targetCompatibility = '1.8'


repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}


dependencies {
compile gradleApi()

compile 'com.google.guava:guava:18.0'

testCompile 'org.codehaus.groovy:groovy-all:2.3.6'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.3-SNAPSHOT'
testCompile ('org.spockframework:spock-core:0.7-groovy-2.0') {
exclude group: 'org.codehaus.groovy'
}
testCompile 'org.hamcrest:hamcrest-all:1.3'
}

configurations {
all*.exclude module: 'junit-dep'

def pomDefinition = pom {
project {
name project.friendly_name
packaging 'jar'
description project.description
url project.home_url

scm {
connection "scm:git:${project.scm_url}"
developerConnection "scm:git:${project.scm_url}"
url project.scm_url
}

licenses {
license {
name = project.license_name
url project.license_url
}
}

developers {
developer {
name 'Till Krullmann'
email '[email protected]'
}
}
}
}


task generatePom {
outputs.file "$buildDir/poms/pom.xml"
doLast {
pomDefinition.writeTo "$buildDir/poms/pom.xml"
}
}


jar {
into("META-INF/maven/$project.group/$project.name") {
from generatePom
}
}


Expand Down Expand Up @@ -67,40 +102,9 @@ eclipse.project {
}


def pomDefinition = pom {
project {
name project.friendly_name
packaging 'jar'
description project.description
url project.home_url

scm {
connection "scm:git:${project.scm_url}"
developerConnection "scm:git:${project.scm_url}"
url project.scm_url
}

licenses {
license {
name = project.license_name
url project.license_url
}
}

developers {
developer {
name 'Till Krullmann'
email '[email protected]'
}
}
}
}


install {
repositories.mavenInstaller {
beforeDeployment { deployment -> signing.signPom(deployment) }

pom = pomDefinition
}
}
Expand Down

0 comments on commit 630a942

Please sign in to comment.