-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Company Wrappers for all modules in CompanyWrapperGenerator / a…
…dded mdoc for Version resolving in code.
- Loading branch information
Showing
29 changed files
with
1,042 additions
and
97 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ | |
laika.navigationOrder = [ | ||
development.md | ||
initCompany.md | ||
createProject.md | ||
projectDev.md | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
# Project Development | ||
**Experimental** | ||
|
||
TODO | ||
The following chapters describe the tasks to support the project development. | ||
|
||
## update | ||
Whenever you have changes in the `company-camundala` project or in one of your dependencies, | ||
you can update the project with the following command: | ||
|
||
```bash | ||
./helper.scala update | ||
``` | ||
|
||
This will create or update your project with the latest changes. | ||
|
||
Files that contain the `DO NOT ADJUST` comment will be replaced. | ||
If you do adjust them, remove this comment. | ||
You will get a warning, but the file will not be replaced. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
157 changes: 138 additions & 19 deletions
157
04-helper/src/main/scala/camundala/helper/dev/company/CompanyWrapperGenerator.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,154 @@ | ||
package camundala.helper.dev.company | ||
|
||
import camundala.helper.dev.update.createOrUpdate | ||
import camundala.helper.dev.update.createIfNotExists | ||
import camundala.helper.util.* | ||
|
||
case class CompanyWrapperGenerator()(using config: DevConfig): | ||
|
||
lazy val generate: Unit = | ||
createOrUpdate(projectDevPath, helperConfig) | ||
createIfNotExists(projectBpmnPath, bpmnWrapper) | ||
createIfNotExists(projectApiPath, apiWrapper) | ||
createIfNotExists(projectDmnPath, dmnWrapper) | ||
createIfNotExists(projectSimulationPath, simulationWrapper) | ||
createIfNotExists(projectWorkerPath, workerWrapper) | ||
createIfNotExists(projectHelperPath, helperWrapper) | ||
|
||
private lazy val companyName = config.companyName | ||
private lazy val helperPath = | ||
config.projectDir / ModuleConfig.helperModule.packagePath(config.projectPath) | ||
private lazy val projectDevPath = helperPath / "CompanyDevHelper.scala" | ||
|
||
private lazy val helperConfig = | ||
objectContent("CompanyDevHelper"): | ||
s""" | ||
| def config(projectName: String, subProjects: Seq[String] = Seq.empty): DevConfig = | ||
| DevConfig.defaultConfig(projectName) //TODO Implement your Config! | ||
| .copy(subProjects = subProjects) | ||
|""".stripMargin | ||
end helperConfig | ||
|
||
private def objectContent(objName: String)(body: String) = | ||
|
||
private lazy val projectBpmnPath = ModuleConfig.bpmnModule.srcPath / "CompanyBpmnDsl.scala" | ||
private lazy val projectApiPath = ModuleConfig.apiModule.srcPath / "CompanyApiCreator.scala" | ||
private lazy val projectDmnPath = ModuleConfig.dmnModule.srcPath / "CompanyDmnTester.scala" | ||
private lazy val projectSimulationPath = ModuleConfig.simulationModule.testPath / "CompanySimulation.scala" | ||
private lazy val projectWorkerPath = ModuleConfig.workerModule.srcPath / "CompanyWorkerHandler.scala" | ||
private lazy val projectHelperPath = ModuleConfig.helperModule.srcPath / "CompanyDevHelper.scala" | ||
|
||
private lazy val bpmnWrapper = | ||
s"""package $companyName.camundala.bpmn | ||
| | ||
|import camundala.bpmn.* | ||
|import camundala.domain.* | ||
| | ||
|/** | ||
| * Add here company specific stuff, like documentation or custom elements. | ||
| */ | ||
|trait CompanyBpmnDsl | ||
| | ||
|trait CompanyBpmnProcessDsl extends BpmnProcessDsl, CompanyBpmnDsl | ||
|trait CompanyBpmnServiceTaskDsl extends BpmnServiceTaskDsl, CompanyBpmnDsl | ||
|trait CompanyBpmnCustomTaskDsl extends BpmnCustomTaskDsl, CompanyBpmnDsl | ||
|trait CompanyBpmnDecisionDsl extends BpmnDecisionDsl, CompanyBpmnDsl | ||
|trait CompanyBpmnUserTaskDsl extends BpmnUserTaskDsl, CompanyBpmnDsl | ||
|trait CompanyBpmnMessageEventDsl extends BpmnMessageEventDsl, CompanyBpmnDsl | ||
|trait CompanyBpmnSignalEventDsl extends BpmnSignalEventDsl, CompanyBpmnDsl | ||
|trait CompanyBpmnTimerEventDsl extends BpmnTimerEventDsl, CompanyBpmnDsl | ||
|""".stripMargin | ||
|
||
private lazy val apiWrapper = | ||
s"""package $companyName.camundala.api | ||
| | ||
|import camundala.api.* | ||
| | ||
|/** | ||
| * Add here company specific stuff, to create the Api documentation and the Postman collection. | ||
| */ | ||
|trait CompanyApiCreator extends ApiCreator, ApiDsl, CamundaPostmanApiCreator: | ||
| | ||
| // override the config if needed | ||
| //override protected def apiConfig: ApiConfig = ??? | ||
| | ||
| lazy val companyDescr = ??? //TODO Add your Company Description! | ||
|""".stripMargin | ||
|
||
private lazy val dmnWrapper = | ||
s"""package $companyName.camundala.dmn | ||
| | ||
|import camundala.dmn.* | ||
| | ||
|/** | ||
| * Add here company specific stuff, to run the DMN Tester. | ||
| */ | ||
|trait CompanyDmnTester extends DmnTesterConfigCreator, DmnTesterStarter: | ||
| | ||
| def starterConfig: DmnTesterStarterConfig = | ||
| DmnTesterStarterConfig( // adjust paths if needed | ||
| companyName = "$companyName", | ||
| ) | ||
|""".stripMargin | ||
|
||
private lazy val simulationWrapper = | ||
s"""package $companyName.camundala.simulation | ||
| | ||
|import camundala.simulation.custom.* | ||
| | ||
|/** | ||
| * Add here company specific stuff, to run the Simulations. | ||
| */ | ||
|trait CompanySimulation extends BasicSimulationDsl: | ||
| | ||
| override implicit def config = | ||
| super.config //TODO Adjust config if needed | ||
|""".stripMargin | ||
|
||
private lazy val workerWrapper = | ||
s"""package $companyName.camundala.worker | ||
| | ||
|import camundala.camunda7.worker.C7WorkerHandler | ||
|import camundala.worker.* | ||
| | ||
|import scala.reflect.ClassTag | ||
| | ||
|/** | ||
| * Add here company specific stuff, to run the Workers. | ||
| * You also define the implementation of the WorkerHandler here. | ||
| */ | ||
|trait CompanyWorkerHandler extends C7WorkerHandler | ||
| | ||
|trait CompanyInitWorkerDsl[ | ||
| In <: Product: InOutCodec, | ||
| Out <: Product: InOutCodec, | ||
| InitIn <: Product: InOutCodec, | ||
| InConfig <: Product: InOutCodec | ||
|] extends CompanyWorkerHandler, InitWorkerDsl[In, Out, InitIn, InConfig] | ||
| | ||
|trait CompanyValidationWorkerDsl[ | ||
| In <: Product: InOutCodec | ||
|] extends CompanyWorkerHandler, ValidationWorkerDsl[In] | ||
| | ||
|trait CompanyCustomWorkerDsl[ | ||
| In <: Product: InOutCodec, | ||
| Out <: Product: InOutCodec | ||
|] extends CompanyWorkerHandler, CustomWorkerDsl[In, Out] | ||
| | ||
|trait CompanyServiceWorkerDsl[ | ||
| In <: Product: InOutCodec, | ||
| Out <: Product: InOutCodec, | ||
| ServiceIn: InOutEncoder, | ||
| ServiceOut: InOutDecoder: ClassTag | ||
|] extends CompanyWorkerHandler, ServiceWorkerDsl[In, Out, ServiceIn, ServiceOut] | ||
|""".stripMargin | ||
|
||
private lazy val helperWrapper = | ||
s"""package $companyName.camundala.helper | ||
| | ||
|import camundala.helper.dev.* | ||
|import camundala.helper.util.* | ||
| | ||
|object $objName: | ||
|object CompanyDevHelper: | ||
| | ||
|$body | ||
|end $objName""".stripMargin | ||
| def config(projectName: String, subProjects: Seq[String] = Seq.empty): DevConfig = | ||
| DevConfig.defaultConfig(projectName) //TODO Implement your Config! | ||
| .copy(subProjects = subProjects) | ||
|""".stripMargin | ||
end helperWrapper | ||
|
||
extension (module: ModuleConfig) | ||
def srcPath: os.Path = | ||
config.projectDir / module.packagePath( | ||
config.projectPath | ||
) | ||
def testPath: os.Path = | ||
config.projectDir / module.packagePath( | ||
config.projectPath, | ||
mainOrTest = "test" | ||
) | ||
end CompanyWrapperGenerator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.