forked from oshai/kotlin-logging
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
200 lines (188 loc) · 6.88 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
plugins {
kotlin("multiplatform") version "1.4.10"
id("org.jetbrains.dokka") version "1.4.0"
id("com.jfrog.artifactory") version "4.17.2"
`maven-publish`
}
apply("versions.gradle.kts")
group = "io.github.microutils"
version = "2.0.4" + (if (System.getProperty("snapshot")?.toBoolean() == true) "-SNAPSHOT" else "")
repositories {
jcenter()
mavenCentral()
}
kotlin {
explicitApi()
jvm {
compilations.all {
// kotlin compiler compatibility options
kotlinOptions {
apiVersion = "1.4"
languageVersion = "1.4"
}
}
}
js(BOTH) {
browser {
testTask {
useKarma {
useChromeHeadless()
}
}
}
nodejs()
}
linuxX64("linuxX64")
macosX64("macosX64")
mingwX64("mingwX64")
sourceSets {
val commonMain by getting {}
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val jvmMain by getting {
dependencies {
api("org.slf4j:slf4j-api:${extra["slf4j_version"]}")
}
}
val jvmTest by getting {
dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-junit"))
implementation("junit:junit:${extra["junit_version"]}")
implementation("org.mockito:mockito-all:${extra["mockito_version"]}")
implementation("org.apache.logging.log4j:log4j-api:${extra["log4j_version"]}")
implementation("org.apache.logging.log4j:log4j-core:${extra["log4j_version"]}")
implementation("org.apache.logging.log4j:log4j-slf4j-impl:${extra["log4j_version"]}")
}
}
val jsMain by getting {}
val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
}
}
val nativeMain by creating {
dependsOn(commonMain)
}
val linuxX64Main by getting {
dependsOn(nativeMain)
}
val mingwX64Main by getting {
dependsOn(nativeMain)
}
val macosX64Main by getting {
dependsOn(nativeMain)
}
}
}
tasks {
register<Jar>("dokkaJar") {
from(dokkaHtml)
dependsOn(dokkaHtml)
archiveClassifier.set("javadoc")
}
}
publishing {
publications.withType<MavenPublication> {
pom {
name.set("kotlin-logging")
description.set("kotlin-logging $version - Lightweight logging framework for Kotlin")
url.set("https://github.com/MicroUtils/kotlin-logging")
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
name.set("Ohad Shai")
email.set("[email protected]")
organization.set("github")
organizationUrl.set("http://www.github.com")
}
}
scm {
connection.set("scm:git:git://github.com/MicroUtils/kotlin-logging.git")
developerConnection.set("scm:git:ssh://github.com:MicroUtils/kotlin-logging.git")
url.set("http://github.com/MicroUtils/kotlin-logging/tree/master")
}
}
artifact(tasks["dokkaJar"])
}
}
publishing {
val bintrayOrg = "microutils"
val bintrayRepo = "kotlin-logging"
val bintrayUser = System.getProperty("bintray.user")
val bintrayApiKey = System.getProperty("bintray.key")
if (bintrayUser != null && bintrayApiKey != null) {
repositories {
maven {
name = "bintray"
url = uri(
"https://api.bintray.com/maven/$bintrayOrg/$bintrayRepo/${project.name}/;publish=1;override=1"
)
credentials {
username = bintrayUser
password = bintrayApiKey
}
}
}
}
}
//bintray {
// user = System.getProperty("bintray.user")
// key = System.getProperty("bintray.key") //https://bintray.com/profile/edit
// setPublications(*publishing.publications.names.toTypedArray())
// publish = true //[Default: false] Whether version should be auto published after an upload
// pkg.apply {
// repo = "kotlin-logging"
// name = "kotlin-logging"
// userOrg = "microutils"
// setLicenses("Apache-2.0")
// vcsUrl = "https://github.com/MicroUtils/kotlin-logging"
// websiteUrl = "https://github.com/MicroUtils/kotlin-logging"
// issueTrackerUrl = "https://github.com/MicroUtils/kotlin-logging/issues"
//
// githubRepo = "MicroUtils/kotlin-logging"
// githubReleaseNotesFile = "ChangeLog.md"
// version.apply {
// name = "${project.version}"
// desc = "kotlin-logging - Lightweight logging framework for Kotlin"
// released = "${Date()}"
// gpg.sign = true //Determines whether to GPG sign the files. The default is false
// mavenCentralSync.apply {
// sync = true //[Default: true] Determines whether to sync the version to Maven Central.
// user = System.getProperty("maven.user") //OSS user token: mandatory
// password = System.getProperty("maven.password") //OSS user password: mandatory
// close =
// "1" //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually.
// }
// }
// }
//}
artifactory {
setContextUrl("http://oss.jfrog.org")
publish(delegateClosureOf<org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig> {
repository(delegateClosureOf<groovy.lang.GroovyObject> {
setProperty("repoKey", "oss-snapshot-local")
setProperty("username", System.getProperty("bintray.user"))
setProperty("password", System.getProperty("bintray.key"))
setProperty("maven", true)
})
defaults(delegateClosureOf<groovy.lang.GroovyObject> {
invokeMethod("publications", publishing.publications.names.toTypedArray())
setProperty("publishArtifacts", true)
setProperty("publishPom", true)
})
})
resolve(delegateClosureOf<org.jfrog.gradle.plugin.artifactory.dsl.ResolverConfig> {
setProperty("repoKey", "jcenter")
})
clientConfig.info.buildNumber = System.getProperty("build.number")
}