Skip to content

Commit 684e4bd

Browse files
committed
refactor: extract maven-publish configuration to publish-convention plugin
- Created `publish-convention.gradle.kts` for centralizing publishing setup. - Replaced direct `maven-publish` usage with `publish-convention` plugin in build scripts. - Simplified `core-convention` by delegating publishing configuration to the new plugin.
1 parent 095ce20 commit 684e4bd

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

buildSrc/src/main/kotlin/core-convention.gradle.kts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ val libs = the<LibrariesForLibs>()
66
plugins {
77
java
88
`java-library`
9-
`maven-publish`
9+
id("publish-convention")
1010

1111
kotlin("jvm")
1212
kotlin("plugin.serialization")
@@ -54,21 +54,6 @@ java {
5454
}
5555
}
5656

57-
publishing {
58-
repositories {
59-
maven("https://repo.slne.dev/repository/maven-releases/") {
60-
name = "maven-releases"
61-
credentials {
62-
username = System.getenv("SLNE_RELEASES_REPO_USERNAME")
63-
password = System.getenv("SLNE_RELEASES_REPO_PASSWORD")
64-
}
65-
}
66-
}
67-
68-
publications.create<MavenPublication>("maven") {
69-
from(components["java"])
70-
}
71-
}
7257

7358
configurations {
7459
compileOnly {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
plugins {
2+
`maven-publish`
3+
}
4+
5+
publishing {
6+
repositories {
7+
maven("https://repo.slne.dev/repository/maven-releases/") {
8+
name = "maven-releases"
9+
credentials {
10+
username = System.getenv("SLNE_RELEASES_REPO_USERNAME")
11+
password = System.getenv("SLNE_RELEASES_REPO_PASSWORD")
12+
}
13+
}
14+
}
15+
16+
publications.create<MavenPublication>("maven") {
17+
from(components["java"])
18+
}
19+
}

surf-api-gradle-plugin/surf-api-processor/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ val snapshot = (findProperty("snapshot") as String).toBooleanStrict()
66

77
plugins {
88
kotlin("jvm")
9+
`publish-convention`
910
}
1011

1112
group = groupId

0 commit comments

Comments
 (0)