Skip to content

Commit 26cb28c

Browse files
committed
feat: print the extracted template file on the screen and fix template build error
1 parent 4223f64 commit 26cb28c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

app/src/main/kotlin/com/teixeira/gdx/writer/ProjectWriter.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class ProjectWriter(
3838
}
3939

4040
resourceStream.use { inputStream ->
41-
sendMessage("Creating project...")
41+
sendMessage("Extracting project template ...")
4242

4343
val buffer = ByteArray(1024)
4444
val zis = ZipInputStream(inputStream)
@@ -53,8 +53,10 @@ class ProjectWriter(
5353
val file = File(projectDir, name)
5454

5555
if (entry.isDirectory) {
56+
sendMessage("Creating dir: ${file.canonicalPath}")
5657
file.mkdirs()
5758
} else {
59+
sendMessage("Extracting file: ${file.canonicalPath}")
5860
file.parentFile?.mkdirs()
5961

6062
if (file.extension.matches(SOURCE_FILES_REGEX)) {
@@ -77,12 +79,15 @@ class ProjectWriter(
7779
}
7880
}
7981

82+
zis.closeEntry()
8083
entry = zis.nextEntry
8184
}
8285
zis.closeEntry()
8386
zis.close()
8487

8588
unzipGradleWrapper(projectDir, sendMessage)
89+
90+
sendMessage("Project created in: ${projectDir.canonicalPath}")
8691
}
8792
}
8893

@@ -110,12 +115,13 @@ class ProjectWriter(
110115
fos.write(buffer, 0, len)
111116
}
112117
}
113-
118+
zis.closeEntry()
114119
entry = zis.nextEntry
115120
}
116121
zis.closeEntry()
117122
zis.close()
123+
124+
sendMessage("Gradle Wrapper extracted.")
118125
}
119-
sendMessage("Project created.")
120126
}
121127
}
711 Bytes
Binary file not shown.
709 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)