Skip to content

Commit

Permalink
Minor changes; remove SNAPSHOT version qualifier
Browse files Browse the repository at this point in the history
Note: for some reason, trying to generate the scala-doc of the main test
project fails (also, it generates warnings)
  • Loading branch information
LPTK committed Dec 20, 2017
1 parent d605f1d commit 73b3841
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,7 @@ an alternative to the current Scala-reflection macros.

Squid currently supports Scala versions `2.11.3` to `2.11.11`
(more recent versions might work as well, but have not yet been tested).

The project is not yet published on Maven,
so in order to use it you'll have to clone this repository
and publish Squid locally,
which can be done by executing the script in `bin/publishLocal.sh`.
A port to Scala `2.12` is underway.

In your project, add the following to your `build.sbt`:

Expand All @@ -117,6 +113,11 @@ autoCompilerPlugins := true
addCompilerPlugin("org.scalamacros" % "paradise" % paradiseVersion cross CrossVersion.full)
```

In case you wish to use a more recent version that has not yet been published,
you'll have to clone this repository
and publish Squid locally,
which can be done by executing the script in `bin/publishLocal.sh`.


## Overview of Features

Expand Down
2 changes: 1 addition & 1 deletion bin/publish.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt publish core/publish core_macros/publish scBackend/publish scBackendMacros/publish
sbt publishSigned core/publishSigned core_macros/publishSigned
16 changes: 7 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

val paradiseVersion = "2.1.0"
val squidVersion = "0.2.0-SNAPSHOT"
val squidVersion = "0.2.0"
val squidIsSnapshot: Boolean = squidVersion endsWith "-SNAPSHOT"

lazy val commonSettings = Seq(
Expand All @@ -28,7 +28,6 @@ lazy val commonSettings = Seq(
resolvers += Resolver.sonatypeRepo("snapshots"),
resolvers += Resolver.sonatypeRepo("releases"),
addCompilerPlugin("org.scalamacros" % "paradise" % paradiseVersion cross CrossVersion.full),
//addCompilerPlugin("org.scalamacros" % "paradise" % paradiseVersion cross CrossVersion.full),
libraryDependencies ++= Seq(
"junit" % "junit-dep" % "4.10" % "test",
"org.scalatest" % "scalatest_2.11" % "2.2.0" % "test"
Expand All @@ -38,13 +37,12 @@ lazy val commonSettings = Seq(
else Nil
),
libraryDependencies += "com.lihaoyi" % "ammonite" % "1.0.3" % "test" cross CrossVersion.full,
// For the ammonite REPL:
sourceGenerators in Test += Def.task {
val file = (sourceManaged in Test).value / "amm.scala"
IO.write(file, """object amm extends App { ammonite.Main().run() }""")
Seq(file)
}.taskValue,
offline := true,
publishArtifact in packageDoc := !squidIsSnapshot // publishing doc is super slow -- don't do it for snapshots to ease development
}.taskValue
) ++ publishSettings
lazy val scalaReflect = Def.setting { "org.scala-lang" % "scala-reflect" % scalaVersion.value }
lazy val scalaCompiler = Def.setting { "org.scala-lang" % "scala-compiler" % scalaVersion.value }
Expand Down Expand Up @@ -82,8 +80,6 @@ lazy val core_macros = (project in file("core_macros")).

val SCVersion = "0.1.4-SNAPSHOT"

val currentIsSnapshot = true

lazy val scBackendMacros = (project in file("sc-backend/macros")).
settings(commonSettings: _*).
settings(
Expand Down Expand Up @@ -122,7 +118,7 @@ val developers =
lazy val publishSettings = Seq(
// resolvers += Resolver.sonatypeRepo("releases"),
publishMavenStyle := true,
isSnapshot := currentIsSnapshot,
isSnapshot := squidIsSnapshot,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Expand All @@ -132,5 +128,7 @@ lazy val publishSettings = Seq(
},
publishArtifact in (Compile, packageSrc) := false,
pomIncludeRepository := { _ => false },
pomExtra := developers
pomExtra := developers,
publishArtifact in Test := false,
publishArtifact in packageDoc := !squidIsSnapshot // publishing doc is super slow -- don't do it for snapshots to ease development
)
8 changes: 4 additions & 4 deletions src/main/scala/squid/ir/SimpleANF.scala
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ class SimpleANF extends AST with CurryEncoding with SimpleEffects { anf =>
debug(s"${BOLD}Rewriting$RESET $xtee ${BOLD}with$RESET $xtor")
//nestDbg(extract(xtor, xtee)) and (res => debug(s"${BOLD}Result:$RESET $res"))

/** Backtracking rewriting block matcher
* @param ex: current extraction artifact
* @param matchedVals: which bound Vals have been traversed and replaced by holes so far
* @param xy: the current (extractor -> extractee) pair */
/* Backtracking rewriting block matcher
* @param ex: current extraction artifact
* @param matchedVals: which bound Vals have been traversed and replaced by holes so far
* @param xy: the current (extractor -> extractee) pair */
def rec(ex: Extract, matchedVals: List[Val])(xy: BlockRep -> BlockRep): Option[Rep] = {
//debug(s"REC ex=$ex")

Expand Down
4 changes: 2 additions & 2 deletions src/test/scala/squid/functional/MultiStage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MultiStage extends MyFunSuite {

test("Nested Quoted Types") {

val reprep = ir"MultiStage.rep" : Q[ Q[Double, {}], {} ]
val reprep = code"MultiStage.rep" : Q[ Q[Double, {}], {} ]
val rep = reprep.run

assert(rep == MultiStage.rep)
Expand Down Expand Up @@ -74,7 +74,7 @@ class MultiStage extends MyFunSuite {
val ir3 = code{ code{ code{scala.None} } } : Code[Code[Code[Option[Int],{}],{}],{}]
val ir2 = ir3.run : Code[Code[Option[Int],{}],{}]
val ir1 = ir2.run : Code[Option[Int],{}]
//assert(ir2 =~= ir""" ir"scala.None" """)
//assert(ir2 =~= code""" code"scala.None" """)
// ^ Note: this one is false because ir2, which uses QC, refers to `TestDSL2.Quasicodes.qcbase` while the other,
// which uses QQ, refers to `TestDSL2.Predef.base`, which are semantically equivalent but different trees.
assert(ir2 =~= code""" code{scala.None} """)
Expand Down

0 comments on commit 73b3841

Please sign in to comment.