mirror of
https://gitee.com/dcren/initializr.git
synced 2025-11-28 17:32:34 +08:00
Fix initial Java migration
This commit fixes several issues with the initial java migration. On MacOS, the name of the temp directory can be `T` and the new tgz API requires a parent folder whose name has at least 3 characters. The Selenium tests require a more precise element to show the advanced section. The integration tests were generation the docs snippet on the wrong accept header.
This commit is contained in:
@@ -67,9 +67,10 @@ class ProjectGenerator {
|
||||
@Autowired
|
||||
ProjectResourceLocator projectResourceLocator = new ProjectResourceLocator()
|
||||
|
||||
@Value('${TMPDIR:.}')
|
||||
@Value('${TMPDIR:.}/initializr')
|
||||
String tmpdir
|
||||
|
||||
private File temporaryDirectory
|
||||
private transient Map<String, List<File>> temporaryFiles = [:]
|
||||
|
||||
/**
|
||||
@@ -126,7 +127,7 @@ class ProjectGenerator {
|
||||
protected File doGenerateProjectStructure(ProjectRequest request) {
|
||||
def model = resolveModel(request)
|
||||
|
||||
def rootDir = File.createTempFile('tmp', '', new File(tmpdir))
|
||||
def rootDir = File.createTempFile('tmp', '', getTemporaryDirectory())
|
||||
addTempFile(rootDir.name, rootDir)
|
||||
rootDir.delete()
|
||||
rootDir.mkdirs()
|
||||
@@ -182,11 +183,19 @@ class ProjectGenerator {
|
||||
* directory and extension
|
||||
*/
|
||||
File createDistributionFile(File dir, String extension) {
|
||||
def download = new File(tmpdir, dir.name + extension)
|
||||
def download = new File(getTemporaryDirectory(), dir.name + extension)
|
||||
addTempFile(dir.name, download)
|
||||
download
|
||||
}
|
||||
|
||||
private File getTemporaryDirectory() {
|
||||
if (!temporaryDirectory) {
|
||||
temporaryDirectory = new File(tmpdir, 'initializr')
|
||||
temporaryDirectory.mkdirs()
|
||||
}
|
||||
temporaryDirectory
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean all the temporary files that are related to this root
|
||||
* directory.
|
||||
|
||||
Reference in New Issue
Block a user