Skip to content

Commit

Permalink
Update build file
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanue1 committed Apr 10, 2019
1 parent 76dc769 commit e3d2ca8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ subprojects.each { subproject ->
jar {
dependsOn subprojects.tasks['jar']

// Add SPI directory
def tmpSpiDir = file('build/tmp/spi')
from tmpSpiDir
// Add dependencies
def deps = []
subprojects.each { subproject ->
Expand All @@ -77,20 +80,17 @@ jar {
exclude 'META-INF/licenses/**', 'META-INF/maven/**', 'META-INF/INDEX.LIST'
duplicatesStrategy DuplicatesStrategy.EXCLUDE
doFirst {
// Add SPI directory
def tmpSpiDir = file('build/tmp/spi')
// Create SPI directory
tmpSpiDir.deleteDir()
def tmpSpiServicesDir = file(tmpSpiDir.path + '/META-INF/services')
tmpSpiServicesDir.mkdirs()
from tmpSpiDir

// Copy and merge SPI config files
subprojects.each { subproject ->
def servicesDir = file(subproject.sourceSets.main.output.resourcesDir.path + '/META-INF/services')
if (servicesDir.exists()) {
servicesDir.eachFile { source ->
def target = file(tmpSpiServicesDir.path + '/' + source.name)
target << source.text
servicesDir.eachFile { serviceFile ->
def target = file(tmpSpiServicesDir.path + '/' + serviceFile.name)
target << serviceFile.text
}
}
}
Expand Down

0 comments on commit e3d2ca8

Please sign in to comment.