-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
104 lines (93 loc) · 2.85 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
import java.util.Date
import com.jfrog.bintray.gradle.tasks.entities.Artifact as BinTrayArtifact
apply(from = "groovy.gradle")
plugins {
kotlin("multiplatform") version "1.3.41"
id("maven-publish")
id("com.jfrog.bintray") version "1.8.4"
}
val GROUP_ID = "com.github.jershell"
val ARTIFACT_ID = rootProject.name
val BINTRAY_REPOSITORY = "generic"
val BINTRAY_ORGINIZATION = "jershell"
val LIBRARY_VERSION_NAME = "0.0.1"
group = GROUP_ID
version = LIBRARY_VERSION_NAME
val groovyBintrayUpload: groovy.lang.Closure<Any?> by extra
tasks.bintrayUpload {
doFirst {
groovyBintrayUpload(this, publishing)
}
dependsOn("publishToMavenLocal")
}
bintray {
user = project.property("user_name").toString()
key = project.property("apikey").toString()
publish = true
override = false
pkg.apply {
repo = BINTRAY_REPOSITORY
name = ARTIFACT_ID
userOrg = BINTRAY_ORGINIZATION
desc = "kotlin multiplatform base64 implementation"
setLicenses("MIT")
version.apply {
name = LIBRARY_VERSION_NAME
vcsTag = LIBRARY_VERSION_NAME
released = Date().toString()
}
vcsUrl = "https://github.com/jershell/kbase64.git"
websiteUrl = "https://github.com/jershell/kbase64"
issueTrackerUrl = "https://github.com/jershell/kbase64/issues"
setLabels("kotlin", "Base64", "multiplatform")
}
}
repositories {
jcenter()
maven { url = uri("https://dl.bintray.com/jershell/generic") }
}
kotlin {
jvm().compilations["main"].defaultSourceSet {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
}
}
jvm().compilations["test"].defaultSourceSet {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-test")
implementation("org.jetbrains.kotlin:kotlin-test-junit")
}
}
// For ARM, should be changed to iosArm32 or iosArm64
// For Linux, should be changed to e.g. linuxX64
// For MacOS, should be changed to e.g. macosX64
// For Windows, should be changed to e.g. mingwX64
linuxX64()
sourceSets {
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib-common"))
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
}
println(targets.names)
}
afterEvaluate {
project.publishing.publications.all {
this as MavenPublication
// rename artifacts
this.groupId = GROUP_ID
if (this.name.contains("metadata")) {
this.artifactId = ARTIFACT_ID
} else {
this.artifactId = "$ARTIFACT_ID-${this.name}"
}
this as Publication
}
}