Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions line-bot-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,26 @@ dependencies {
compile 'com.google.guava:guava'
}

// Default bootRepackage & signArchives has task dependency issue.
// Manually define new `execBootRepackage` task and make dependency from signArchives to execBootRepackage.
bootRepackage.enabled = false
task execBootRepackage(type: BootRepackage, dependsOn: jar) {
bootRepackage {
enabled = true
executable = true
// Custom Launch Script avoid https://github.com/spring-projects/spring-boot/issues/5164
embeddedLaunchScript = file('src/main/resources/launch.script')
withJarTask = jar
classifier = 'exec'
mainClass = 'com.linecorp.bot.cli.Application'
}

signArchives.dependsOn execBootRepackage
// Reset bootRepackage dependency to remove dependency from bootRepackage to signArchives.
// This causes circular dependency.
//
// Memo: By default, bootRepackage dependsOn the all tasks creating jar including signArchives task.
// But signArchives should be after repackages.
bootRepackage.dependsOn.clear()
bootRepackage.dependsOn jar, findMainClass
signArchives.dependsOn bootRepackage

artifacts {
archives sourcesJar, javadocJar, file("$buildDir/libs/${project.name}-${project.version}.jar")
// Add exec jar into archives to be uploaded.
artifacts.add('archives', file("$buildDir/libs/${project.name}-${project.version}-${bootRepackage.classifier}.jar")) {
classifier = bootRepackage.classifier
}