forked from jizoquval/multiplatform-swiftpackage
-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle.kts
122 lines (104 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath(libs.binary.compatibility.validator)
}
}
apply(plugin = "binary-compatibility-validator")
plugins {
`kotlin-dsl`
`java-gradle-plugin`
`maven-publish`
signing
}
version = "2.2.3"
repositories {
mavenCentral()
}
kotlin {
jvmToolchain(8)
}
dependencies {
compileOnly(libs.kotlin.gradle.plugin)
testImplementation(libs.kotest.runner.junit5)
testImplementation(libs.kotest.assertions.core)
testImplementation(libs.kotest.property)
testImplementation(libs.mockk)
testImplementation(libs.kotlin.gradle.plugin)
}
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 = "io.github.luca992.multiplatform-swiftpackage"
implementationClass = "com.chromaticnoise.multiplatformswiftpackage.MultiplatformSwiftPackagePlugin"
}
}
}
publishing {
publications {
create<MavenPublication>("pluginMaven") {
pom {
groupId = "io.github.luca992.multiplatform-swiftpackage"
artifactId = "io.github.luca992.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/luca992/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/luca992/multiplatform-swiftpackage.git")
developerConnection.set("scm:git:ssh://github.com/luca992/multiplatform-swiftpackage.git")
url.set(" https://github.com/luca992/multiplatform-swiftpackage")
}
}
}
}
repositories {
maven {
val releasesUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
name = "mavencentral"
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)
credentials {
username = System.getenv("ossrh.username") ?: properties["ossrh.username"].toString()
password = System.getenv("ossrh.password") ?: properties["ossrh.password"].toString()
}
}
}
}
signing {
sign(publishing.publications["pluginMaven"])
}
tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}