@@ -51,7 +51,7 @@ object DottyIDEPlugin extends AutoPlugin {
51
51
val extracted = Project .extract(state)
52
52
val settings = extracted.structure.data
53
53
54
- if (projRefs.forall(projRef => scalaVersion.in (projRef).get(settings).get == newScalaVersion))
54
+ if (projRefs.forall(projRef => (projRef / scalaVersion ).get(settings).get == newScalaVersion))
55
55
state
56
56
else {
57
57
def matchingSetting (setting : Setting [_]) =
@@ -60,7 +60,7 @@ object DottyIDEPlugin extends AutoPlugin {
60
60
61
61
val newSettings = extracted.session.mergeSettings.collect {
62
62
case setting if matchingSetting(setting) =>
63
- scalaVersion in setting.key.scope := newScalaVersion
63
+ setting.key.scope / scalaVersion := newScalaVersion
64
64
}
65
65
val newSession = extracted.session.appendRaw(newSettings)
66
66
BuiltinCommands .reapply(newSession, extracted.structure, state)
@@ -82,14 +82,14 @@ object DottyIDEPlugin extends AutoPlugin {
82
82
83
83
val (dottyVersions, dottyProjRefs) =
84
84
structure.allProjectRefs.flatMap { projRef =>
85
- if (excludeFromIDE.in (projRef).get(settings) == Some (true ))
85
+ if ((projRef / excludeFromIDE ).get(settings) == Some (true ))
86
86
None
87
87
else {
88
- val version = scalaVersion.in (projRef).get(settings).get
88
+ val version = (projRef / scalaVersion ).get(settings).get
89
89
if (isDottyVersion(version))
90
90
Some ((version, projRef))
91
91
else
92
- crossScalaVersions.in (projRef).get(settings).get.filter(isDottyVersion).sorted.lastOption match {
92
+ (projRef / crossScalaVersions ).get(settings).get.filter(isDottyVersion).sorted.lastOption match {
93
93
case Some (v) =>
94
94
Some ((v, projRef))
95
95
case _ =>
@@ -134,11 +134,11 @@ object DottyIDEPlugin extends AutoPlugin {
134
134
val joinedTask = projRefs.flatMap { projRef =>
135
135
val project = Project .getProjectForReference(projRef, structure).get
136
136
project.configurations.flatMap { config =>
137
- excludeFromIDE.in (projRef, config).get(settings) match {
137
+ (projRef / config / excludeFromIDE ).get(settings) match {
138
138
case Some (true ) =>
139
139
None // skip this configuration
140
140
case _ =>
141
- key.in (projRef, config).get(settings)
141
+ (projRef / config / key ).get(settings)
142
142
}
143
143
}
144
144
}.join
@@ -288,7 +288,7 @@ object DottyIDEPlugin extends AutoPlugin {
288
288
private def makeId (name : String , config : String ): String = s " $name/ $config"
289
289
290
290
private def projectConfigTask (config : Configuration ): Initialize [Task [Option [ProjectConfig ]]] = Def .taskDyn {
291
- val depClasspath = Attributed .data((dependencyClasspath in config ).value)
291
+ val depClasspath = Attributed .data((config / dependencyClasspath ).value)
292
292
val projectName = name.value
293
293
294
294
// Try to detect if this is a real Scala project or not. This is pretty
@@ -314,14 +314,14 @@ object DottyIDEPlugin extends AutoPlugin {
314
314
// Not needed to generate the config, but this guarantees that the
315
315
// generated config is usable by an IDE without any extra compilation
316
316
// step.
317
- val _ = (compile in config ).value
317
+ val _ = (config / compile ).value
318
318
319
319
val project = thisProject.value
320
320
val id = makeId(project.id, config.name)
321
- val compilerVersion = (scalaVersion in config ).value
322
- val compilerArguments = (scalacOptions in config ).value
323
- val sourceDirectories = (unmanagedSourceDirectories in config ).value ++ (managedSourceDirectories in config ).value
324
- val classDir = (classDirectory in config ).value
321
+ val compilerVersion = (config / scalaVersion ).value
322
+ val compilerArguments = (config / scalacOptions ).value
323
+ val sourceDirectories = (config / unmanagedSourceDirectories ).value ++ (config / managedSourceDirectories ).value
324
+ val classDir = (config / classDirectory ).value
325
325
val extracted = Project .extract(state.value)
326
326
val settings = extracted.structure.data
327
327
@@ -331,7 +331,7 @@ object DottyIDEPlugin extends AutoPlugin {
331
331
// We filter out dependencies that do not compile using Dotty
332
332
val classpathProjectDependencies =
333
333
project.dependencies.filter { d =>
334
- val version = scalaVersion.in (d.project).get(settings).get
334
+ val version = (d.project / scalaVersion ).get(settings).get
335
335
isDottyVersion(version)
336
336
}.map(d => projectDependencyName(d, config, project, logger))
337
337
val configDependencies =
@@ -361,8 +361,8 @@ object DottyIDEPlugin extends AutoPlugin {
361
361
// TODO: It would be better to use Def.derive to define projectConfig in
362
362
// every configuration where the keys it depends on exist, however this
363
363
// currently breaks aggregated tasks: https://github.com/sbt/sbt/issues/3580
364
- projectConfig in Compile := projectConfigTask(Compile ).value,
365
- projectConfig in Test := projectConfigTask(Test ).value
364
+ Compile / projectConfig := projectConfigTask(Compile ).value,
365
+ Test / projectConfig := projectConfigTask(Test ).value
366
366
)
367
367
368
368
override def buildSettings : Seq [Setting [_]] = Seq (
@@ -432,7 +432,7 @@ object DottyIDEPlugin extends AutoPlugin {
432
432
val eligibleConfigs = activeProjectConfigs.filter { c =>
433
433
val configKey = ConfigKey .configurationToKey(c)
434
434
// Consider only configurations where the `compile` key is defined
435
- val eligibleKey = compile in (thisProjectRef, configKey)
435
+ val eligibleKey = (thisProjectRef / configKey / compile )
436
436
eligibleKey.get(data) match {
437
437
case Some (t) =>
438
438
// Sbt seems to return tasks for the extended configurations (looks like a big bug)
0 commit comments