Skip to content

Commit 51291f9

Browse files
Merge pull request #200 from alexarchambault/using-directives
Tweak directive parsing
2 parents 3b2a096 + 0f3509d commit 51291f9

File tree

47 files changed

+728
-172
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+728
-172
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -305,36 +305,28 @@ jobs:
305305
- uses: coursier/[email protected]
306306
with:
307307
jvm: 8
308-
- run: ./mill -i ci.setShouldPublish
309308
- uses: actions/download-artifact@v2
310-
if: env.SHOULD_PUBLISH == 'true'
311309
with:
312310
name: launchers
313311
path: artifacts/
314312
- name: Display structure of downloaded files
315-
if: env.SHOULD_PUBLISH == 'true'
316313
run: ls -R
317314
working-directory: artifacts/
318315
- uses: webfactory/ssh-agent@5f066a372ec13036ab7cb9a8adf18c936f8d2043
319-
if: env.SHOULD_PUBLISH == 'true'
320316
with:
321317
ssh-private-key: |
322318
${{ secrets.SCALA_CLI_PACKAGES_KEY }}
323319
${{ secrets.HOMEBREW_SCALA_CLI_KEY }}
324320
- run: ./mill -i ci.updateBrewFormula
325-
if: env.SHOULD_PUBLISH == 'true'
326321
- name: GPG setup
327322
run: .github/scripts/gpg-setup.sh
328-
if: env.SHOULD_PUBLISH == 'true'
329323
env:
330324
PGP_SECRET: ${{ secrets.PGP_SECRET }}
331325
- run: ./mill -i ci.updateDebianPackages
332-
if: env.SHOULD_PUBLISH == 'true'
333326
env:
334327
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
335328
GPG_EMAIL: ${{ secrets.GPG_EMAIL }}
336329
- run: ./mill -i ci.updateCentOsPackages
337-
if: env.SHOULD_PUBLISH == 'true'
338330
env:
339331
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
340332
KEYGRIP: ${{ secrets.KEYGRIP }}
@@ -385,13 +377,10 @@ jobs:
385377
- uses: coursier/[email protected]
386378
with:
387379
jvm: 8
388-
- run: ./mill -i ci.setShouldPublish
389380
- uses: actions/[email protected]
390-
if: env.SHOULD_PUBLISH == 'true'
391381
with:
392382
node-version: '12.x'
393383
- run: .github/scripts/update-website.sh
394-
if: env.SHOULD_PUBLISH == 'true'
395384
env:
396385
GIT_USER: Virtuslab
397386
DEPLOYMENT_BRANCH: gh-pages

build.sc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ class Build(val crossScalaVersion: String)
179179
Deps.scalametaTrees,
180180
Deps.scalaparse,
181181
Deps.shapeless,
182-
Deps.swoval
182+
Deps.swoval,
183+
Deps.usingDirectives
183184
)
184185

185186
private def vcsState = T.persistent {

examples/cross-build/Hello.js.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// using scala 2.13
2-
// require scala-js
2+
// using target scala-js
33

44
import scala.scalajs.js
55

examples/cross-build/Hello.native.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// using scala 2.13
2-
// require scala-native
2+
// using target scala-native
33

44
import scala.scalanative.libc._
55
import scala.scalanative.unsafe._

examples/utest/MyTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// using "com.lihaoyi::utest::0.7.10"
1+
@using lib "com.lihaoyi::utest::0.7.10"
22

33
import utest._
44

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package scala.build.errors
2+
3+
final class DependencyFormatError(
4+
val dependencyString: String,
5+
val error: String,
6+
val originOpt: Option[String] = None
7+
) extends BuildException(
8+
s"Error parsing ${originOpt.getOrElse("")}dependency '$dependencyString': $error"
9+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package scala.build.errors
2+
3+
final class DirectiveErrors(errors: ::[String]) extends BuildException(
4+
"Directives errors: " + errors.mkString(", ")
5+
)

modules/build/src/main/scala/scala/build/errors/InvalidDirectiveError.scala

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package scala.build.errors
2+
3+
final class MalformedPlatformError(marformedInput: String) extends BuildException(
4+
s"Unrecognized platform: $marformedInput"
5+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package scala.build.errors
2+
3+
final class NoScalaVersionProvidedError extends BuildException(
4+
"No Scala version provided to using scala directive"
5+
)

0 commit comments

Comments
 (0)