Skip to content

Commit ce73a8c

Browse files
committed
Rename Inputs to ModuleInputs
1 parent f62cc68 commit ce73a8c

39 files changed

+151
-149
lines changed

modules/build/src/main/scala/scala/build/Build.scala

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import scala.util.control.NonFatal
3030
import scala.util.{Properties, Try}
3131

3232
trait Build {
33-
def inputs: Inputs
33+
def inputs: ModuleInputs
3434
def options: BuildOptions
3535
def scope: Scope
3636
def outputOpt: Option[os.Path]
@@ -43,7 +43,7 @@ trait Build {
4343
object Build {
4444

4545
final case class Successful(
46-
inputs: Inputs,
46+
inputs: ModuleInputs,
4747
options: BuildOptions,
4848
scalaParams: Option[ScalaParameters],
4949
scope: Scope,
@@ -166,7 +166,7 @@ object Build {
166166
}
167167

168168
final case class Failed(
169-
inputs: Inputs,
169+
inputs: ModuleInputs,
170170
options: BuildOptions,
171171
scope: Scope,
172172
sources: Sources,
@@ -180,7 +180,7 @@ object Build {
180180
}
181181

182182
final case class Cancelled(
183-
inputs: Inputs,
183+
inputs: ModuleInputs,
184184
options: BuildOptions,
185185
scope: Scope,
186186
reason: String
@@ -195,10 +195,10 @@ object Build {
195195
* Using only the command-line options not the ones from the sources.
196196
*/
197197
def updateInputs(
198-
inputs: Inputs,
198+
inputs: ModuleInputs,
199199
options: BuildOptions,
200200
testOptions: Option[BuildOptions] = None
201-
): Inputs = {
201+
): ModuleInputs = {
202202

203203
// If some options are manually overridden, append a hash of the options to the project name
204204
// Using options, not options0 - only the command-line options are taken into account. No hash is
@@ -215,7 +215,7 @@ object Build {
215215
}
216216

217217
private def allInputs(
218-
inputs: Inputs,
218+
inputs: ModuleInputs,
219219
options: BuildOptions,
220220
logger: Logger
221221
)(using ScalaCliInvokeData) =
@@ -232,7 +232,7 @@ object Build {
232232
)
233233

234234
private def build(
235-
inputs: Inputs,
235+
inputs: ModuleInputs,
236236
crossSources: CrossSources,
237237
options: BuildOptions,
238238
logger: Logger,
@@ -247,7 +247,7 @@ object Build {
247247
val sharedOptions = crossSources.sharedOptions(options)
248248
val crossOptions = sharedOptions.crossOptions
249249

250-
def doPostProcess(build: Build, inputs: Inputs, scope: Scope): Unit = build match {
250+
def doPostProcess(build: Build, inputs: ModuleInputs, scope: Scope): Unit = build match {
251251
case build: Build.Successful =>
252252
for (sv <- build.project.scalaCompiler.map(_.scalaVersion))
253253
postProcess(
@@ -426,7 +426,7 @@ object Build {
426426
}
427427

428428
private def build(
429-
inputs: Inputs,
429+
inputs: ModuleInputs,
430430
sources: Sources,
431431
generatedSources: Seq[GeneratedSource],
432432
options: BuildOptions,
@@ -499,7 +499,7 @@ object Build {
499499

500500
def scalaNativeSupported(
501501
options: BuildOptions,
502-
inputs: Inputs,
502+
inputs: ModuleInputs,
503503
logger: Logger
504504
): Either[BuildException, Option[ScalaNativeCompatibilityError]] =
505505
either {
@@ -557,7 +557,7 @@ object Build {
557557
}
558558

559559
def build(
560-
inputs: Inputs,
560+
inputs: ModuleInputs,
561561
options: BuildOptions,
562562
compilerMaker: ScalaCompilerMaker,
563563
docCompilerMakerOpt: Option[ScalaCompilerMaker],
@@ -637,7 +637,7 @@ object Build {
637637
}
638638

639639
def watch(
640-
inputs: Inputs,
640+
inputs: ModuleInputs,
641641
options: BuildOptions,
642642
compilerMaker: ScalaCompilerMaker,
643643
docCompilerMakerOpt: Option[ScalaCompilerMaker],
@@ -841,7 +841,7 @@ object Build {
841841
* a bloop [[Project]]
842842
*/
843843
def buildProject(
844-
inputs: Inputs,
844+
inputs: ModuleInputs,
845845
sources: Sources,
846846
generatedSources: Seq[GeneratedSource],
847847
options: BuildOptions,
@@ -1021,7 +1021,7 @@ object Build {
10211021
}
10221022

10231023
def prepareBuild(
1024-
inputs: Inputs,
1024+
inputs: ModuleInputs,
10251025
sources: Sources,
10261026
generatedSources: Seq[GeneratedSource],
10271027
options: BuildOptions,
@@ -1102,7 +1102,7 @@ object Build {
11021102
}
11031103

11041104
def buildOnce(
1105-
inputs: Inputs,
1105+
inputs: ModuleInputs,
11061106
sources: Sources,
11071107
generatedSources: Seq[GeneratedSource],
11081108
options: BuildOptions,
@@ -1272,7 +1272,7 @@ object Build {
12721272
else path.toString
12731273

12741274
private def jmhBuild(
1275-
inputs: Inputs,
1275+
inputs: ModuleInputs,
12761276
build: Build.Successful,
12771277
logger: Logger,
12781278
javaCommand: String,

modules/build/src/main/scala/scala/build/CrossSources.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ final case class CrossSources(
140140

141141
object CrossSources {
142142

143-
private def withinTestSubDirectory(p: ScopePath, inputs: Inputs): Boolean =
143+
private def withinTestSubDirectory(p: ScopePath, inputs: ModuleInputs): Boolean =
144144
p.root.exists { path =>
145145
val fullPath = path / p.subPath
146146
inputs.elements.exists {
@@ -155,14 +155,14 @@ object CrossSources {
155155
/** @return
156156
* a CrossSources and Inputs which contains element processed from using directives
157157
*/
158-
def forInputs(
159-
inputs: Inputs,
158+
def forModuleInputs(
159+
inputs: ModuleInputs,
160160
preprocessors: Seq[Preprocessor],
161161
logger: Logger,
162162
suppressWarningOptions: SuppressWarningOptions,
163163
exclude: Seq[Positioned[String]] = Nil,
164164
maybeRecoverOnError: BuildException => Option[BuildException] = e => Some(e)
165-
)(using ScalaCliInvokeData): Either[BuildException, (CrossSources, Inputs)] = either {
165+
)(using ScalaCliInvokeData): Either[BuildException, (CrossSources, ModuleInputs)] = either {
166166

167167
def preprocessSources(elems: Seq[SingleElement])
168168
: Either[BuildException, Seq[PreprocessedSource]] =
@@ -379,7 +379,7 @@ object CrossSources {
379379
* the resource directories that should be added to the classpath
380380
*/
381381
private def resolveResourceDirs(
382-
allInputs: Inputs,
382+
allInputs: ModuleInputs,
383383
preprocessedSources: Seq[PreprocessedSource]
384384
): Seq[WithBuildRequirements[os.Path]] = {
385385
val fromInputs = allInputs.elements

modules/build/src/main/scala/scala/build/Sources.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import coursier.util.Task
66
import java.nio.charset.StandardCharsets
77

88
import scala.build.info.BuildInfo
9-
import scala.build.input.Inputs
9+
import scala.build.input.ModuleInputs
1010
import scala.build.internal.{CodeWrapper, WrapperParams}
1111
import scala.build.options.{BuildOptions, Scope}
1212
import scala.build.preprocessing.*
@@ -19,7 +19,7 @@ final case class Sources(
1919
buildOptions: BuildOptions
2020
) {
2121

22-
def withVirtualDir(inputs: Inputs, scope: Scope, options: BuildOptions): Sources = {
22+
def withVirtualDir(inputs: ModuleInputs, scope: Scope, options: BuildOptions): Sources = {
2323

2424
val srcRootPath = inputs.generatedSrcRoot(scope)
2525
val resourceDirs0 = options.classPathOptions.resourcesVirtualDir.map { path =>

modules/build/src/main/scala/scala/build/bsp/BloopSession.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import java.util.concurrent.atomic.AtomicReference
66

77
import scala.build.Build
88
import scala.build.compiler.BloopCompiler
9-
import scala.build.input.{Inputs, OnDisk, SingleFile, Virtual}
9+
import scala.build.input.{ModuleInputs, OnDisk, SingleFile, Virtual}
1010

1111
final class BloopSession(
12-
val inputs: Inputs,
12+
val inputs: ModuleInputs,
1313
val inputsHash: String,
1414
val remoteServer: BloopCompiler,
1515
val bspServer: BspServer,
@@ -57,7 +57,7 @@ final class BloopSession(
5757
object BloopSession {
5858

5959
def apply(
60-
inputs: Inputs,
60+
inputs: ModuleInputs,
6161
remoteServer: BloopCompiler,
6262
bspServer: BspServer,
6363
watcher: Build.Watcher

modules/build/src/main/scala/scala/build/bsp/Bsp.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ package scala.build.bsp
33
import java.io.{InputStream, OutputStream}
44

55
import scala.build.errors.BuildException
6-
import scala.build.input.{Inputs, ScalaCliInvokeData}
6+
import scala.build.input.{ModuleInputs, ScalaCliInvokeData}
77
import scala.concurrent.Future
88

99
trait Bsp {
10-
def run(initialInputs: Inputs, initialBspOptions: BspReloadableOptions): Future[Unit]
10+
def run(initialInputs: ModuleInputs, initialBspOptions: BspReloadableOptions): Future[Unit]
1111
def shutdown(): Unit
1212
}
1313

1414
object Bsp {
1515
def create(
16-
argsToInputs: Seq[String] => Either[BuildException, Inputs],
16+
argsToInputs: Seq[String] => Either[BuildException, ModuleInputs],
1717
bspReloadableOptionsReference: BspReloadableOptions.Reference,
1818
threads: BspThreads,
1919
in: InputStream,

modules/build/src/main/scala/scala/build/bsp/BspImpl.scala

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import scala.build.errors.{
2121
Diagnostic,
2222
ParsingInputsException
2323
}
24-
import scala.build.input.{Inputs, ScalaCliInvokeData}
24+
import scala.build.input.{ModuleInputs, ScalaCliInvokeData}
2525
import scala.build.internal.Constants
2626
import scala.build.options.{BuildOptions, Scope}
2727
import scala.collection.mutable.ListBuffer
@@ -33,7 +33,7 @@ import scala.util.{Failure, Success}
3333
/** The implementation for [[Bsp]] command.
3434
*
3535
* @param argsToInputs
36-
* a function transforming terminal args to [[Inputs]]
36+
* a function transforming terminal args to [[ModuleInputs]]
3737
* @param bspReloadableOptionsReference
3838
* reference to the current instance of [[BspReloadableOptions]]
3939
* @param threads
@@ -44,7 +44,7 @@ import scala.util.{Failure, Success}
4444
* the output stream of bytes
4545
*/
4646
final class BspImpl(
47-
argsToInputs: Seq[String] => Either[BuildException, Inputs],
47+
argsToInputs: Seq[String] => Either[BuildException, ModuleInputs],
4848
bspReloadableOptionsReference: BspReloadableOptions.Reference,
4949
threads: BspThreads,
5050
in: InputStream,
@@ -108,7 +108,7 @@ final class BspImpl(
108108

109109
// allInputs contains elements from using directives
110110
val (crossSources, allInputs) = value {
111-
CrossSources.forInputs(
111+
CrossSources.forModuleInputs(
112112
inputs = inputs,
113113
preprocessors = Sources.defaultPreprocessors(
114114
buildOptions.archiveCache,
@@ -408,7 +408,7 @@ final class BspImpl(
408408
* a new [[BloopSession]]
409409
*/
410410
private def newBloopSession(
411-
inputs: Inputs,
411+
inputs: ModuleInputs,
412412
reloadableOptions: BspReloadableOptions,
413413
presetIntelliJ: Boolean = false
414414
): BloopSession = {
@@ -459,7 +459,10 @@ final class BspImpl(
459459
* the initial input sources passed upon initializing the BSP connection (which are subject to
460460
* change on subsequent workspace/reload requests)
461461
*/
462-
override def run(initialInputs: Inputs, initialBspOptions: BspReloadableOptions): Future[Unit] = {
462+
override def run(
463+
initialInputs: ModuleInputs,
464+
initialBspOptions: BspReloadableOptions
465+
): Future[Unit] = {
463466
val logger = initialBspOptions.logger
464467
val verbosity = initialBspOptions.verbosity
465468

@@ -561,8 +564,8 @@ final class BspImpl(
561564
*/
562565
private def reloadBsp(
563566
currentBloopSession: BloopSession,
564-
previousInputs: Inputs,
565-
newInputs: Inputs,
567+
previousInputs: ModuleInputs,
568+
newInputs: ModuleInputs,
566569
reloadableOptions: BspReloadableOptions
567570
): CompletableFuture[AnyRef] = {
568571
val previousTargetIds = currentBloopSession.bspServer.targetIds

modules/build/src/main/scala/scala/build/bsp/BuildServerProxy.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import java.util.concurrent.CompletableFuture
66

77
import scala.build.GeneratedSource
88
import scala.build.bsp.buildtargets.{ManagesBuildTargets, ProjectName}
9-
import scala.build.input.Inputs
9+
import scala.build.input.ModuleInputs
1010
import scala.build.options.Scope
1111

1212
/** A wrapper for [[BspServer]], allowing to reload the workspace on the fly.
@@ -113,6 +113,6 @@ class BuildServerProxy(
113113
bspServer().addTarget(projectName, workspace, scope, generatedSources)
114114
def resetTargets(): Unit =
115115
bspServer().resetTargets()
116-
def newInputs(inputs: Inputs): Unit =
116+
def newInputs(inputs: ModuleInputs): Unit =
117117
bspServer().newInputs(inputs)
118118
}

modules/build/src/main/scala/scala/build/bsp/buildtargets/ManagesBuildTargets.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import ch.epfl.scala.bsp4j.BuildTargetIdentifier
44
import ch.epfl.scala.bsp4j as b
55

66
import scala.build.GeneratedSource
7-
import scala.build.input.Inputs
7+
import scala.build.input.ModuleInputs
88
import scala.build.internal.Constants
99
import scala.build.options.Scope
1010

@@ -18,7 +18,7 @@ trait ManagesBuildTargets {
1818
generatedSources: Seq[GeneratedSource] = Nil
1919
): Unit
2020
def resetTargets(): Unit
21-
def newInputs(inputs: Inputs): Unit
21+
def newInputs(inputs: ModuleInputs): Unit
2222
def setGeneratedSources(projectName: ProjectName, sources: Seq[GeneratedSource]): Unit
2323
}
2424

modules/build/src/main/scala/scala/build/bsp/buildtargets/ManagesBuildTargetsImpl.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import ch.epfl.scala.bsp4j as b
55
import scala.build.GeneratedSource
66
import scala.build.bsp.buildtargets.ManagesBuildTargets
77
import scala.build.errors.{BuildException, WorkspaceError}
8-
import scala.build.input.Inputs
8+
import scala.build.input.ModuleInputs
99
import scala.build.internal.Constants
1010
import scala.build.options.Scope
1111
import scala.collection.mutable
@@ -35,7 +35,7 @@ trait ManagesBuildTargetsImpl extends ManagesBuildTargets {
3535
managedTargets.put(projectName, BuildTarget(projectName, workspace, scope, generatedSources))
3636

3737
// TODO MG
38-
override def newInputs(inputs: Inputs): Unit = {
38+
override def newInputs(inputs: ModuleInputs): Unit = {
3939
resetTargets()
4040
addTarget(inputs.projectName, inputs.workspace, Scope.Main)
4141
addTarget(inputs.scopeProjectName(Scope.Test), inputs.workspace, Scope.Test)

0 commit comments

Comments
 (0)