Skip to content

Commit

Permalink
move build to mill and add scala-native support (#7)
Browse files Browse the repository at this point in the history
* move build to mill and add scala-native support
* travis updates for mill
* scala 2.13.0-M5 support
  • Loading branch information
ajrnz authored Jan 15, 2019
1 parent 2797dbe commit 49a7262
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 48 deletions.
22 changes: 17 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
language: scala
sudo: required
dist: trusty
addons:
apt:
update: true

jdk:
- oraclejdk8

script:
- sbt ++$TRAVIS_SCALA_VERSION genyJVM/test genyJS/test
scala:
- 2.10.4
- 2.11.8
sudo: false
- curl -L -o ~/bin/mill https://github.com/lihaoyi/mill/releases/download/0.3.5/0.3.5 && chmod +x ~/bin/mill
- curl https://raw.githubusercontent.com/scala-native/scala-native/master/scripts/travis_setup.sh | bash -x
- export PATH=~/bin/mill:$PATH
- mill geny.__.test

cache:
directories:
- $HOME/.coursier
37 changes: 0 additions & 37 deletions build.sbt

This file was deleted.

58 changes: 58 additions & 0 deletions build.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import mill._, scalalib._, scalajslib._, scalanativelib._, publish._


trait GenyPublishModule extends PublishModule {
def artifactName = "geny"

def publishVersion = "0.1.6"

def pomSettings = PomSettings(
description = artifactName(),
organization = "com.lihaoyi",
url = "https://github.com/lihaoyi/geny",
licenses = Seq(License.MIT),
scm = SCM(
"git://github.com/lihaoyi/geny.git",
"scm:git://github.com/lihaoyi/geny.git"
),
developers = Seq(
Developer("lihaoyi", "Li Haoyi", "https://github.com/lihaoyi")
)
)
}

trait Common extends CrossScalaModule {
def millSourcePath = build.millSourcePath / "geny"
def sources = T.sources(millSourcePath / "src")
}

trait CommonTestModule extends ScalaModule with TestModule {
def ivyDeps = Agg(ivy"com.lihaoyi::utest::0.6.6")
def testFrameworks = Seq("utest.runner.Framework")
}


object geny extends Module {
object jvm extends Cross[JvmGenyModule]("2.11.12", "2.12.8", "2.13.0-M5")
class JvmGenyModule(val crossScalaVersion: String)
extends Common with ScalaModule with GenyPublishModule
{
object test extends Tests with CommonTestModule
}

object js extends Cross[JSGenyModule](("2.12.8", "0.6.26"), ("2.13.0-M5", "0.6.26"))
class JSGenyModule(val crossScalaVersion: String, crossJSVersion: String)
extends Common with ScalaJSModule with GenyPublishModule
{
def scalaJSVersion = crossJSVersion
object test extends Tests with CommonTestModule
}

object native extends Cross[NativeGenyModule](("2.11.12", "0.3.8"))
class NativeGenyModule(val crossScalaVersion: String, crossScalaNativeVersion: String)
extends Common with ScalaNativeModule with GenyPublishModule
{
def scalaNativeVersion = crossScalaNativeVersion
object test extends Tests with CommonTestModule
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ trait Generator[+A]{

}
def toArray[B >: A : ClassTag]: Array[B] = toBuffer.toArray
def toSeq: Seq[A] = toBuffer
def toSeq: Seq[A] = toVector
def toList = toBuffer.toList
def toSet[B >: A] = toBuffer[B].toSet
def toVector = toBuffer.toVector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ object TestGenerator extends TestSuite{
def check(g: Generator[Int], expected: String) = {
assert(g.toString == expected)
}
check(Generator(0, 1, 2), "Generator(WrappedArray(0, 1, 2))")
// These vary on jvm and js between 2.12 and 2.13
val x = Generator(0, 1, 2).toString
assert(
x == "Generator(WrappedArray(0, 1, 2))" ||
x == "Generator(WrappedVarArgs(0, 1, 2))" ||
x == "Generator(ArraySeq(0, 1, 2))"
)
check(Generator.from(0 until 3 toList), "Generator(List(0, 1, 2))")
}
'unit{
Expand Down
1 change: 0 additions & 1 deletion project/build.properties

This file was deleted.

3 changes: 0 additions & 3 deletions project/build.sbt

This file was deleted.

5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ operations performed, and properly closed when everything is done.
Changelog
=========

0.1.6
-----

- Add scala-native support

0.1.5
-----

Expand Down

0 comments on commit 49a7262

Please sign in to comment.