Skip to content

Commit

Permalink
Moved documentation to 00-docs / integrated DevCompanyCamundalaHelper.
Browse files Browse the repository at this point in the history
  • Loading branch information
pme123 committed Dec 14, 2024
1 parent e3260d6 commit dcff2bd
Show file tree
Hide file tree
Showing 66 changed files with 57 additions and 58 deletions.
2 changes: 1 addition & 1 deletion 00-documentation/README.md → 00-docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This generates HTML to _/docs_ (standard in Github)

### Development
`sbt>~documentation/laikaPreview`
`sbt>~docs/laikaPreview`

### Releasing
Should be taken care by the normal release process.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
package camundala.helper.dev

import camundala.api.ApiConfig
import camundala.helper.dev.publish.PublishHelper
import camundala.helper.dev.publish.PublishHelper.*
import camundala.helper.util.{DevConfig, Helpers}
import camundala.helper.util.{DevConfig, Helpers, PublishConfig}

import scala.util.{Failure, Success, Try}

// dev-company/company-camundala/helper.scala
case class DevCompanyCamundalaRunner(
devConfig: DevConfig
) extends Helpers:
trait DevCompanyCamundalaHelper extends Helpers:
def apiConfig: ApiConfig
def devConfig: DevConfig
def publishConfig: Option[PublishConfig]

def run(command: String, arguments: String*): Unit =
def runForCompany(command: String, arguments: String*): Unit =
val args = arguments.toSeq
println(s"Running command: $command with args: $args")
Try(Command.valueOf(command)) match
Expand All @@ -21,7 +23,7 @@ case class DevCompanyCamundalaRunner(
println(s"Command not found: $command")
println("Available commands: " + Command.values.mkString(", "))
end match
end run
end runForCompany

private def runCommand(command: Command, args: Seq[String]): Unit =
command match
Expand All @@ -30,14 +32,11 @@ case class DevCompanyCamundalaRunner(
case Command.publish =>
println("Usage: publish <version>")
case Command.prepareDocs =>
// CompanyDocCreator.prepareDocs()
// DocCreator.prepareDocs()
case Command.releaseDocs =>
// CompanyDocCreator.releaseDocs()
case other =>
println(s"Command not found: $other")
println("Available commands: publish, prepareDocs, releaseDocs")

enum Command:
private enum Command:
case publish, prepareDocs, releaseDocs

private def publish(newVersion: String): Unit =
Expand All @@ -56,4 +55,4 @@ case class DevCompanyCamundalaRunner(
end if
end publish

end DevCompanyCamundalaRunner
end DevCompanyCamundalaHelper
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import camundala.helper.util.{DevConfig, RepoConfig}
import scala.util.{Failure, Success, Try}

// dev-company/helperCompany.scala
object DevCompanyRunner:
object DevCompanyHelper:

def run(command: String, arguments: String*): Unit =
val args = arguments.toSeq
Expand Down Expand Up @@ -49,4 +49,4 @@ object DevCompanyRunner:

private lazy val companyName = os.pwd.last.replace("dev-", "").toLowerCase

end DevCompanyRunner
end DevCompanyHelper
26 changes: 13 additions & 13 deletions 04-helper/src/main/scala/camundala/helper/dev/DevHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ trait DevHelper:
private def runCommand(command: Command, args: Seq[String]): Unit =
command match
case Command.update =>
update
update()
// start code generation
case Command.process =>
args match
Expand Down Expand Up @@ -136,11 +136,11 @@ trait DevHelper:
println(s"Example: $command myProcess My$command 1")
end printBadActivity

enum Command:
private enum Command:
case update, process, customTask, serviceTask, userTask, decision, signalEvent, messageEvent,
timerEvent, publish, deploy, dockerUp, dockerStop, dockerDown

def update: Unit =
def update(): Unit =
println(s"Update Project: ${devConfig.projectName}")
println(s" - with Subprojects: ${devConfig.subProjects}")
SetupGenerator().generate
Expand All @@ -154,50 +154,50 @@ trait DevHelper:
))
end createProcess

def createCustomTask(processName: String, bpmnName: String, version: Option[Int]): Unit =
private def createCustomTask(processName: String, bpmnName: String, version: Option[Int]): Unit =
SetupGenerator().createProcessElement(SetupElement(
"CustomTask",
processName.asProcessName,
bpmnName.asElemName,
version
))

def createServiceTask(processName: String, bpmnName: String, version: Option[Int]): Unit =
private def createServiceTask(processName: String, bpmnName: String, version: Option[Int]): Unit =
SetupGenerator().createProcessElement(SetupElement(
"ServiceTask",
processName.asProcessName,
bpmnName.asElemName,
version
))

def createUserTask(processName: String, bpmnName: String, version: Option[Int]): Unit =
private def createUserTask(processName: String, bpmnName: String, version: Option[Int]): Unit =
SetupGenerator().createUserTask(
SetupElement("UserTask", processName.asProcessName, bpmnName.asElemName, version)
)

def createDecision(processName: String, bpmnName: String, version: Option[Int]): Unit =
private def createDecision(processName: String, bpmnName: String, version: Option[Int]): Unit =
SetupGenerator().createDecision(
SetupElement("Decision", processName.asProcessName, bpmnName.asElemName, version)
)

def createSignalEvent(processName: String, bpmnName: String, version: Option[Int]): Unit =
private def createSignalEvent(processName: String, bpmnName: String, version: Option[Int]): Unit =
SetupGenerator().createEvent(SetupElement(
"Signal",
processName.asProcessName,
bpmnName.asElemName,
version
))

def createMessageEvent(processName: String, bpmnName: String, version: Option[Int]): Unit =
private def createMessageEvent(processName: String, bpmnName: String, version: Option[Int]): Unit =
SetupGenerator().createEvent(SetupElement(
"Message",
processName.asProcessName,
bpmnName.asElemName,
version
))

def createTimerEvent(processName: String, bpmnName: String, version: Option[Int])(using
config: DevConfig
private def createTimerEvent(processName: String, bpmnName: String, version: Option[Int])(using
config: DevConfig
): Unit =
SetupGenerator().createEvent(SetupElement(
"Timer",
Expand All @@ -207,9 +207,9 @@ trait DevHelper:
))

extension (name: String)
def asProcessName: String =
private def asProcessName: String =
name.head.toLower + name.tail
def asElemName: String =
private def asElemName: String =
name.head.toUpper + name.tail
end extension
end DevHelper
14 changes: 7 additions & 7 deletions 05-examples/myCompany/src/docs/devStatistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Goes throw all projects and counts files and lines of code.

File- and Line count for **InitWorkerDsl** files:

- 00-documentation: 0 of 0 Files
- 00-docs: 0 of 0 Files
- 01-domain: 0 of 0 Files
- 02-bpmn: 0 of 0 Files
- 03-api: 92 of 1 Files
Expand All @@ -32,7 +32,7 @@ File- and Line count for **InitWorkerDsl** files:

File- and Line count for **CustomWorkerDsl** files:

- 00-documentation: 0 of 0 Files
- 00-docs: 0 of 0 Files
- 01-domain: 0 of 0 Files
- 02-bpmn: 0 of 0 Files
- 03-api: 92 of 1 Files
Expand All @@ -53,7 +53,7 @@ File- and Line count for **CustomWorkerDsl** files:

File- and Line count for **ServiceWorkerDsl** files:

- 00-documentation: 0 of 0 Files
- 00-docs: 0 of 0 Files
- 01-domain: 0 of 0 Files
- 02-bpmn: 0 of 0 Files
- 03-api: 92 of 1 Files
Expand All @@ -75,7 +75,7 @@ File- and Line count for **ServiceWorkerDsl** files:

File- and Line count for **bpmn** files:

- 00-documentation: 0 of 0 Files
- 00-docs: 0 of 0 Files
- 01-domain: 0 of 0 Files
- 02-bpmn: 0 of 0 Files
- 03-api: 0 of 0 Files
Expand All @@ -96,7 +96,7 @@ File- and Line count for **bpmn** files:

File- and Line count for **dmn** files:

- 00-documentation: 0 of 0 Files
- 00-docs: 0 of 0 Files
- 01-domain: 0 of 0 Files
- 02-bpmn: 0 of 0 Files
- 03-api: 0 of 0 Files
Expand All @@ -117,7 +117,7 @@ File- and Line count for **dmn** files:

File- and Line count for **groovy** files:

- 00-documentation: 0 of 0 Files
- 00-docs: 0 of 0 Files
- 01-domain: 0 of 0 Files
- 02-bpmn: 0 of 0 Files
- 03-api: 0 of 0 Files
Expand All @@ -138,7 +138,7 @@ File- and Line count for **groovy** files:

File- and Line count for **scala** files:

- 00-documentation: 0 of 0 Files
- 00-docs: 0 of 0 Files
- 01-domain: 669 of 7 Files
- 02-bpmn: 2327 of 20 Files
- 03-api: 4250 of 27 Files
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ Just run `amm ./publish-release.sc VERSION`.
We use [mdoc](https://scalameta.org/mdoc/) to verify the documentation
and [laika](https://typelevel.org/Laika/) to generate the htmls.

Run mdoc: `sbt "documentation/mdoc --watch"`
And laika: `sbt documentation/laikaPreview`
Run mdoc: `sbt "docs/mdoc --watch"`
And laika: `sbt docs/laikaPreview`
Check the result in http://localhost:4242
10 changes: 5 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ lazy val root = project
sourcesInBase := false
)
.aggregate(
documentation,
docs,
domain,
bpmn,
api,
Expand All @@ -41,10 +41,10 @@ lazy val root = project
)

// general independent
lazy val documentation =
(project in file("./00-documentation"))
lazy val docs =
(project in file("./00-docs"))
.configure(preventPublication)
.settings(projectSettings("documentation"))
.settings(projectSettings("docs"))
.settings(laikaSettings)
.settings(mdocSettings)
.enablePlugins(LaikaPlugin, MdocPlugin)
Expand Down Expand Up @@ -388,7 +388,7 @@ lazy val exampleDemosC7 = project
)
.dependsOn(bpmn, exampleDemosBpmn, camunda)

// start company documentation example
// start company docs example
import com.typesafe.config.ConfigFactory

import scala.jdk.CollectionConverters.*
Expand Down
2 changes: 1 addition & 1 deletion docs/bpmnDsl.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>BPMN DSL</title>


<meta name="description" content="camundala-documentation"/>
<meta name="description" content="camundala-docs"/>



Expand Down
2 changes: 1 addition & 1 deletion docs/functionalityDsls/apiDoc.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>API Documentation</title>


<meta name="description" content="camundala-documentation"/>
<meta name="description" content="camundala-docs"/>



Expand Down
2 changes: 1 addition & 1 deletion docs/functionalityDsls/dmnTester.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>DMN Tester</title>


<meta name="description" content="camundala-documentation"/>
<meta name="description" content="camundala-docs"/>



Expand Down
2 changes: 1 addition & 1 deletion docs/functionalityDsls/simulation.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>Simulations</title>


<meta name="description" content="camundala-documentation"/>
<meta name="description" content="camundala-docs"/>



Expand Down
2 changes: 1 addition & 1 deletion docs/functionalityDsls/worker.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>Workers</title>


<meta name="description" content="camundala-documentation"/>
<meta name="description" content="camundala-docs"/>



Expand Down
2 changes: 1 addition & 1 deletion docs/generalConcerns.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>General Concerns</title>


<meta name="description" content="camundala-documentation"/>
<meta name="description" content="camundala-docs"/>



Expand Down
2 changes: 1 addition & 1 deletion docs/helper/createProject.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>Create Project</title>


<meta name="description" content="camundala-documentation"/>
<meta name="description" content="camundala-docs"/>



Expand Down
2 changes: 1 addition & 1 deletion docs/helper/development.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>Development</title>


<meta name="description" content="camundala-documentation"/>
<meta name="description" content="camundala-docs"/>



Expand Down
2 changes: 1 addition & 1 deletion docs/helper/initCompany.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>Init Company</title>


<meta name="description" content="camundala-documentation"/>
<meta name="description" content="camundala-docs"/>



Expand Down
2 changes: 1 addition & 1 deletion docs/helper/projectDev.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>Project Development</title>


<meta name="description" content="camundala-documentation"/>
<meta name="description" content="camundala-docs"/>



Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>Intro</title>


<meta name="description" content="camundala-documentation"/>
<meta name="description" content="camundala-docs"/>



Expand Down
2 changes: 1 addition & 1 deletion docs/projectSetup.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>Project Setup</title>


<meta name="description" content="camundala-documentation"/>
<meta name="description" content="camundala-docs"/>



Expand Down
2 changes: 1 addition & 1 deletion docs/specification.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<title>Process & Domain Specification</title>


<meta name="description" content="camundala-documentation"/>
<meta name="description" content="camundala-docs"/>



Expand Down
Loading

0 comments on commit dcff2bd

Please sign in to comment.