-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
64 lines (50 loc) · 2.24 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
import com.jfrog.bintray.gradle.BintrayExtension
import java.util.Properties
plugins {
id("org.jetbrains.kotlin.jvm") version "1.4.10" apply false
id("com.jfrog.bintray") version "1.8.5" apply false
}
group = "ru.krikun.commonmark"
version = "0.1.2"
val properties = properties("bintray.properties")
val bintrayUser: String = properties.getProperty("user")
val bintrayKey: String = properties.getProperty("key")
val bintrayDryRun = properties.getProperty("dryRun") == "true"
subprojects
.onEach { it.repositories { jcenter() } }
.filter { it.name != "commonmark-kotlinx-html-test" }
.forEachAfterEvaluate { subproject ->
subproject.group = group
subproject.version = version
subproject.apply(plugin = "com.jfrog.bintray")
subproject.apply(plugin = "org.gradle.maven-publish")
val sourcesJar = subproject.task<Jar>("sourcesJar") {
archiveClassifier.set("sources")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(subproject.sourceSets["main"].allSource)
}
subproject.configure<PublishingExtension> {
publications.create<MavenPublication>("maven") {
from(subproject.components["java"])
artifact(sourcesJar) { classifier = "sources" }
}
}
subproject.configure<BintrayExtension> {
user = bintrayUser
key = bintrayKey
dryRun = bintrayDryRun
pkg.apply {
repo = "maven"
name = subproject.name
setLicenses("Apache-2.0")
websiteUrl = "https://github.com/OlegKrikun/commonmark-kotlinx-html"
issueTrackerUrl = "https://github.com/OlegKrikun/commonmark-kotlinx-html/issues"
vcsUrl = "https://github.com/OlegKrikun/commonmark-kotlinx-html.git"
setPublications("maven")
}
}
}
val Project.sourceSets get() = the<JavaPluginConvention>().sourceSets
fun Iterable<Project>.forEachAfterEvaluate(action: (Project) -> Unit) = forEach { it.afterEvaluate(action) }
fun properties(path: String) = Properties().apply { file(path).inputStream().use { load(it) } }
tasks.wrapper { distributionType = Wrapper.DistributionType.ALL }