@@ -2,16 +2,13 @@ package dotty.tools
2
2
package dottydoc
3
3
package staticsite
4
4
5
- import java .nio .file .{ Files , FileSystems }
5
+ import java .nio .file .{ Paths , Files , FileSystems }
6
6
import java .nio .file .StandardCopyOption .REPLACE_EXISTING
7
7
import java .io .{ File => JFile , OutputStreamWriter , BufferedWriter , ByteArrayInputStream }
8
8
import java .util .{ List => JList , Map => JMap , Arrays }
9
9
import java .nio .file .Path
10
10
import java .nio .charset .StandardCharsets
11
- import java .util .Calendar
12
- import java .text .SimpleDateFormat
13
- import java .io .PrintWriter
14
-
11
+ import java .time .LocalDateTime
15
12
16
13
import com .vladsch .flexmark .parser .ParserEmulationProfile
17
14
import com .vladsch .flexmark .parser .Parser
@@ -316,14 +313,12 @@ case class Site(val root: JFile, val projectTitle: String, val documentation: Ma
316
313
*/
317
314
val layouts : Map [String , Layout ] = {
318
315
319
- val cal = Calendar .getInstance()
320
- val today = cal.getTime()
321
- val currentHour = new SimpleDateFormat (" hh" ).format(today)
322
- val currentMinute = new SimpleDateFormat (" mm" ).format(today)
323
- val amOrPm = new SimpleDateFormat (" a" ).format(today)
324
- val x = " <!-- generated on " + cal.get(Calendar .DATE ) + " /" + (cal.get(Calendar .MONTH )+ 1 )+ " /" + cal.get(Calendar .YEAR ) + " " + currentHour + " :" + currentMinute + " :" + amOrPm + " -->"
316
+ val currentTime = LocalDateTime .now();
317
+ val x = " <!-- generated on " + currentTime.getDayOfMonth() + " /" + currentTime.getMonthValue()+ " /" + currentTime.getYear() + " " + currentTime.getHour() + " :" + currentTime.getMinute() + " :" + currentTime.getSecond() + " -->"
325
318
var loc = root.getAbsolutePath.toString + " /.." + " /doc-tool/resources/_layouts/main.html"
326
- scala.tools.nsc.io.File (loc).appendAll(x)
319
+ if (Files .exists(Paths .get(loc))) {
320
+ dotty.tools.io.File (loc).appendAll(x)
321
+ }
327
322
328
323
val userDefinedLayouts =
329
324
root
0 commit comments