@@ -35,6 +35,7 @@ import FileSystem
35
35
import FileSystem.Path as Path exposing (Path)
36
36
import Compiler.PackageName as PackageName exposing (PackageName)
37
37
import Compiler.Platform as Platform exposing (Platform)
38
+ import Compiler.Outline as Outline exposing (Outline)
38
39
import SemanticVersion exposing (SemanticVersion)
39
40
import ChildProcess exposing (Shell(..))
40
41
import Json.Encode as Json
@@ -186,7 +187,7 @@ isCached permission platform envVars homeDir =
186
187
type Command
187
188
= Init InitFlags
188
189
| Repl ReplFlags
189
- | Make { flags : MakeFlags, paths : (Array Path) }
190
+ | Make MakeFlags
190
191
| Docs DocsFlags
191
192
| PackageInstall (Maybe PackageName)
192
193
| PackageUninstall PackageName
@@ -215,6 +216,11 @@ type alias MakeFlags =
215
216
, sourcemaps : Bool
216
217
, output : Maybe MakeOutput
217
218
, report : Maybe {}
219
+ , projectPath : Path
220
+ , entryPoints : Array Path
221
+ , outline : Outline
222
+ , rootSources : Dict String String
223
+ , dependencies : Dict String { outline : Outline, sources : Dict String String }
218
224
}
219
225
220
226
@@ -307,14 +313,26 @@ commandEncoder interactive pathToString command =
307
313
, { key = "intepreter" , value = maybeEncoder Json.string flags.interpreter }
308
314
]
309
315
310
- Make { flags, paths } ->
316
+ Make flags ->
317
+ let
318
+ depsToJson : { outline : Outline, sources : Dict String String } -> Json.Value
319
+ depsToJson dep =
320
+ Json.object
321
+ [ { key = "outline", value = Outline.toJson dep.outline }
322
+ , { key = "sources", value = Json.dict identity Json.string dep.sources }
323
+ ]
324
+ in
311
325
Json.object
312
326
[ { key = "command", value = Json.string "make" }
313
327
, { key = "optimize", value = Json.bool flags.optimize }
314
328
, { key = "sourcemaps", value = Json.bool flags.sourcemaps }
315
329
, { key = "output", value = maybeEncoder makeOutputEncoder flags.output }
316
330
, { key = "report-json", value = maybeToBool flags.report }
317
- , { key = "paths", value = Json.array (pathToString >> Json.string) paths }
331
+ , { key = "project-path", value = Json.string <| pathToString flags.projectPath }
332
+ , { key = "entry-points", value = Json.array (Json.string << pathToString) flags.entryPoints }
333
+ , { key = "project-outline", value = Outline.toJson flags.outline }
334
+ , { key = "sources", value = Json.dict identity Json.string flags.rootSources }
335
+ , { key = "dependencies", value = Json.dict identity depsToJson flags.dependencies }
318
336
]
319
337
320
338
Docs flags ->
0 commit comments