Add gitignore template
This commit is contained in:
parent
92430510b6
commit
82214d327a
@ -3,10 +3,7 @@ package starter
|
|||||||
import org.koin.core.context.startKoin
|
import org.koin.core.context.startKoin
|
||||||
import org.koin.dsl.bind
|
import org.koin.dsl.bind
|
||||||
import org.koin.dsl.module
|
import org.koin.dsl.module
|
||||||
import starter.templates.LogbackTemplate
|
import starter.templates.*
|
||||||
import starter.templates.MainTemplate
|
|
||||||
import starter.templates.PomTemplate
|
|
||||||
import starter.templates.Template
|
|
||||||
|
|
||||||
val mainModule = module {
|
val mainModule = module {
|
||||||
single { Config().load() }
|
single { Config().load() }
|
||||||
@ -20,6 +17,7 @@ val templateModule = module {
|
|||||||
single { PomTemplate(get()) } bind Template::class
|
single { PomTemplate(get()) } bind Template::class
|
||||||
single { MainTemplate(get()) } bind Template::class
|
single { MainTemplate(get()) } bind Template::class
|
||||||
single { LogbackTemplate(get()) } bind Template::class
|
single { LogbackTemplate(get()) } bind Template::class
|
||||||
|
single { GitignoreTemplate(get()) } bind Template::class
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
|
|||||||
@ -9,7 +9,7 @@ class PebbleModule {
|
|||||||
loader.suffix = ".twig"
|
loader.suffix = ".twig"
|
||||||
return PebbleEngine.Builder()
|
return PebbleEngine.Builder()
|
||||||
.loader(loader)
|
.loader(loader)
|
||||||
.cacheActive(false)
|
.cacheActive(true)
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
src/main/kotlin/starter/templates/GitignoreTemplate.kt
Normal file
13
src/main/kotlin/starter/templates/GitignoreTemplate.kt
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package starter.templates
|
||||||
|
|
||||||
|
import com.mitchellbosecke.pebble.PebbleEngine
|
||||||
|
import starter.Project
|
||||||
|
import starter.utils.render
|
||||||
|
|
||||||
|
class GitignoreTemplate(private val engine: PebbleEngine) : Template {
|
||||||
|
override fun path(project: Project) =
|
||||||
|
".gitignore"
|
||||||
|
|
||||||
|
override fun render(project: Project) =
|
||||||
|
engine.render("starter/gitignore/index")
|
||||||
|
}
|
||||||
5
src/main/resources/starter/gitignore/index.twig
Normal file
5
src/main/resources/starter/gitignore/index.twig
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
target/
|
||||||
|
.idea/
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
*.iws
|
||||||
@ -9,6 +9,7 @@
|
|||||||
<goal>shade</goal>
|
<goal>shade</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
<minimizeJar>true</minimizeJar>
|
<minimizeJar>true</minimizeJar>
|
||||||
<transformers>
|
<transformers>
|
||||||
<transformer
|
<transformer
|
||||||
@ -19,4 +20,4 @@
|
|||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user