Skip to content

Commit 1228bc0

Browse files
committed
add sbt build for macros related modules, fix main sbt for scala 2.12
1 parent 7eae1cc commit 1228bc0

File tree

4 files changed

+35
-33
lines changed

4 files changed

+35
-33
lines changed

build.sbt

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -103,54 +103,29 @@ lazy val sql = project
103103
.in(file("sql"))
104104
.configs(IntegrationTest)
105105
.settings(
106-
Defaults.itSettings
106+
Defaults.itSettings,
107+
moduleSettings
107108
)
108109

109110
lazy val macros = project
110111
.in(file("macros"))
111112
.configs(IntegrationTest)
112113
.settings(
113-
name := "softclient4es-macros",
114-
115-
libraryDependencies ++= Seq(
116-
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
117-
"org.json4s" %% "json4s-native" % Versions.json4s
118-
),
119114
Defaults.itSettings,
120-
moduleSettings,
121-
scalacOptions ++= Seq(
122-
"-language:experimental.macros",
123-
"-Ymacro-annotations",
124-
"-Ymacro-debug-lite", // Debug macros
125-
"-Xlog-implicits" // Debug implicits
126-
)
115+
moduleSettings
127116
)
128-
.dependsOn(sql)
117+
.dependsOn(sql % "compile->compile;test->test;it->it")
129118

130119
lazy val macrosTests = project
131120
.in(file("macros-tests"))
132121
.configs(IntegrationTest)
133122
.settings(
134-
name := "softclient4es-macros-tests",
135123
Publish.noPublishSettings,
136-
137-
libraryDependencies ++= Seq(
138-
"org.scalatest" %% "scalatest" % Versions.scalatest % Test
139-
),
140-
141124
Defaults.itSettings,
142-
moduleSettings,
143-
144-
scalacOptions ++= Seq(
145-
"-language:experimental.macros",
146-
"-Ymacro-debug-lite"
147-
),
148-
149-
Test / scalacOptions += "-Xlog-free-terms"
125+
moduleSettings
150126
)
151127
.dependsOn(
152-
macros % "compile->compile",
153-
sql % "compile->compile"
128+
macros % "compile->compile;test->test;it->it"
154129
)
155130

156131
lazy val core = project
@@ -486,9 +461,9 @@ lazy val root = project
486461
)
487462
.aggregate(
488463
sql,
464+
bridge,
489465
macros,
490466
macrosTests,
491-
bridge,
492467
core,
493468
persistence,
494469
testkit,

macros-tests/build.sbt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
organization := "app.softnetwork.elastic"
2+
3+
name := "softclient4es-macros-tests"
4+
5+
libraryDependencies ++= Seq(
6+
"org.scalatest" %% "scalatest" % Versions.scalatest % Test
7+
)
8+
9+
scalacOptions ++= Seq(
10+
"-language:experimental.macros",
11+
"-Ymacro-debug-lite"
12+
)
13+
14+
Test / scalacOptions += "-Xlog-free-terms"

macros/build.sbt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
organization := "app.softnetwork.elastic"
2+
3+
name := "softclient4es-macros"
4+
5+
libraryDependencies ++= Seq(
6+
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
7+
"org.json4s" %% "json4s-native" % Versions.json4s
8+
)
9+
10+
scalacOptions ++= Seq(
11+
"-language:experimental.macros",
12+
"-Ymacro-debug-lite" // Debug macros
13+
)

macros/src/main/scala/app/softnetwork/elastic/sql/macros/SQLQueryValidator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ trait SQLQueryValidator {
448448
val exampleFields = ((queryFields -- unknownFields) + fullFieldName).mkString(", ")
449449
val suggestions = findClosestMatch(fieldName, unknownFields.map(_.split("\\.").last).toSeq)
450450
val suggestionMsg = suggestions
451-
.map(s => s"\nYou have selected unknown field \"$s\", did you mean \"$fullFieldName\"?")
451+
.map(s => s"""\nYou have selected unknown field "$s", did you mean "$fullFieldName"?""")
452452
.getOrElse("")
453453

454454
c.abort(

0 commit comments

Comments
 (0)