Anders Kirkeby
08/24/2023, 6:41 AMfun generate() {
project {
internalBuildTypes.forEach {
buildType(it)
}
}
}
I get an error Project builder is not provided
which I cannot get to the bottom off. Anyone have some pointer? Be happy to provide more code if needed!Anders Kirkeby
08/24/2023, 7:12 AMantonarhipov
08/24/2023, 8:31 AMantonarhipov
08/24/2023, 8:36 AMobject X: Project
, instead of project {}
?antonarhipov
08/24/2023, 8:37 AMAnders Kirkeby
08/24/2023, 8:38 AMprivate val project: Project
variable in my PipelineBuilder
and appending the buildTypes onto that, I opted to use the same setup as the TeamCity dsl uses internally, by storing the buildTypes in the PipelineBuilder
and then providing the projectbuilder directly in the ProjectBuilder#generate
method above
fun generate(): Project {
return Project {
parameters.forEach { params.add(it) }
this@PipelineBuilder.buildTypes.forEach(::buildType)
}
}
This seems to work so I'll leave it at that for now, but if some of the devs stumble upon this I'll be happy to provide more 😅
Thanks for some pointers @antonarhipov 🎉 Gotta say that having the option to build an internal DSL for teamcity stuff is pretty cool though 😅antonarhipov
08/24/2023, 8:42 AMproject {}
cannot be used in tests because of the required builder. Makes sense to document it though.Anders Kirkeby
08/24/2023, 8:45 AMAnders Kirkeby
08/24/2023, 8:46 AMProject {}
and the project {}
builders 🤪antonarhipov
08/24/2023, 8:46 AMAnders Kirkeby
08/24/2023, 8:47 AM