forked from skaca8/mido-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
137 lines (116 loc) · 3.95 KB
/
Copy pathbuild.gradle
File metadata and controls
137 lines (116 loc) · 3.95 KB
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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'org.springframework.boot' version '3.2.4'
id 'io.spring.dependency-management' version '1.1.7'
}
group = 'io.github.skaca8'
version = '1.0.5'
java.sourceCompatibility = JavaVersion.VERSION_17
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
// Spring Boot
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-web'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
// Validation
implementation 'org.springframework.boot:spring-boot-starter-validation'
// Lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
// Jackson
implementation 'com.fasterxml.jackson.core:jackson-databind'
// Test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
// Lombok for tests
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
}
tasks.named('test') {
useJUnitPlatform()
}
java {
withJavadocJar()
withSourcesJar()
}
// 라이브러리로 배포하기 위한 설정
jar {
enabled = true
archiveClassifier = ''
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
// Spring Boot의 fat jar 생성 비활성화 (라이브러리용)
bootJar {
enabled = false
}
publishing {
publications {
create('maven', MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'Spring Mido Client'
description = 'A Spring Boot starter for multi-channel REST client management'
url = 'https://github.com/skaca8/mido-client'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'hyunjun'
name = 'Hyunjun'
email = 'skaca8@naver.com'
}
}
scm {
connection = 'scm:git:git://github.com/skaca8/mido-client.git'
developerConnection = 'scm:git:ssh://github.com/skaca8/mido-client.git'
url = 'https://github.com/skaca8/mido-client/tree/main'
}
}
}
}
}
signing {
def signingKey = ((findProperty('signingKey') ?: System.getenv('SIGNING_KEY')) as String)?.replace('\\n', '\n') ?: ''
def signingPassword = ((findProperty('signingPassword') ?: System.getenv('SIGNING_PASSWORD')) as String) ?: ''
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.maven
}
tasks.register('updateReadmeVersion') {
doLast {
def versionPattern = ~/([0-9]+\.[0-9]+\.[0-9]+)/
['README.md', 'README.ko.md'].each { filename ->
def f = file(filename)
def updated = f.text.replaceAll(
/(com\.github\.skaca8:mido-client:|io\.github\.skaca8:mido-client:|<version>)[0-9]+\.[0-9]+\.[0-9]+/,
{ m -> m[0].replaceAll(versionPattern, version) }
).replaceAll(
/(`)[0-9]+\.[0-9]+\.[0-9]+(`)/,
{ m -> m[0].replaceAll(versionPattern, version) }
)
f.text = updated
}
println "README versions updated to $version"
}
}