-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
137 lines (124 loc) · 4.89 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
import com.hibernix.tools.setup.features.DependencyUpdatesMinStability
import com.hibernix.tools.setup.features.dependencyUpdates
import com.hibernix.tools.setup.features.features
plugins {
val publishVersion: String by System.getProperties()
val updateDepsVersion: String by System.getProperties()
`kotlin-dsl`
id("com.gradle.plugin-publish") version publishVersion
id("com.github.ben-manes.versions") version updateDepsVersion
id("com.hibernix.tools.setup") version "0.3.7"
signing
}
repositories {
mavenCentral()
gradlePluginPortal()
google()
mavenLocal()
}
group = requireNotNull(property("project.group")) { "No groupId declared in 'project.group' property" }
version = requireNotNull(property("project.version")) { "No project version declared in 'project.version'" }
features {
dependencyUpdates(DependencyUpdatesMinStability.RC)
}
dependencies {
val agpVersion: String by project
val kotlinVersion: String by project
val detektVersion: String by project
val dokkaVersion: String by project
val updateDepsVersion: String by System.getProperties()
// compileOnly("com.android.tools.build:gradle:7.3.1")
compileOnly("com.android.tools.build:gradle:$agpVersion")
compileOnly("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
compileOnly("com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin:$updateDepsVersion")
compileOnly("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion")
compileOnly("org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion")
compileOnly("org.jetbrains.dokka:dokka-core:$dokkaVersion")
//implementation("org.jetbrains.dokka:dokka-base:$dokkaVersion")
}
gradlePlugin {
website.set("https://github.com/hibernix/hibernix-gradle-setup")
vcsUrl.set("https://github.com/hibernix/hibernix-gradle-setup.git")
plugins {
register("hibernix-gradle-setup") {
id = "com.hibernix.tools.setup"
displayName = "Multiplatform project setup plugin"
tags.set(listOf("kotlin-multiplatform", "kotlin"))
description = "Convenience gradle plugin for basic multiplatform project setup"
implementationClass = "com.hibernix.tools.setup.ProjectSetupPlugin"
}
}
}
val javadocJar = tasks.register<Jar>("javadocJar") {
//dependsOn(deleteDokkaOutputDir, tasks.dokkaHtml)
archiveClassifier.set("javadoc")
//from(dokkaOutputDir)
}
publishing {
repositories {
maven {
name = "Release"
//setUrl { "https://hibernix.jfrog.io/artifactory/release" }
setUrl { "https://packagecloud.io/hibernix/repo/maven2" }
credentials {
//username = System.getenv("SONATYPE_USERNAME")
username = "7ae5f1223fccaa0e11ec20a6ead46c2e59fac02b61198dd8"
//password = System.getenv("SONATYPE_PASSWORD")
password = ""
}
}
maven {
name = "Snapshot"
setUrl { "https://hibernix.jfrog.io/artifactory/snapshot" }
credentials {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
publications {
withType<MavenPublication> {
//artifact(tasks["javadocJar"])
pom {
name.set(project.name)
description.set("Multiplatform project setup plugin")
url.set("https://github.com/hibernix/hibernix-gradle-setup")
licenses {
license {
name.set("Apache License 2.0")
url.set("https://github.com/hibernix/hibernix-gradle-setup/LICENSE")
}
}
scm {
url.set("https://github.com/hibernix/hibernix-gradle-setup")
connection.set("scm:git:git://github.com/hibernix/hibernix-gradle-setup.git")
}
developers {
developer {
name.set("hibernix")
url.set("https://hibernix.com")
}
}
}
}
}
}
signing {
/*
useInMemoryPgpKeys(
System.getenv("GPG_PRIVATE_KEY"),
System.getenv("GPG_PRIVATE_PASSWORD")
)
*/
sign(publishing.publications)
}
/*
tasks.named("dependencyUpdates", com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask::class).configure {
val immaturityLevels = listOf(*/
/*"rc", *//*
"beta", "m", "alpha", "preview", "dev") // order is important
val immaturityRegexes = immaturityLevels.map { ".*[.\\-]$it[.\\-\\d]*".toRegex(RegexOption.IGNORE_CASE) }
fun immaturityLevel(version: String): Int = immaturityRegexes.indexOfLast { version.matches(it) }
rejectVersionIf { immaturityLevel(candidate.version) > immaturityLevel(currentVersion) }
}
*/