Skip to content

Commit

Permalink
Merge pull request #319 from cquiroz/next
Browse files Browse the repository at this point in the history
Prepare next version
  • Loading branch information
cquiroz authored Sep 9, 2019
2 parents b5152f8 + fdb86b9 commit 370d6c6
Show file tree
Hide file tree
Showing 20 changed files with 115 additions and 110 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ project/plugins/project/
.history
.cache
.lib/
.bloop/
.metals/

# Java
*.class
Expand Down Expand Up @@ -52,4 +54,3 @@ tmp/
# Windows
Desktop.ini
Thumbs.db

26 changes: 12 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
language: scala

scala:
- 2.11.12
- 2.12.7
- 2.11.12
- 2.12.9

dist: trusty

jdk:
- oraclejdk8
- openjdk11
- oraclejdk8
- openjdk11

branches:
except:
- /^wip-.*$/

env:
- TRAVIS_NODE_VERSION="10.9.0" SCALAJS_VERSION="0.6.25"
- TRAVIS_NODE_VERSION="10.9.0" SCALAJS_VERSION="1.0.0-M6"
- TRAVIS_NODE_VERSION="10.9.0" SCALAJS_VERSION="0.6.28"
# - TRAVIS_NODE_VERSION="10.9.0" SCALAJS_VERSION="1.0.0-M8"

install:
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
Expand All @@ -32,19 +32,17 @@ cache:
- $HOME/.nvm

before_cache:
- find $HOME/.sbt -name "*.lock" -type f -delete
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -type f -delete
# Cleanup the cached directories to avoid unnecessary cache updates
- rm -fv $HOME/.ivy2/.sbt.ivy.lock
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete
- find $HOME/.sbt -name "*.lock" -print -delete

script:
# Your normal script
- sbt ++$TRAVIS_SCALA_VERSION squantsJVM/compile squantsJS/compile squantsJS/fastOptJS
- if [[ $TRAVIS_SCALA_VERSION == "2.11.12" ]]; then sbt ++$TRAVIS_SCALA_VERSION squantsNative/compile; fi;
- if [[ $SCALAJS_VERSION == "0.6.25" ]]; then sbt ++$TRAVIS_SCALA_VERSION squantsJS/test squantsJVM/test; fi;
- sbt ++$TRAVIS_SCALA_VERSION squantsJS/doc squantsJVM/doc tut

# Tricks to avoid unnecessary cache updates
- find $HOME/.sbt -name "*.lock" | xargs rm
- find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm
- if [[ $SCALAJS_VERSION == "0.6.28" ]]; then sbt ++$TRAVIS_SCALA_VERSION squantsJS/test; fi;
- sbt ++$TRAVIS_SCALA_VERSION squantsJVM/test

after_success:
- bash <(curl -s https://codecov.io/bash)
Expand Down
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ All types are immutable and thread-safe.
|
[![Join the chat at https://gitter.im/typelevel/squants](https://badges.gitter.im/typelevel/squants.svg)](https://gitter.im/typelevel/squants?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
[![Scaladocs](https://www.javadoc.io/badge/org.typelevel/squants_2.12.svg?label=scaladoc)](https://static.javadoc.io/org.typelevel/squants_2.12/1.4.0/squants/index.html)
[![Scaladocs](https://www.javadoc.io/badge/org.typelevel/squants_2.12.svg?label=scaladoc)](https://static.javadoc.io/org.typelevel/squants_2.12/1.5.0/squants/index.html)
|
[![Build Status](https://travis-ci.org/typelevel/squants.png?branch=master)](https://travis-ci.org/typelevel/squants)


### Current Versions
Current Release: **1.4.0**
([API Docs](https://oss.sonatype.org/service/local/repositories/releases/archive/org/typelevel/squants_2.12/1.4.0/squants_2.12-1.4.0-javadoc.jar/!/index.html#squants.package))
Current Release: **1.5.0**
([API Docs](https://oss.sonatype.org/service/local/repositories/releases/archive/org/typelevel/squants_2.12/1.5.0/squants_2.12-1.5.0-javadoc.jar/!/index.html#squants.package))

Development Build: **1.5.0-SNAPSHOT**
([API Docs](https://oss.sonatype.org/service/local/repositories/snapshots/archive/org/typelevel/squants_2.12/1.5.0-SNAPSHOT/squants_2.12-1.5.0-SNAPSHOT-javadoc.jar/!/index.html#squants.package))
Development Build: **1.6.0-SNAPSHOT**
([API Docs](https://oss.sonatype.org/service/local/repositories/snapshots/archive/org/typelevel/squants_2.12/1.6.0-SNAPSHOT/squants_2.12-1.6.0-SNAPSHOT-javadoc.jar/!/index.html#squants.package))

[Release History](https://github.com/typelevel/squants/wiki/Release-History)

Expand All @@ -38,10 +38,10 @@ For more information on feature availability of a specific version see the Relea
Repository hosting for Squants is provided by [Sonatype](https://oss.sonatype.org/).
To use Squants in your SBT project add the following dependency to your build.

"org.typelevel" %% "squants" % "1.4.0"
"org.typelevel" %% "squants" % "1.5.0"
or

"org.typelevel" %% "squants" % "1.5.0-SNAPSHOT"
"org.typelevel" %% "squants" % "1.6.0-SNAPSHOT"


To use Squants in your Maven project add the following dependency
Expand All @@ -50,13 +50,13 @@ To use Squants in your Maven project add the following dependency
<dependency>
<groupId>org.typelevel</groupId>
<artifactId>squants_2.11</artifactId>
<version>1.4.0</version>
<version>1.5.0</version>
</dependency>
```

Beginning with Squants 0.4.x series, both Scala 2.10 and 2.11 builds are available.
Beginning with Squants 1.x series, Scala 2.10, 2.11 and 2.12 builds are available.
Scala.js is supported on version 0.6.25 and 1.0.0-M6
Scala.js is supported on version 0.6.28 and 1.0.0-M8

To use Squants interactively in the Scala REPL, clone the git repo and run `sbt squantsJVM/console`

Expand Down Expand Up @@ -963,7 +963,7 @@ import squants.experimental.unitgroups.si.strict.implicits._
// import squants.experimental.unitgroups.si.strict.implicits._

val siLengths: UnitGroup[Length] = implicitly[UnitGroup[Length]]
// siLengths: squants.experimental.unitgroups.UnitGroup[squants.space.Length] = squants.experimental.unitgroups.si.strict.package$implicits$$anon$1@71f1bb6
// siLengths: squants.experimental.unitgroups.UnitGroup[squants.space.Length] = squants.experimental.unitgroups.si.strict.package$implicits$$anon$1@3bd46477
```

To print out units and their conversion factors to the primary SI unit, you could use this code:
Expand Down Expand Up @@ -1020,16 +1020,16 @@ val usCookingUnitGroup = new UnitGroup[Volume] {
// units don't have to be specified in-order.
val units: Set[UnitOfMeasure[Volume]] = Set(UsPints, UsGallons, Teaspoons, Tablespoons, UsQuarts, FluidOunces)
}
// usCookingUnitGroup: squants.experimental.unitgroups.UnitGroup[squants.space.Volume]{val units: Set[squants.UnitOfMeasure[squants.space.Volume]]} = $anon$1@608b512
// usCookingUnitGroup: squants.experimental.unitgroups.UnitGroup[squants.space.Volume]{val units: Set[squants.UnitOfMeasure[squants.space.Volume]]} = $anon$1@13cf78bc

// squants automatically sorts units
usCookingUnitGroup.sortedUnits.foreach(println)
// squants.space.Teaspoons$@6c8ced06
// squants.space.Tablespoons$@34fbe7f5
// squants.space.FluidOunces$@d678d65
// squants.space.UsPints$@71e9406b
// squants.space.UsQuarts$@f2a1319
// squants.space.UsGallons$@6e8d9849
// squants.space.Teaspoons$@754c402e
// squants.space.Tablespoons$@41f51dac
// squants.space.FluidOunces$@4151520
// squants.space.UsPints$@297ee46f
// squants.space.UsQuarts$@1f76d461
// squants.space.UsGallons$@5f688205
```

The `UnitGroup` values provided with Squants are only samples and aren't intended to be exhaustive.
Expand Down Expand Up @@ -1065,7 +1065,7 @@ import squants.experimental.unitgroups.misc.AstronomicalLengthUnitGroup
Then create the formatter by passing in a unit group:
```scala
val astroFormatter = new DefaultFormatter(AstronomicalLengthUnitGroup)
// astroFormatter: squants.experimental.formatter.DefaultFormatter[squants.space.Length] = squants.experimental.formatter.DefaultFormatter@36136e90
// astroFormatter: squants.experimental.formatter.DefaultFormatter[squants.space.Length] = squants.experimental.formatter.DefaultFormatter@4a75b2e0
```

Now, we create some values using human-unfriendly numbers:
Expand Down Expand Up @@ -1117,7 +1117,7 @@ import squants.experimental.unitgroups.misc.AstronomicalLengthUnitGroup

```scala
implicit val astroFormatter = new DefaultFormatter(AstronomicalLengthUnitGroup)
// astroFormatter: squants.experimental.formatter.DefaultFormatter[squants.space.Length] = squants.experimental.formatter.DefaultFormatter@5866ca54
// astroFormatter: squants.experimental.formatter.DefaultFormatter[squants.space.Length] = squants.experimental.formatter.DefaultFormatter@679fbbc2

val earthToJupiter = 588000000.km
// earthToJupiter: squants.space.Length = 588000000.0 km
Expand Down Expand Up @@ -1552,9 +1552,9 @@ To make a release do the following:
sbt squantsNative/publishSigned
```

* Repeat for scala.js 1.0.0-M6
* Repeat for scala.js 1.0.0-M8
```
SCALAJS_VERSION=1.0.0-M6 sbt +squantsJS/publishSigned
SCALAJS_VERSION=1.0.0-M8 sbt +squantsJS/publishSigned
```

* Then make a release (Note: after this step the release cannot be replaced)
Expand Down
16 changes: 13 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ lazy val defaultSettings =
Console.defaultSettings ++
Docs.defaultSettings

Global / onChangedBuildSource := ReloadOnSourceChanges

ThisBuild / turbo := true

lazy val squants =
crossProject(JSPlatform, JVMPlatform, NativePlatform)
.crossType(CrossType.Full)
Expand All @@ -18,22 +22,28 @@ lazy val squants =
)
.jvmSettings(
osgiSettings,
scalacOptions in Tut --= Seq("-Ywarn-unused-import", "-Ywarn-unused:imports"),
tutTargetDirectory := file("."),
tutSourceDirectory := file("shared") / "src" / "main" / "tut"
)
.jvmSettings(Tests.defaultSettings: _*)
.jsSettings(Tests.defaultSettings: _*)
.jsSettings(
parallelExecution in Test := false,
excludeFilter in Test := "*Serializer.scala" || "*SerializerSpec.scala"
excludeFilter in Test := "*Serializer.scala" || "*SerializerSpec.scala",
scalacOptions in Tut --= Seq("-Ywarn-unused-import", "-Ywarn-unused:imports"),
sources in (Compile, test) := List() // This is a pity but we can't reliable compile on 1.0.0-M8
)
.nativeSettings(
sources in (Compile, doc) := List() // Can't build docs in native
)
.jsSettings(Tests.defaultSettings: _*)

lazy val root = project.in(file("."))
.settings(defaultSettings: _*)
.settings(
name := "squants",
publish := {},
publishLocal := {},
publishArtifact := false
useGpg := true
)
.aggregate(squants.jvm, squants.js, squants.native)
67 changes: 36 additions & 31 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,31 @@ import com.typesafe.sbt.osgi.SbtOsgi
import com.typesafe.sbt.osgi.SbtOsgi.autoImport._

object Versions {
val Squants = "1.4.0"
val Squants = "1.5.0"
val Scala = "2.11.12" // Don't use 2.12 yet to avoid troubles with native
val scalaJSVersion =
Option(System.getenv("SCALAJS_VERSION")).getOrElse("0.6.25")
Option(System.getenv("SCALAJS_VERSION")).getOrElse("0.6.28")
val ScalaCross =
if (scalaJSVersion.startsWith("0.6")) {
Seq("2.10.7", "2.11.12", "2.12.7")
Seq("2.10.7", "2.11.12", "2.12.9")
} else {
Seq("2.11.12", "2.12.7")
Seq("2.11.12", "2.12.9")
}

val ScalaTest = "3.0.5"
val ScalaTest = "3.1.0-M2"
val ScalaTestOld = "3.0.7"
val ScalaCheck = "1.13.5"
val Json4s = "3.6.1"
val Json4s = "3.6.7"
}

object Dependencies {
val scalaTestOld = Def.setting(Seq("org.scalatest" %%% "scalatest" % Versions.ScalaTestOld % Test))
val scalaTest = Def.setting(Seq("org.scalatest" %%% "scalatest" % Versions.ScalaTest % Test))
val scalaCheck = Def.setting(Seq("org.scalacheck" %%% "scalacheck" % Versions.ScalaCheck % Test))
val json4s = Def.setting(Seq("org.json4s" %% "json4s-native" % Versions.Json4s % Test))
}

object Resolvers {
val typeSafeRepo = "Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases/"
val sonatypeNexusSnapshots = "Sonatype Nexus Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
val sonatypeNexusReleases = "Sonatype Nexus Releases" at "https://oss.sonatype.org/content/repositories/releases"
val sonatypeNexusStaging = "Sonatype Nexus Staging" at "https://oss.sonatype.org/service/local/staging/deploy/maven2"
Expand All @@ -51,7 +52,6 @@ object Project {
autoAPIMappings := true,

resolvers ++= Seq(
Resolvers.typeSafeRepo,
Resolvers.sonatypeNexusSnapshots,
Resolvers.sonatypeNexusReleases,
Resolvers.sonatypeNexusStaging
Expand All @@ -65,33 +65,42 @@ object Project {

object Compiler {
lazy val newerCompilerLintSwitches = Seq(
"-Xlint:missing-interpolator", // Not availabile in 2.10
"-Ywarn-unused", // Not available in 2.10
"-Ywarn-unused-import", // Not available in 2.10
"-Ywarn-numeric-widen" // In 2.10 this produces a some strange spurious error
"-Xlint:missing-interpolator",
"-Ywarn-unused",
"-Ywarn-unused-import",
"-Ywarn-numeric-widen",
"-deprecation:false"
)

val defaultSettings = Seq(
scalacOptions in ThisBuild ++= Seq(
"-feature",
lazy val defaultCompilerSwitches = Seq(
"-feature",
"-deprecation",
"-encoding", "UTF-8", // yes, this is 2 args
"-Xfatal-warnings",
"-unchecked",
"-Xfuture",
"-Ywarn-dead-code",
"-Yno-adapted-args"
)

lazy val defaultSettings = Seq(
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8", // yes, this is 2 args
"-Xfatal-warnings",
"-unchecked",
"-Xfuture",
"-Ywarn-dead-code",
"-Yno-adapted-args"
"-feature",
"-encoding", "UTF-8",
),

scalacOptions ++= PartialFunction.condOpt(CrossVersion.partialVersion(scalaVersion.value)){
case Some((2, scalaMajor)) if scalaMajor >= 11 => newerCompilerLintSwitches
}.toList.flatten,
scalacOptions := {CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, scalaMajor)) if scalaMajor >= 11 => scalacOptions.value ++ defaultCompilerSwitches ++ newerCompilerLintSwitches
case _ => scalacOptions.value ++ defaultCompilerSwitches
}},

scalaVersion in ThisBuild := Versions.Scala,

crossScalaVersions := Versions.ScalaCross
)

}

object Publish {
val defaultSettings = Seq(
publishTo := {
Expand Down Expand Up @@ -124,16 +133,12 @@ object Publish {

object Tests {
val defaultSettings =
if (Versions.scalaJSVersion.startsWith("0.6")) {
Seq(
libraryDependencies ++=
Dependencies.scalaTest.value ++
Dependencies.scalaCheck.value ++
Dependencies.json4s.value
)
} else {
Seq.empty
}
}

object Formatting {
Expand Down Expand Up @@ -169,7 +174,7 @@ object Formatting {

object Console {
val defaultSettings = Seq(
scalacOptions ~= (_ filterNot (Set("-Xfatal-warnings", "-Ywarn-unused-import").contains)),
scalacOptions in (Compile, console) ~= (_ filterNot (Set("-Xfatal-warnings", "-Ywarn-unused-import").contains)),

initialCommands in console := """
import scala.language.postfixOps,
Expand Down Expand Up @@ -250,6 +255,6 @@ object Docs {
val (bd, v) = ((baseDirectory in LocalRootProject).value, version.value)
val tagOrBranch = if(v endsWith "SNAPSHOT") gitHash else "v" + v
Seq("-sourcepath", bd.getAbsolutePath, "-doc-source-url", "https://github.com/garyKeorkunian/squants/tree/" + tagOrBranch + "€{FILE_PATH}.scala")
}
},
)
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.2.6
sbt.version=1.3.0
16 changes: 8 additions & 8 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "0.6.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.1")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "0.6.1")
val scalaJSVersion =
Option(System.getenv("SCALAJS_VERSION")).getOrElse("0.6.25")
Option(System.getenv("SCALAJS_VERSION")).getOrElse("0.6.28")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.8")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.9")

addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.2")

addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.5")

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.2")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2")

addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.9")
addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.12")
Loading

0 comments on commit 370d6c6

Please sign in to comment.