Skip to content

Commit

Permalink
Added Cobertura plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Jacobs committed Dec 2, 2015
1 parent e4a7a4a commit 136a239
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 30 deletions.
65 changes: 36 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,31 @@ buildscript {

plugins {
id 'nebula.netflixoss' version '3.1.2'
id 'me.champeau.gradle.jmh' version '0.2.0'
id 'me.champeau.gradle.jmh' version '0.2.0'
id 'net.saliman.cobertura' version '2.2.8'
}

ext {
githubProjectName = rootProject.name
githubProjectName = rootProject.name
}

allprojects {
repositories {
jcenter()
}

apply plugin: 'net.saliman.cobertura'
}

subprojects {
apply plugin: 'nebula.netflixoss'
apply plugin: 'java'
apply plugin: 'nebula.provided-base'

sourceCompatibility = 1.6
targetCompatibility = 1.6

repositories {
jcenter()
}


group = "com.netflix.${githubProjectName}"

Expand All @@ -46,27 +53,27 @@ subprojects {
}
}

//mark all first-level dependencies as 'compile' in generated POM
//except for 'servlet-api', which should be 'provided'
publishing {
publications {
nebula(MavenPublication) {
pom.withXml {
configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.each { dep ->
if (dep.moduleName == "servlet-api") {
asNode().dependencies[0].dependency.find {
it.artifactId[0].text() == dep.moduleName &&
it.groupId[0].text() == dep.moduleGroup
}.scope[0].value = 'provided'
} else {
asNode().dependencies[0].dependency.find {
it.artifactId[0].text() == dep.moduleName &&
it.groupId[0].text() == dep.moduleGroup
}.scope[0].value = 'compile'
}
}
}
}
}
}
//mark all first-level dependencies as 'compile' in generated POM
//except for 'servlet-api', which should be 'provided'
publishing {
publications {
nebula(MavenPublication) {
pom.withXml {
configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.each { dep ->
if (dep.moduleName == "servlet-api") {
asNode().dependencies[0].dependency.find {
it.artifactId[0].text() == dep.moduleName &&
it.groupId[0].text() == dep.moduleGroup
}.scope[0].value = 'provided'
} else {
asNode().dependencies[0].dependency.find {
it.artifactId[0].text() == dep.moduleName &&
it.groupId[0].text() == dep.moduleGroup
}.scope[0].value = 'compile'
}
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Thu Jan 08 16:14:23 PST 2015
#Wed Dec 02 15:47:21 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down

0 comments on commit 136a239

Please sign in to comment.