1
0

Return zip

This commit is contained in:
2020-09-10 19:03:24 +02:00
parent 883610878a
commit ddf8558578
4 changed files with 19 additions and 5 deletions
+7 -2
View File
@@ -2,17 +2,22 @@ package starter
import starter.utils.ZipOutput
import starter.utils.prettyPrintXml
import starter.utils.sanitizeFilename
class ProjectZip(private val templates: Templates) {
fun createZip(project: Project, inputs: List<Input>, dependencies: List<Dependency>) {
fun createZip(project: Project, inputs: List<Input>, dependencies: List<Dependency>): String {
val pom = templates.pom(dependencies, inputs)
val prettyPom = prettyPrintXml(pom)
ZipOutput(project.name).use {
val name: String
ZipOutput(sanitizeFilename(project.name)).use {
name = it.name
it.write("pom.xml", prettyPom)
}
return name
}
}