Skip to content

Commit

Permalink
moving the assemble dependsOn to the createJarTask method to eliminat…
Browse files Browse the repository at this point in the history
…e an unnecessary null check
  • Loading branch information
Greg Henry committed Jun 20, 2014
1 parent 26bc995 commit 6bc28e3
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,12 @@ class ExtendedPublication {
private void setJarTaskIfNotSet() {
if (archiveTask == null) {
archiveTask = findOrCreateJarTask()
assembleDependsOnArchiveTaskIfNotNull(archiveTask)
}
}

private void assembleDependsOnArchiveTaskIfNotNull(Jar archiveTask) {
if (archiveTask != null) {
project.getTasks().getByName(BasePlugin.ASSEMBLE_TASK_NAME).dependsOn(archiveTask);
}
}

private void setSourceJarTaskIfNotSet() {
if (sourcesArchiveTask == null) {
sourcesArchiveTask = findOrCreateSourcesJarTask()
assembleDependsOnArchiveTaskIfNotNull(sourcesArchiveTask)
}
}

Expand Down Expand Up @@ -158,6 +150,7 @@ class ExtendedPublication {
}
from isSourceJar ? getSourceSet().allSource : getSourceSet().output
}
project.getTasks().getByName(BasePlugin.ASSEMBLE_TASK_NAME).dependsOn(jarTask)
jarTask
}

Expand Down

0 comments on commit 6bc28e3

Please sign in to comment.