forked from jizoquval/multiplatform-swiftpackage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
129 lines (108 loc) · 3.54 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlinx:binary-compatibility-validator:0.9.0")
}
}
apply(plugin = "binary-compatibility-validator")
plugins {
`kotlin-dsl`
`java-gradle-plugin`
`maven-publish`
signing
}
version = "2.0.5"
group = "com.myunidays.multiplatform-swiftpackage"
repositories {
mavenCentral()
}
dependencies {
compileOnly(kotlin("gradle-plugin", "1.6.21"))
testImplementation("io.kotest:kotest-runner-junit5:5.2.3")
testImplementation("io.kotest:kotest-assertions-core:5.2.3")
testImplementation("io.kotest:kotest-property:5.2.3")
testImplementation("io.mockk:mockk:1.12.3")
testImplementation(kotlin("gradle-plugin", "1.6.21"))
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
}
tasks.withType<Test> {
useJUnitPlatform()
}
project.tasks.named("processResources", Copy::class.java) {
// https://github.com/gradle/gradle/issues/17236
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
extensions.findByName("buildScan")?.withGroovyBuilder {
setProperty("termsOfServiceUrl", "https://gradle.com/terms-of-service")
setProperty("termsOfServiceAgree", "yes")
}
gradlePlugin {
plugins {
create("pluginMaven") {
id = "com.myunidays.multiplatform-swiftpackage"
implementationClass = "com.myunidays.multiplatformswiftpackage.MultiplatformSwiftPackagePlugin"
}
}
}
fun SigningExtension.whenRequired(block: () -> Boolean) {
setRequired(block)
}
//tasks.javadoc {
// if (JavaVersion.current().isJava9Compatible) {
// (options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
// }
//}
val javadocJar by tasks.creating(Jar::class) {
archiveClassifier.value("javadoc")
}
publishing {
repositories {
maven {
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("sonatypeUsernameEnv")
password = System.getenv("sonatypePasswordEnv")
}
}
}
publications.all {
this as MavenPublication
artifact(javadocJar)
pom {
name.set("Multiplatform Swift Package")
description.set("Gradle plugin to generate a Swift.package file and XCFramework to distribute a Kotlin Multiplatform iOS library")
url.set("https://github.com/myunidays/multiplatform-swiftpackage")
licenses {
license {
name.set("Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("Reedyuk")
name.set("Andrew Reed")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:https://github.com/myunidays/multiplatform-swiftpackage.git")
developerConnection.set("scm:git:ssh://[email protected]/myunidays/multiplatform-swiftpackage.git")
url.set("https://github.com/myunidays/multiplatform-swiftpackage")
}
}
}
}
signing {
whenRequired { gradle.taskGraph.hasTask("publish") }
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications)
}