-
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.
- Loading branch information
Showing
15 changed files
with
271 additions
and
80 deletions.
There are no files selected for viewing
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,21 +1,113 @@ | ||
# 04-helper | ||
|
||
### CompanyDevHelper | ||
With the `CompanyDevHelper` you can customize _Camundala_ for your Company: | ||
|
||
```scala mdoc | ||
import camundala.api.* | ||
import camundala.helper.dev.DevHelper | ||
import camundala.helper.util.* | ||
## CompanyDevHelper | ||
With the `CompanyDevHelper` you can customize the development process for each project. | ||
|
||
```scala | ||
case class CompanyDevHelper(projectName: String, subProjects: Seq[String] = Seq.empty) | ||
extends DevHelper: | ||
extends DevHelper: | ||
|
||
lazy val apiConfig: ApiConfig = CompanyApiCreator.apiConfig | ||
lazy val devConfig: DevConfig = CompanyDevConfig.config(projectName, subProjects) | ||
|
||
end CompanyDevHelper | ||
``` | ||
### ApiConfig | ||
Taken from `CompanyApiCreator.apiConfig`, see [CompanyApiCreator] | ||
|
||
### DevConfig | ||
Taken from `CompanyApiCreator.apiConfig`, see [CompanyDevConfig] | ||
|
||
lazy val apiConfig: ApiConfig = ApiConfig("mycompany")//.withTenantId("mycompany")... | ||
## CompanyDevConfig | ||
The `CompanyDevConfig` is a helper to create the `DevConfig` for the `CompanyDevHelper`. | ||
|
||
```scala | ||
object CompanyDevConfig: | ||
def config( | ||
projectName: String, | ||
subProjects: Seq[String] = Seq.empty | ||
) = DevConfig( | ||
projectName, | ||
subProjects, | ||
camundala.api.defaultProjectConfigPath | ||
).withVersionConfig(companyVersionConfig) | ||
// .withSbtConfig(SbtConfig(...)) | ||
// .withPublishConfig(PublishConfig(...)) | ||
// .withPostmanConfig(PostmanConfig(...)) | ||
// .withDockerConfig(DockerConfig(...)) | ||
|
||
private lazy val companyVersionConfig = VersionConfig( | ||
scalaVersion = BuildInfo.scalaVersion, | ||
camundalaVersion = BuildInfo.camundalaV, | ||
companyCamundalaVersion = BuildInfo.version, | ||
sbtVersion = BuildInfo.sbtVersion, | ||
otherVersions = Map() | ||
) | ||
end CompanyDevConfig | ||
``` | ||
Here the default values for `DevConfig`: | ||
```scala | ||
case class DevConfig( | ||
// project configuration taken from the PROJECT.conf | ||
apiProjectConf: ApiProjectConf, | ||
// subProjects to optimize compilation time - use only for big projects | ||
subProjects: Seq[String] = Seq.empty, | ||
// additional sbt configuration for sbt generation | ||
sbtConfig: SbtConfig = SbtConfig(), | ||
// versions used for generators | ||
versionConfig: VersionConfig = VersionConfig(), | ||
// If you have a Postman account, add the config here (used for ./helper.scala deploy..) | ||
postmanConfig: Option[PostmanConfig] = None, | ||
// Adjust the DockerConfig (used for ./helper.scala deploy../ docker..) | ||
dockerConfig: DockerConfig = DockerConfig(), | ||
// If you have a webdav server to publish the docs, add the config here (used in ./helper.scala publish..) | ||
publishConfig: Option[PublishConfig] = None, | ||
// general project structure - do not change if possible | ||
modules: Seq[ModuleConfig] = DevConfig.modules | ||
) | ||
``` | ||
### defaultProjectConfigPath | ||
|
||
lazy val deployConfig: Option[DeployConfig] = ??? | ||
lazy val devConfig: DevConfig = ??? | ||
lazy val dockerConfig: DockerConfig = ??? | ||
lazy val publishConfig: Option[PublishConfig] = ??? | ||
At the moment we use a configuration file for each project. **This may change in the future.** | ||
The default path is `projectBasePath / PROJECT.conf` and is generated by `./helper.scala update` in the project. | ||
|
||
Example: | ||
```scala | ||
org = "mycompany" | ||
name = "mycompany-accounting" | ||
version = "1.25.0-SNAPSHOT" | ||
dependencies: { | ||
"mycompany-helper": "mycompany:mycompany-helper:1.4.*" | ||
"mycompany-services": "mycompany:mycompany-services:1.7.*" | ||
"mycompany-crm": "mycompany:mycompany-crm:2.28.*" | ||
} | ||
``` | ||
|
||
## CompanyCamundalaDevHelper | ||
The `CompanyCamundalaDevHelper` is a helper dedicated for the `company-camundala` project. | ||
|
||
See [Development] | ||
|
||
```scala | ||
object CompanyCamundalaDevHelper | ||
extends DevCompanyCamundalaHelper: | ||
|
||
lazy val apiConfig: ApiConfig = CompanyApiCreator.apiConfig | ||
.copy( | ||
basePath = os.pwd /"00-docs", | ||
tempGitDir = os.pwd / os.up / "git-temp" | ||
) | ||
|
||
lazy val devConfig: DevConfig = CompanyDevConfig.config(BuildInfo.name, Seq.empty) | ||
|
||
end CompanyCamundalaDevHelper | ||
``` | ||
|
||
### apiConfig | ||
The `apiConfig` is taken from `CompanyApiCreator.apiConfig` and can be customized. | ||
The `basePath` and the `tempGitDir` must be adjusted, as `company-camundala` | ||
has a different file structure, compared to a project. | ||
|
||
### devConfig | ||
Here your `DevConfig` defined in the `CompanyDevConfig.config` method, should work. | ||
The only adjustments are the `projectName` and that no `subProjects` are needed. |
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
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.