Skip to content

Commit

Permalink
add Activity to the documentation cli options
Browse files Browse the repository at this point in the history
  • Loading branch information
cwensel committed Dec 11, 2023
1 parent 4240b51 commit 8f0abe3
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
17 changes: 17 additions & 0 deletions clusterless-main/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,22 @@ tasks.register<Exec>("generateBoundariesIndex") {
mustRunAfter("generateResourceIndex")
}

tasks.register<Exec>("generateActivitiesIndex") {
dependsOn("installDist")

workingDir = file("build/install/clusterless/bin")
commandLine = listOf(
"./cls",
"show",
"activity",
"--list",
"--output-path",
"${buildDir}/generated-docs/modules/components/",
"--append=true"
)
mustRunAfter("generateBoundariesIndex")
}

tasks.register<Exec>("generateComponentPartial") {
dependsOn("installDist")

Expand Down Expand Up @@ -322,6 +338,7 @@ tasks.register<Copy>("generateDocs") {
dependsOn("generateArcIndex")
dependsOn("generateBarriersIndex")
dependsOn("generateBoundariesIndex")
dependsOn("generateActivitiesIndex")
dependsOn("generateComponentPartial")
dependsOn("generateModelModels")
dependsOn("generateModelModelsRequired")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2023 Chris K Wensel <[email protected]>. All Rights Reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

package clusterless.cls.command.show;

import clusterless.cls.model.deploy.Activity;
import org.jetbrains.annotations.NotNull;
import picocli.CommandLine;

import java.util.Collection;

@CommandLine.Command(
name = "activity",
description = "Show available provider activities."
)
public class ShowActivities extends ShowComponents {
@Override
protected @NotNull String elementSubType() {
return "Activities";
}

@Override
protected Collection<String> getNames() {
return super.getNamesHaving(e -> Activity.class.isAssignableFrom(e.getValue()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
ShowBoundaries.class,
ShowBarriers.class,
ShowArcs.class,
ShowActivities.class,
ShowModels.class,
CommandLine.HelpCommand.class
}
Expand Down

0 comments on commit 8f0abe3

Please sign in to comment.