Skip to content

Commit 32a663e

Browse files
committed
refactor(build): simplify build configuration and module inclusion logic
- Streamlined module inclusion logic in `settings.gradle.kts` by removing redundant project name assignment. - Removed unused `build-command` input from the CI workflow. - Modified `build.gradle.kts` to dynamically adjust the project group based on module paths. - Updated JAR tasks to generate module-specific archive names dynamically.
1 parent 5e47219 commit 32a663e

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,5 @@ jobs:
3939
name: Build and Publish
4040
uses: NeoTamia/actions/.github/workflows/jvm-build-and-publish.yml@main
4141
with:
42-
build-command: './gradlew build "-Pspotless.enforceCheck=false"'
4342
release: ${{ startsWith(github.ref, 'refs/tags/v') || github.event.inputs.release == 'true' }}
4443
secrets: inherit

buildSrc/src/main/kotlin/neotamia-build.gradle.kts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ plugins {
1212
id("com.diffplug.spotless")
1313
}
1414

15-
group = "re.neotamia.javatemplate"
15+
val baseGroup = "re.mineraiders.javatemplate"
16+
group = when {
17+
project.path.startsWith(":modules:core") -> "$baseGroup.core"
18+
else -> baseGroup
19+
}
1620
version = findProperty("version")!!
1721

1822
repositories {
@@ -72,9 +76,9 @@ spotless {
7276
}
7377
}
7478

75-
tasks.withType<ShadowJar> {
76-
archiveClassifier.set("")
77-
}
79+
//tasks.withType<ShadowJar> {
80+
// archiveClassifier.set("")
81+
//}
7882

7983
val copyJars = tasks.register<Copy>("copyJars") {
8084
group = "publishing"
@@ -97,8 +101,9 @@ tasks.build {
97101
finalizedBy(copyJars)
98102
}
99103

100-
tasks.named<Jar>("jar") {
101-
archiveClassifier.set("stripped")
104+
tasks.withType<Jar> {
105+
val moduleName = project.path.removePrefix(":modules:").replace(":", "-")
106+
archiveBaseName.set("java-template-$moduleName")
102107
}
103108

104109
tasks.withType<Test>().configureEach {

settings.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,5 @@ file("modules").listFiles()?.forEach { file ->
2323
if (file.isDirectory and !file.name.equals("build")) {
2424
println("Include modules:${file.name}")
2525
include(":modules:${file.name}")
26-
project(":modules:${file.name}").name = "${rootProject.name}-${file.name}"
2726
}
2827
}

0 commit comments

Comments
 (0)