@@ -59,12 +59,6 @@ object DottyBuild extends Build {
59
59
// Shorthand for compiling a docs site
60
60
lazy val dottydoc = inputKey[Unit ](" run dottydoc" )
61
61
62
- /** Dottydoc deps */
63
- lazy val dottydocDeps = SettingKey [Seq [ModuleID ]](
64
- " dottydocDeps" ,
65
- " dottydoc dependencies, should be moved to a dottydoc sbt subproject eventually"
66
- )
67
-
68
62
override def settings : Seq [Setting [_]] = {
69
63
super .settings ++ Seq (
70
64
scalaVersion in Global := scalacVersion,
@@ -129,7 +123,7 @@ object DottyBuild extends Build {
129
123
// this is only necessary for compatibility with sbt which currently hardcodes the "dotty" artifact name
130
124
lazy val dotty = project.in(file(" ." )).
131
125
// FIXME: we do not aggregate `bin` because its tests delete jars, thus breaking other tests
132
- aggregate(`dotty-interfaces`, `dotty-library`, `dotty-compiler`, dottySbtBridgeRef,
126
+ aggregate(`dotty-interfaces`, `dotty-library`, `dotty-compiler`, `dotty-doc`, dottySbtBridgeRef,
133
127
`scala-library`, `scala-compiler`, `scala-reflect`, `scalap`).
134
128
dependsOn(`dotty-compiler`).
135
129
dependsOn(`dotty-library`).
@@ -179,6 +173,63 @@ object DottyBuild extends Build {
179
173
).
180
174
settings(publishing)
181
175
176
+ lazy val `dotty-doc` = project.in(file(" doc-tool" )).
177
+ dependsOn(`dotty-compiler`, `dotty-compiler` % " test->test" ).
178
+ settings(sourceStructure).
179
+ settings(
180
+ baseDirectory in (Compile , run) := baseDirectory.value / " .." ,
181
+ baseDirectory in (Test , run) := baseDirectory.value,
182
+
183
+ connectInput in run := true ,
184
+ outputStrategy := Some (StdoutOutput ),
185
+
186
+ javaOptions ++= (javaOptions in `dotty-compiler`).value,
187
+ fork in run := true ,
188
+ fork in Test := true ,
189
+ parallelExecution in Test := false ,
190
+
191
+ genDocs := Def .inputTaskDyn {
192
+ val dottyLib = (packageAll in `dotty-compiler`).value(" dotty-library" )
193
+ val dottyInterfaces = (packageAll in `dotty-compiler`).value(" dotty-interfaces" )
194
+ val otherDeps = (dependencyClasspath in Compile ).value.map(_.data).mkString(" :" )
195
+ val sources =
196
+ (unmanagedSources in (Compile , compile)).value ++
197
+ (unmanagedSources in (`dotty-compiler`, Compile )).value
198
+ val args : Seq [String ] = Seq (
199
+ " -siteroot" , " docs" ,
200
+ " -project" , " Dotty" ,
201
+ " -classpath" , s " $dottyLib: $dottyInterfaces: $otherDeps"
202
+ )
203
+ (runMain in Compile ).toTask(
204
+ s """ dotty.tools.dottydoc.Main ${args.mkString(" " )} ${sources.mkString(" " )}"""
205
+ )
206
+ }.evaluated,
207
+
208
+ dottydoc := Def .inputTaskDyn {
209
+ val args : Seq [String ] = spaceDelimited(" <arg>" ).parsed
210
+ val dottyLib = (packageAll in `dotty-compiler`).value(" dotty-library" )
211
+ val dottyInterfaces = (packageAll in `dotty-compiler`).value(" dotty-interfaces" )
212
+ val otherDeps = (dependencyClasspath in Compile ).value.map(_.data).mkString(" :" )
213
+ val cp : Seq [String ] = Seq (" -classpath" , s " $dottyLib: $dottyInterfaces: $otherDeps" )
214
+ (runMain in Compile ).toTask(s """ dotty.tools.dottydoc.Main ${cp.mkString(" " )} """ + args.mkString(" " ))
215
+ }.evaluated,
216
+
217
+ libraryDependencies ++= Seq (
218
+ " com.novocode" % " junit-interface" % " 0.11" % " test" ,
219
+ " com.vladsch.flexmark" % " flexmark" % " 0.11.1" ,
220
+ " com.vladsch.flexmark" % " flexmark-ext-gfm-tasklist" % " 0.11.1" ,
221
+ " com.vladsch.flexmark" % " flexmark-ext-gfm-tables" % " 0.11.1" ,
222
+ " com.vladsch.flexmark" % " flexmark-ext-autolink" % " 0.11.1" ,
223
+ " com.vladsch.flexmark" % " flexmark-ext-anchorlink" % " 0.11.1" ,
224
+ " com.vladsch.flexmark" % " flexmark-ext-emoji" % " 0.11.1" ,
225
+ " com.vladsch.flexmark" % " flexmark-ext-gfm-strikethrough" % " 0.11.1" ,
226
+ " com.vladsch.flexmark" % " flexmark-ext-yaml-front-matter" % " 0.11.1" ,
227
+ " com.fasterxml.jackson.dataformat" % " jackson-dataformat-yaml" % " 2.8.6" ,
228
+ " nl.big-o" % " liqp" % " 0.6.7"
229
+ )
230
+ ).
231
+ settings(publishing)
232
+
182
233
lazy val `dotty-bot` = project.in(file(" bot" )).
183
234
settings(sourceStructure).
184
235
settings(
@@ -207,15 +258,6 @@ object DottyBuild extends Build {
207
258
// Settings shared between dotty-compiler and dotty-compiler-bootstrapped
208
259
lazy val dottyCompilerSettings = Seq (
209
260
210
- // necessary evil: dottydoc currently needs to be included in the dotty
211
- // project, for sbt integration
212
- unmanagedResourceDirectories in Compile := Seq ((resourceDirectory in Compile ).value),
213
- unmanagedResourceDirectories in Compile += baseDirectory.value / " .." / " doc-tool" / " resources" ,
214
- unmanagedSourceDirectories in Compile := Seq ((scalaSource in Compile ).value),
215
- unmanagedSourceDirectories in Compile += baseDirectory.value / " .." / " doc-tool" / " src" ,
216
- unmanagedSourceDirectories in Test := Seq ((scalaSource in Test ).value),
217
- unmanagedSourceDirectories in Test += baseDirectory.value / " .." / " doc-tool" / " test" ,
218
-
219
261
// set system in/out for repl
220
262
connectInput in run := true ,
221
263
outputStrategy := Some (StdoutOutput ),
@@ -232,25 +274,11 @@ object DottyBuild extends Build {
232
274
// http://stackoverflow.com/questions/10472840/how-to-attach-sources-to-sbt-managed-dependencies-in-scala-ide#answer-11683728
233
275
com.typesafe.sbteclipse.plugin.EclipsePlugin .EclipseKeys .withSource := true ,
234
276
235
- dottydocDeps := Seq (
236
- " com.vladsch.flexmark" % " flexmark" % " 0.11.1" ,
237
- " com.vladsch.flexmark" % " flexmark-ext-gfm-tasklist" % " 0.11.1" ,
238
- " com.vladsch.flexmark" % " flexmark-ext-gfm-tables" % " 0.11.1" ,
239
- " com.vladsch.flexmark" % " flexmark-ext-autolink" % " 0.11.1" ,
240
- " com.vladsch.flexmark" % " flexmark-ext-anchorlink" % " 0.11.1" ,
241
- " com.vladsch.flexmark" % " flexmark-ext-emoji" % " 0.11.1" ,
242
- " com.vladsch.flexmark" % " flexmark-ext-gfm-strikethrough" % " 0.11.1" ,
243
- " com.vladsch.flexmark" % " flexmark-ext-yaml-front-matter" % " 0.11.1" ,
244
- " com.fasterxml.jackson.dataformat" % " jackson-dataformat-yaml" % " 2.8.6" ,
245
- " nl.big-o" % " liqp" % " 0.6.7"
246
- ),
247
-
248
277
// get libraries onboard
249
278
partestDeps := Seq (scalaCompiler,
250
279
" org.scala-lang" % " scala-reflect" % scalacVersion,
251
280
" org.scala-lang" % " scala-library" % scalacVersion % " test" ),
252
281
libraryDependencies ++= partestDeps.value,
253
- libraryDependencies ++= dottydocDeps.value,
254
282
libraryDependencies ++= Seq (" org.scala-lang.modules" %% " scala-xml" % " 1.0.1" ,
255
283
" org.scala-lang.modules" %% " scala-partest" % " 1.0.11" % " test" ,
256
284
" com.novocode" % " junit-interface" % " 0.11" % " test" ,
@@ -271,30 +299,6 @@ object DottyBuild extends Build {
271
299
)
272
300
}.evaluated,
273
301
274
- genDocs := Def .inputTaskDyn {
275
- val dottyLib = packageAll.value(" dotty-library" )
276
- val dottyInterfaces = packageAll.value(" dotty-interfaces" )
277
- val otherDeps = (dependencyClasspath in Compile ).value.map(_.data).mkString(" :" )
278
- val sources = (managedSources in (Compile , compile)).value ++ (unmanagedSources in (Compile , compile)).value
279
- val args : Seq [String ] = Seq (
280
- " -siteroot" , " docs" ,
281
- " -project" , " Dotty" ,
282
- " -classpath" , s " $dottyLib: $dottyInterfaces: $otherDeps"
283
- )
284
- (runMain in Compile ).toTask(
285
- s """ dotty.tools.dottydoc.Main ${args.mkString(" " )} ${sources.mkString(" " )}"""
286
- )
287
- }.evaluated,
288
-
289
- dottydoc := Def .inputTaskDyn {
290
- val args : Seq [String ] = spaceDelimited(" <arg>" ).parsed
291
- val dottyLib = packageAll.value(" dotty-library" )
292
- val dottyInterfaces = packageAll.value(" dotty-interfaces" )
293
- val otherDeps = (dependencyClasspath in Compile ).value.map(_.data).mkString(" :" )
294
- val cp : Seq [String ] = Seq (" -classpath" , s " $dottyLib: $dottyInterfaces: $otherDeps" )
295
- (runMain in Compile ).toTask(s """ dotty.tools.dottydoc.Main ${cp.mkString(" " )} """ + args.mkString(" " ))
296
- }.evaluated,
297
-
298
302
// Override run to be able to run compiled classfiles
299
303
dotr := {
300
304
val args : Seq [String ] = spaceDelimited(" <arg>" ).parsed
0 commit comments