mirror of
https://gitee.com/dcren/initializr.git
synced 2025-11-28 17:32:34 +08:00
Generate .gitignore
This commit improves the generator so that a `.gitignore` is added to every project. The basic content of that file is determined by the build system. If an agent is recognized, specific build tool settings are added as well. This commit adds support for STS, IntelliJ IDEA and NetBeans. Closes gh-131
This commit is contained in:
@@ -221,7 +221,7 @@ class MainController extends AbstractInitializrController {
|
||||
|
||||
new AntBuilder().zip(destfile: download) {
|
||||
zipfileset(dir: dir, includes: wrapperScript, filemode: 755)
|
||||
zipfileset(dir: dir, includes: '**', excludes: wrapperScript)
|
||||
zipfileset(dir: dir, includes: '**,', excludes: wrapperScript, defaultexcludes: 'no')
|
||||
}
|
||||
upload(download, dir, generateFileName(request, 'zip'), 'application/zip')
|
||||
}
|
||||
@@ -238,7 +238,7 @@ class MainController extends AbstractInitializrController {
|
||||
|
||||
new AntBuilder().tar(destfile: download, compression: 'gzip') {
|
||||
zipfileset(dir: dir, includes: wrapperScript, filemode: 755)
|
||||
zipfileset(dir: dir, includes: '**', excludes: wrapperScript)
|
||||
zipfileset(dir: dir, includes: '**', excludes: wrapperScript, defaultexcludes: 'no')
|
||||
}
|
||||
upload(download, dir, generateFileName(request, 'tgz'), 'application/x-compress')
|
||||
}
|
||||
|
||||
@@ -51,7 +51,9 @@ class MainControllerIntegrationTests extends AbstractInitializrControllerIntegra
|
||||
|
||||
@Test
|
||||
void simpleZipProject() {
|
||||
downloadZip('/starter.zip?style=web&style=jpa').isJavaProject().isMavenProject()
|
||||
downloadZip('/starter.zip?style=web&style=jpa').isJavaProject()
|
||||
.hasFile('.gitignore')
|
||||
.isMavenProject()
|
||||
.hasStaticAndTemplatesResources(true).pomAssert()
|
||||
.hasDependenciesCount(3)
|
||||
.hasSpringBootStarterDependency('web')
|
||||
@@ -61,7 +63,9 @@ class MainControllerIntegrationTests extends AbstractInitializrControllerIntegra
|
||||
|
||||
@Test
|
||||
void simpleTgzProject() {
|
||||
downloadTgz('/starter.tgz?style=org.acme:foo').isJavaProject().isMavenProject()
|
||||
downloadTgz('/starter.tgz?style=org.acme:foo').isJavaProject()
|
||||
.hasFile('.gitignore')
|
||||
.isMavenProject()
|
||||
.hasStaticAndTemplatesResources(false).pomAssert()
|
||||
.hasDependenciesCount(2)
|
||||
.hasDependency('org.acme', 'foo', '1.3.5')
|
||||
|
||||
Reference in New Issue
Block a user