Skip to content

Commit

Permalink
Merge pull request #40 from chali/CheckBuildsSomething
Browse files Browse the repository at this point in the history
Apply maven publish plugin only when project actually builds something
  • Loading branch information
chali committed Feb 15, 2018
2 parents cc94f36 + e269235 commit 0f73576
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -22,7 +22,9 @@ class NebulaResponsiblePlugin implements Plugin<Project> {
this.project = project

// Publishing
project.plugins.apply(MavenPublishPlugin)
if (isBuildingSomething(project)) {
project.plugins.apply(MavenPublishPlugin)
}
project.plugins.apply(JavadocJarPlugin)
project.plugins.apply(SourceJarPlugin)

Expand All @@ -43,4 +45,9 @@ class NebulaResponsiblePlugin implements Plugin<Project> {
testTask.testLogging.exceptionFormat = 'full'
}
}

private boolean isBuildingSomething(Project project) {
def isParentProject = project.rootProject.subprojects.any { it.parent == project }
return !isParentProject
}
}

0 comments on commit 0f73576

Please sign in to comment.