Skip to content

Commit

Permalink
Prepare for v1.0.0-alpha05 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
teogor committed Apr 15, 2024
1 parent 72461d4 commit eed3dc5
Show file tree
Hide file tree
Showing 27 changed files with 853 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,6 @@ jobs:
else
for module in "${modules_to_publish[@]}"; do
echo "Publishing $module module..."
./gradlew ":${module}:publish" --no-configuration-cache
./gradlew publishModule -PmoduleName="${module}" --no-configuration-cache
done
fi
2 changes: 1 addition & 1 deletion bom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ winds {
artifactDescriptor {
name = "BoM"
version = createVersion(1, 0, 0) {
alphaRelease(4)
alphaRelease(5)
}
artifactIdFormat = ArtifactIdFormat.NAME_ONLY
}
Expand Down
52 changes: 52 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,58 @@ tasks.dokkaHtmlMultiModule {
}
}

childProjects.values.filter {
it.name != "app" && it.name != "bom"
}.forEach { subproject ->
val name = subproject.name[0].uppercaseChar() + subproject.name.substring(1)
tasks.register("publish${name}Module") {
group = "publishing"
description = "Publishes artifacts from the specified subproject."

subproject.subprojects.forEach { sp ->
sp.tasks.findByName("publish")?.let { task ->
dependsOn(task)
}
}
}
}

abstract class PublishModuleTask : DefaultTask() {

@get:Input
abstract val moduleName: Property<String>

private val childProjects = project.childProjects.values.filter {
it.name != "app" && it.name != "bom"
}

@TaskAction
fun publish() {
println("Published module: ${moduleName.get()}")
}

fun configureDependencies() {
childProjects.firstOrNull {
it.name == moduleName.get()
}?.let { subproject ->
// Handle scenarios where subproject might have subprojects (nested modules)
subproject.subprojects.forEach { childProject ->
childProject.tasks.findByName("publish")?.let { childPublishTask ->
dependsOn(childPublishTask) // Depend on child publish tasks
}
}
}
}
}

tasks.register("publishModule", PublishModuleTask::class) {
group = "publishing"
description = "Publishes artifacts from a specified module."
moduleName = project.findProperty("moduleName") as String? ?: ""

configureDependencies()
}

versionCatalogUpdate {
keep {
// keep versions without any library or plugin reference
Expand Down
2 changes: 1 addition & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ winds {
artifactDescriptor {
name = "Core"
version = createVersion(1, 0, 0) {
alphaRelease(4)
alphaRelease(5)
}
}
}
Expand Down
Loading

0 comments on commit eed3dc5

Please sign in to comment.