-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
120 lines (99 loc) · 3.19 KB
/
build.gradle
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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id "idea"
id "java-library"
id "maven-publish"
id "signing"
id "org.jetbrains.kotlin.jvm" version "1.9.23"
}
ext {
major = 1
minor = 0
patch = 1
isCiServer = System.getenv("GITHUB_ACTIONS") != null || System.getProperty("GITHUB_ACTIONS") != null
}
group "io.viascom.nanoid"
version = "${major}.${minor}.${patch}${isCiServer ? "" : "-SNAPSHOT"}"
project.logger.lifecycle("Version of this build: ${version}")
jar {
archiveClassifier.set("")
manifest {
attributes "Implementation-Version": "${project.version}"
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
java {
withSourcesJar()
withJavadocJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
repositories {
mavenCentral()
}
dependencies {
//====== Kotlin ======
implementation "org.jetbrains.kotlin:kotlin-stdlib"
}
tasks.withType(KotlinCompile).configureEach {
kotlinOptions.jvmTarget = JavaVersion.VERSION_17
kotlinOptions.freeCompilerArgs = ["-Xjvm-default=all"]
}
publishing {
repositories {
maven {
def releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
name = "OSSRH"
url = isCiServer ? releaseRepo : snapshotRepo
credentials {
username = findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
password = findProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD")
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
pom {
groupId = "io.viascom.nanoid"
name = "nanoid"
description = "."
url = "https://github.com/viascom/nanoid-kotlin"
packaging = "jar"
licenses {
license {
name = 'Apache-2.0 license'
url = 'https://www.apache.org/licenses/LICENSE-2.0'
}
}
scm {
url = "https://github.com/viascom/nanoid-kotlin"
connection = "scm:git://github.com/viascom/nanoid-kotlin.git"
developerConnection = "scm:git://github.com/viascom/nanoid-kotlin.git"
}
developers {
developer {
id = "itsmefox"
name = "Patrick Bösch"
email = "[email protected]"
organizationUrl = "https://viascom.io/"
}
developer {
id = "nik-sta"
name = "Nikola Stankovic"
email = "[email protected]"
organizationUrl = "https://viascom.io/"
}
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
tasks.withType(Sign).configureEach {
onlyIf { isCiServer }
}