Skip to content

Commit da56278

Browse files
committed
working with ${.} unclean
1 parent 86a9a4e commit da56278

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

modules/build/src/main/scala/scala/build/Project.scala

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import coursier.core.Classifier
77

88
import java.io.ByteArrayOutputStream
99
import java.nio.charset.StandardCharsets
10-
import java.nio.file.Path
10+
import java.nio.file.{Path, Paths}
1111
import java.util.Arrays
1212

1313
import scala.build.options.{GeneratorConfig, ScalacOpt, Scope, ShadowingSeq}
@@ -54,13 +54,14 @@ final case class Project(
5454

5555
val sourceGen0: Option[List[BloopConfig.SourceGenerator]] =
5656
generateSource.map(config =>
57-
println(os.pwd)
58-
println(config.commandFilePath)
59-
println(config.inputDir)
60-
println(config.glob)
61-
val command0 = s"${os.pwd}/testing-a/${config.commandFilePath}"
57+
println(s"Input Directory => ${config.inputDir}")
58+
println(s"Globber => ${config.glob}")
59+
println(s"Command File Path => ${config.commandFilePath}")
60+
// val command0 = s"${os.pwd}/testing-a/${config.commandFilePath}"
61+
val command0 = config.commandFilePath
6262
val sourceGlobs0 = BloopConfig.SourcesGlobs(
63-
(os.pwd / "testing-a" / config.inputDir).toNIO,
63+
// (os.pwd / "testing-a" / config.inputDir).toNIO,
64+
Paths.get(config.inputDir),
6465
None,
6566
config.glob,
6667
Nil
@@ -69,6 +70,7 @@ final case class Project(
6970
val sourceGen = BloopConfig.SourceGenerator(
7071
List(sourceGlobs0),
7172
(os.pwd / "testing-a" / "source-generator-output").toNIO,
73+
// Paths.get(config.inputDir),
7274
List("python3", command0)
7375
// Nil
7476
)

modules/directives/src/main/scala/scala/build/directives/DirectiveValueParser.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ object DirectiveValueParser {
138138
given DirectiveSingleValueParser[String] =
139139
(key, value, scopePath, path) =>
140140
value.asString.toRight {
141+
println("do we get here?")
141142
val pos = value.position(path)
142143
new MalformedDirectiveError(
143144
message =

modules/directives/src/main/scala/scala/build/preprocessing/directives/SourceGenerator.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,15 @@ import scala.build.{Positioned, options}
1313
@DirectiveDescription("Generate code using Source Generator")
1414
@DirectiveLevel(SpecificationLevel.EXPERIMENTAL)
1515
final case class SourceGenerator(
16-
sourceGenerator: Option[Positioned[String]] = None
16+
sourceGenerator: DirectiveValueParser.WithScopePath[Option[Positioned[String]]] = DirectiveValueParser.WithScopePath.empty(None)
1717
) extends HasBuildOptions {
1818
def buildOptions: Either[BuildException, BuildOptions] = either {
19-
val maybeGenerateSource = sourceGenerator
19+
val sourceGen = sourceGenerator.value
20+
21+
val maybeGenerateSource = sourceGen
2022
.map(GeneratorConfig.parse)
2123
.sequence
2224

23-
// val buildOpt = BuildOptions(
24-
// generateSource = Some(generateSource0)
25-
// )
26-
2725
val generateSource = maybeGenerateSource match {
2826
case Left(buildException) => throw buildException
2927
case Right(config) => config

0 commit comments

Comments
 (0)