-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
115 lines (103 loc) · 3.3 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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
id 'com.palantir.git-version' version '3.1.0'
id 'org.jetbrains.kotlin.jvm' version '2.0.21'
}
apply from: 'hooks.gradle'
group = 'io.github.lsd-consulting'
version = gitVersion().replaceAll("^v", "")
logger.lifecycle("Version=$version")
kotlin {
jvmToolchain(11)
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.slf4j:slf4j-api:2.0.16'
}
tasks.register('sourcesJar', Jar) {
dependsOn classes
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
tasks.register('javadocJar', Jar) {
archiveClassifier = 'javadoc'
from javadoc
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = "$group"
artifactId = 'lsd-logging-library'
version = "${version}"
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'lsd-logging-library'
description = 'A library providing a Kotlin logging functionality.'
url = 'https://github.com/lsd-consulting/lsd-logging-library.git'
licenses {
license {
name = "MIT License"
url = "https://github.com/lsd-consulting/lsd-logging-library/blob/main/LICENSE"
distribution = "repo"
}
}
developers {
developer {
name = "Nick"
email = "[email protected]"
organization = 'NKM IT Solutions'
organizationUrl = 'https://github.com/nickmcdowall'
}
developer {
name = "Lukasz"
email = "[email protected]"
organization = 'Integreety Ltd.'
organizationUrl = 'https://www.integreety.co.uk'
}
}
scm {
url = "https://github.com/lsd-consulting/lsd-logging-library.git"
}
}
repositories {
maven {
name = 'sonatype'
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials(PasswordCredentials)
}
}
}
}
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
signing {
if (project.findProperty("signingKey")) {
// Use in-memory ascii-armored keys
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
} else {
// Use signing properties in ~/.gradle/gradle.properties
sign publishing.publications.mavenJava
}
}