forked from ge-org/multiplatform-swiftpackage
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle.kts
118 lines (101 loc) · 3.53 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
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.3"
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
withJavadocJar()
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.chromaticnoise.multiplatform-swiftpackage"
implementationClass = "com.chromaticnoise.multiplatformswiftpackage.MultiplatformSwiftPackagePlugin"
}
}
}
publishing {
publications {
create<MavenPublication>("pluginMaven") {
pom {
groupId = "com.chromaticnoise.multiplatform-swiftpackage"
artifactId = "com.chromaticnoise.multiplatform-swiftpackage.gradle.plugin"
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/ge-org/multiplatform-swiftpackage")
licenses {
license {
name.set("Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
name.set("Georg Dresler")
}
}
scm {
connection.set("scm:git:https://github.com/ge-org/multiplatform-swiftpackage.git")
developerConnection.set("scm:git:ssh://[email protected]/ge-org/multiplatform-swiftpackage.git")
url.set("https://github.com/ge-org/multiplatform-swiftpackage")
}
}
}
}
repositories {
maven {
val releasesUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
name = "mavencentral"
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)
credentials {
username = System.getenv("SONATYPE_NEXUS_USERNAME")
password = System.getenv("SONATYPE_NEXUS_PASSWORD")
}
}
}
}
signing {
sign(publishing.publications["pluginMaven"])
}
tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}