Skip to content

Commit

Permalink
Merge pull request #2 from windymelt/versioning-using-git
Browse files Browse the repository at this point in the history
release settings
  • Loading branch information
windymelt authored Sep 6, 2023
2 parents 0242166 + af76443 commit c961629
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
19 changes: 17 additions & 2 deletions build.sc
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0`
import de.tobiasroeser.mill.vcs.version.VcsVersion

import mill._, scalalib._
import publish._

object qw extends RootModule with ScalaModule {
object qw extends RootModule with ScalaModule with PublishModule {
def scalaVersion = "3.3.0"
def publishVersion = "0.1.1-SNAPSHOT"
def pomSettings = PomSettings(
description = artifactName(),
organization = "io.github.windymelt",
url = "https://github.com/windymelt/qw.scala",
licenses = Seq(License.MIT),
versionControl = VersionControl.github("windymelt", "qw.scala"),
developers = Seq(
Developer("windymelt", "windymelt", "https://github.com/windymelt")
)
)
override def publishVersion: T[String] = VcsVersion.vcsState().format()

object test extends ScalaTests with TestModule.Munit {
def ivyDeps = Agg(ivy"org.scalameta::munit::0.7.29")
}
Expand Down
20 changes: 20 additions & 0 deletions src/main/scala/io/github/windymelt/qw/Syntax.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
package io.github.windymelt.qw

/** Enables qw syntax for string.
*
* {{{
* import io.github.windymelt.qw.Syntax.*
* qw"foo bar buzz" // => "foo" :: "bar" :: "buzz" :: Nil
* }}}
*
* You can use newline for separator too:
*
* {{{
* qw"""
* new
* line
* separated
* """ // => "new" :: "line" :: "separated" :: Nil
* }}}
*/
object Syntax:
extension (sc: StringContext)
/** Splits strings with whitespace character and constructs
* [[List[String]]].
*/
def qw(args: String*): List[String] =
val strings = sc.parts.iterator
val expressions = args.iterator
Expand Down

0 comments on commit c961629

Please sign in to comment.