@@ -10,6 +10,8 @@ buildscript {
10
10
}
11
11
}
12
12
13
+ description ' Kotlin experimental immutable collection interfaces and implementations'
14
+
13
15
allprojects {
14
16
apply plugin : ' kotlin'
15
17
group = ' org.jetbrains.kotlinx'
@@ -35,9 +37,8 @@ configurations {
35
37
36
38
dependencies {
37
39
shadow " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
38
-
40
+ compile " org.jetbrains.kotlin:kotlin-stdlib: $k otlin_version "
39
41
shadowed project(' :pcollections' )
40
-
41
42
}
42
43
43
44
project(' tests' ) {
@@ -52,11 +53,12 @@ compileKotlin {
52
53
53
54
54
55
55
- apply plugin : ' maven-publish'
56
+ apply plugin : ' signing'
57
+ // apply plugin: 'maven-publish'
58
+ apply plugin : ' maven'
59
+
60
+
56
61
57
- jar {
58
- // baseName "${parent.name}-${project.name}"
59
- }
60
62
61
63
shadowJar {
62
64
classifier = null
@@ -69,15 +71,145 @@ task sourcesJar(type: Jar) {
69
71
classifier " sources"
70
72
}
71
73
74
+ task emptyJavadoc (type : Javadoc ) {
75
+ source = sourceSets. main. java
76
+ failOnError = false
77
+ }
78
+
79
+ task javadocJar (type : Jar , dependsOn : emptyJavadoc) {
80
+ classifier = ' javadoc'
81
+ from emptyJavadoc. destinationDir
82
+ }
83
+
84
+ artifacts {
85
+ archives shadowJar
86
+ archives sourcesJar
87
+ archives javadocJar
88
+ }
89
+
90
+ signing {
91
+ required { signatory != null }
92
+ sign configurations. archives
93
+ }
94
+
95
+ uploadArchives {
96
+ repositories {
97
+ mavenDeployer {
98
+ beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
99
+ repository(url : " file://${ buildDir} /repo" )
100
+ // repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
101
+ // authentication(userName: ossrhUsername, password: ossrhPassword)
102
+ // }
103
+ //
104
+ // snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
105
+ // authentication(userName: ossrhUsername, password: ossrhPassword)
106
+ // }
107
+ pom. project {
108
+ name " ${ project.group} :${ project.name} "
109
+ packaging ' jar'
110
+ // optionally artifactId can be defined here
111
+ description project. description
112
+ url ' https://github.com/Kotlin/kotlinx.collections.immutable'
113
+ licenses {
114
+ license {
115
+ name ' The Apache License, Version 2.0'
116
+ url ' http://www.apache.org/licenses/LICENSE-2.0.txt'
117
+ }
118
+ }
119
+ scm {
120
+ url ' https://github.com/Kotlin/kotlinx.collections.immutable'
121
+ connection ' scm:git:https://github.com/Kotlin/kotlinx.collections.immutable'
122
+ developerConnection ' scm:git:https://github.com/Kotlin/kotlinx.collections.immutable'
123
+ }
124
+ developers {
125
+ developer {
126
+ name ' Ilya Gorbunov'
127
+
128
+ organization ' JetBrains'
129
+ organizationUrl ' http://www.jetbrains.com'
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
135
+ }
136
+ /*
137
+
138
+ // extract signature file and give them proper name
139
+ def getSignatureFiles = {
140
+ def allFiles = project.tasks.signArchives.signatureFiles.collect { it }
141
+ def signedSources = allFiles.find { it.name.contains('-sources') }
142
+ def signedJavadoc = allFiles.find { it.name.contains('-javadoc') }
143
+ def signedJar = (allFiles - [signedSources, signedJavadoc])[0]
144
+ return [
145
+ [archive: signedSources, classifier: 'sources', extension: 'pom.asc'],
146
+ [archive: signedJavadoc, classifier: 'javadoc', extension: 'pom.asc'],
147
+ [archive: signedJar, classifier: null, extension: 'pom.asc']
148
+ ]
149
+ }
150
+
72
151
publishing {
73
152
publications {
74
153
mainPublication(MavenPublication) {
75
154
from components.shadow
76
155
artifact sourcesJar
156
+ artifact javadocJar
77
157
78
158
pom.withXml {
79
- asNode(). dependencies. ' *' . each { it. scope* . value = ' compile' }
159
+ Node node = asNode()
160
+
161
+ node.dependencies.'*'.each { it.scope*.value = 'compile'}
162
+
163
+ node.children().last() + {
164
+ resolveStrategy = Closure.DELEGATE_FIRST
165
+ packaging 'jar'
166
+ name "${project.group}:${project.name}"
167
+ description project.description
168
+ url 'https://github.com/Kotlin/kotlinx.collections.immutable'
169
+ licenses {
170
+ license {
171
+ name 'The Apache License, Version 2.0'
172
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
173
+ }
174
+ }
175
+ scm {
176
+ url 'https://github.com/Kotlin/kotlinx.collections.immutable'
177
+ connection 'scm:git:https://github.com/Kotlin/kotlinx.collections.immutable'
178
+ developerConnection 'scm:git:https://github.com/Kotlin/kotlinx.collections.immutable'
179
+ }
180
+ developers {
181
+ developer {
182
+ name 'Ilya Gorbunov'
183
+
184
+ organization 'JetBrains'
185
+ organizationUrl 'http://www.jetbrains.com'
186
+ }
187
+ }
188
+ }
189
+ }
190
+
191
+ if (signing.required) {
192
+ // Sign the pom.xml.
193
+ def pomFile = project.file("$buildDir/publications/pom-for-signing.xml")
194
+ pom.withXml {
195
+ writeTo(pomFile)
196
+ def pomAscFile = signing.sign(pomFile).signatureFiles[0]
197
+ // artifact(pomAscFile) {
198
+ // classifier = null
199
+ // extension = 'pom.asc'
200
+ // }
201
+ pomFile.delete()
202
+ }
203
+
204
+ // Sign the artifacts.
205
+ getSignatureFiles().each { signature ->
206
+ artifact (signature.archive) {
207
+ classifier = signature.classifier
208
+ extension = signature.extension
209
+ }
210
+ }
80
211
}
81
212
}
82
213
}
83
214
}
215
+ */
0 commit comments