Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
46 lines (39 sloc) 1.13 KB
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id "com.github.johnrengelman.shadow" version "2.0.4"
}
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
mainClassName = 'com.karakun.sample.Application'
ext {
variants = [
[name: "customerA"],
[name: "customerB"],
[name: "customerC"]
]
}
configurations {
customerAcompile
customerBcompile
customerCcompile
customerAcompile.extendsFrom(compile)
customerBcompile.extendsFrom(compile)
customerCcompile.extendsFrom(compile)
}
dependencies {
implementation project(':lib-implA')
customerAcompile project(':lib-implA')
customerBcompile project(':lib-implB')
customerCcompile project(':lib-implC')
}
variants.each { variant ->
task "${variant.name}ShadowJar"(type: ShadowJar) {
classifier = "${variant.name}"
from sourceSets.main.output
configurations = [project.configurations."${variant.name}compile"]
manifest {
attributes 'Main-Class': mainClassName
}
}
shadowJar.dependsOn("${variant.name}ShadowJar")
}