Skip to content

Commit

Permalink
Configure sourceJar deprecated task before evaluating the project
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalcolea committed Feb 12, 2020
1 parent 77cd672 commit 553627c
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@ class SourceJarPlugin implements Plugin<Project> {
configureSourcesJarTask(project)
}
}
}

TaskProvider sourceJarTask = project.tasks.register('sourceJar')
sourceJarTask.configure(new Action<Task>() {
@Override
void execute(Task task) {
Task sourcesJar = project.tasks.findByName('sourcesJar')
if(sourcesJar) {
task.dependsOn(project.tasks.named('sourcesJar'))
}
task.doLast {
project.logger.info("sourceJar task has been replaced by sourcesJar")
}
TaskProvider sourceJarTask = project.tasks.register('sourceJar')
sourceJarTask.configure(new Action<Task>() {
@Override
void execute(Task task) {
Task sourcesJar = project.tasks.findByName('sourcesJar')
if(sourcesJar) {
task.dependsOn(project.tasks.named('sourcesJar'))
}
})
}
task.doLast {
project.logger.info("sourceJar task has been replaced by sourcesJar")
}
}
})
}

private boolean sourcesJarAlreadyExists(Project project) {
Expand Down

0 comments on commit 553627c

Please sign in to comment.