@@ -21,7 +21,8 @@ object CodeGen {
21
21
supportDest : os.Path ,
22
22
millTopLevelProjectRoot : os.Path ,
23
23
output : os.Path ,
24
- parser : MillScalaParser
24
+ parser : MillScalaParser ,
25
+ headerData : String
25
26
): Unit = {
26
27
val scriptSources = allScriptCode.keys.toSeq.sorted
27
28
for (scriptPath <- scriptSources) breakable {
@@ -104,7 +105,8 @@ object CodeGen {
104
105
scriptFolderPath = scriptFolderPath,
105
106
segments = segments,
106
107
millTopLevelProjectRoot = millTopLevelProjectRoot,
107
- output = output
108
+ output = output,
109
+ headerData = headerData
108
110
)
109
111
110
112
os.write(supportDestDir / " MillMiscInfo.scala" , miscInfo, createFolders = true )
@@ -160,15 +162,17 @@ object CodeGen {
160
162
scriptFolderPath : os.Path ,
161
163
segments : Seq [String ],
162
164
millTopLevelProjectRoot : os.Path ,
163
- output : os.Path
165
+ output : os.Path ,
166
+ headerData : String
164
167
): String = {
165
168
val header = if (pkg.isBlank()) " " else s " package $pkg"
166
169
val body =
167
170
if (segments.nonEmpty) subfolderMiscInfo(scriptFolderPath, segments)
168
171
else rootMiscInfo(
169
172
scriptFolderPath,
170
173
millTopLevelProjectRoot,
171
- output
174
+ output,
175
+ headerData
172
176
)
173
177
174
178
s """ | $generatedFileHeader
@@ -321,14 +325,17 @@ object CodeGen {
321
325
def rootMiscInfo (
322
326
scriptFolderPath : os.Path ,
323
327
millTopLevelProjectRoot : os.Path ,
324
- output : os.Path
328
+ output : os.Path ,
329
+ headerData : String
325
330
): String = {
331
+ val headerJson = ujson.Obj .from(mill.internal.Util .parseHeaderData(headerData)).render()
326
332
s """ |@_root_.scala.annotation.nowarn
327
333
|object MillMiscInfo
328
334
| extends mill.api.internal.RootModule.Info(
329
335
| projectRoot0 = ${literalize(scriptFolderPath.toString)},
330
336
| output0 = ${literalize(output.toString)},
331
- | topLevelProjectRoot0 = ${literalize(millTopLevelProjectRoot.toString)}
337
+ | topLevelProjectRoot0 = ${literalize(millTopLevelProjectRoot.toString)},
338
+ | headerData = ${literalize(headerJson)}
332
339
|)
333
340
| """ .stripMargin
334
341
}
0 commit comments