This repository has been archived by the owner on Jul 25, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
139 lines (118 loc) · 4.06 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
130
131
132
133
134
135
136
137
138
139
import java.util.*
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlinx:binary-compatibility-validator:0.4.0")
}
}
apply(plugin = "binary-compatibility-validator")
plugins {
`kotlin-dsl`
`java-gradle-plugin`
`maven-publish`
signing
}
val versionName = "0.2.1"
val group = "com.prof18.kmp.fatframework.cocoa"
version = versionName
repositories {
mavenCentral()
}
val fixtureClasspath by configurations.creating
// Append any extra dependencies to the test fixtures via a custom configuration classpath. This
// allows us to apply additional plugins in a fixture while still leveraging dependency resolution
// and de-duplication semantics.
tasks.pluginUnderTestMetadata {
pluginClasspath.from(fixtureClasspath)
}
dependencies {
compileOnly(gradleApi())
compileOnly("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20")
compileOnly("org.jetbrains.kotlin:kotlin-compiler-embeddable:1.5.20")
testImplementation("junit:junit:4.13.1")
testImplementation("com.google.truth:truth:1.0.1")
fixtureClasspath(kotlin("gradle-plugin"))
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
tasks.test {
useJUnit()
}
gradlePlugin {
plugins {
create("fatframeworkCocoa") {
id = group
implementationClass = "com.prof18.kmp.fatframework.cocoa.KMPFatFrameworkCocoaPlugin"
version = versionName
}
}
}
val local = Properties()
val localProperties: File = rootProject.file("local.properties")
if (localProperties.exists()) {
localProperties.inputStream().use { local.load(it) }
local.forEach { name, value ->
ext {
set(name as String, value)
}
}
} else {
ext {
set("signing.keyId", System.getenv("SIGNING_KEY_ID"))
set("signing.password", System.getenv("SIGNING_PASSWORD"))
set("signing.secretKeyRingFile", System.getenv("SIGNING_SECRET_KEY_RING_FILE"))
set("ossrhUsername", System.getenv("OSSRH_USERNAME"))
set("ossrhPassword", System.getenv("OSSRH_PASSWORD"))
}
}
publishing {
publications {
create<MavenPublication>("pluginMaven") {
pom {
groupId = group
artifactId = "com.prof18.kmp.fatframework.cocoa.gradle.plugin"
name.set("KMP FatFramework Cocoa")
description.set("Gradle plugin to distribute a Kotlin Multiplatform iOS library in a FatFramework with CocoaPod")
url.set("https://github.com/prof18/kmp-fatframework-cocoa")
licenses {
license {
name.set("Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("prof18")
name.set("Marco Gomiero")
}
}
scm {
connection.set("scm:git:https://github.com/prof18/kmp-fatframework-cocoa")
developerConnection.set("scm:git:ssh://git@github.com/prof18/kmp-fatframework-cocoa.git")
url.set("https://github.com/prof18/kmp-fatframework-cocoa")
}
}
}
}
repositories {
maven {
val releasesUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
name = "sonatype"
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)
credentials {
username = local.getProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
password = local.getProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD")
}
}
}
}
signing {
sign(publishing.publications["pluginMaven"])
}