04-helper
CompanyDevHelper
With the CompanyDevHelper
you can customize the development process for each project.
case class CompanyDevHelper(projectName: String, subProjects: Seq[String] = Seq.empty)
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
CompanyDevConfig
The CompanyDevConfig
is a helper to create the DevConfig
for the CompanyDevHelper
.
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
:
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
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:
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
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.