Skip to content

Commit 9713bc4

Browse files
committed
Apply shadow plugin
1 parent 9b394c2 commit 9713bc4

File tree

1 file changed

+51
-5
lines changed

1 file changed

+51
-5
lines changed

kotlinx-collections-immutable/build.gradle

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ buildscript {
22
ext.kotlin_version = "1.1.0-rc-91"
33

44
repositories {
5-
mavenCentral()
5+
jcenter()
66
maven { url 'http://dl.bintray.com/kotlin/kotlin-eap-1.1' }
77
}
88
dependencies {
99
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10+
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
1011
}
1112
}
1213

@@ -21,18 +22,63 @@ allprojects {
2122
}
2223

2324
dependencies {
24-
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
2525
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
2626
testCompile "junit:junit:4.12"
2727
}
2828
}
29+
apply plugin: 'com.github.johnrengelman.shadow'
30+
31+
configurations {
32+
shadowed
33+
compile.extendsFrom(shadow)
34+
compile.extendsFrom(shadowed)
35+
}
2936

3037
dependencies {
31-
compile project(':pcollections')
38+
shadow "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
39+
40+
shadowed project(':pcollections')
41+
3242
}
3343

3444
project('tests') {
3545
dependencies {
36-
compile parent
46+
compile project(path: ':kotlinx-collections-immutable', configuration: 'shadow')
3747
}
38-
}
48+
}
49+
50+
compileKotlin {
51+
kotlinOptions.jdkHome = JDK_16
52+
}
53+
54+
55+
56+
apply plugin: 'maven-publish'
57+
58+
jar {
59+
// baseName "${parent.name}-${project.name}"
60+
}
61+
62+
shadowJar {
63+
classifier = null
64+
configurations = [project.configurations.shadowed]
65+
relocate 'org.pcollections', 'kotlinx.collections.immutable.internal.org.pcollections'
66+
}
67+
68+
task sourcesJar(type: Jar) {
69+
from sourceSets.main.allSource
70+
classifier "sources"
71+
}
72+
73+
publishing {
74+
publications {
75+
mainPublication(MavenPublication) {
76+
from components.shadow
77+
artifact sourcesJar
78+
79+
pom.withXml {
80+
asNode().dependencies.'*'.each { it.scope*.value = 'compile'}
81+
}
82+
}
83+
}
84+
}

0 commit comments

Comments
 (0)