Skip to content

Commit

Permalink
Across the board dependency updates
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Quiroz <[email protected]>
  • Loading branch information
cquiroz committed Oct 30, 2018
1 parent f758b96 commit 90ceb81
Show file tree
Hide file tree
Showing 19 changed files with 144 additions and 125 deletions.
22 changes: 8 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
language: scala

scala:
- 2.10.6
- 2.11.11
- 2.11.12
- 2.12.7

jdk:
- oraclejdk7
- oraclejdk8

matrix:
include:
- scala: 2.12.2
jdk: oraclejdk8
env:
- TRAVIS_NODE_VERSION="6"
- openjdk11

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

env:
- TRAVIS_NODE_VERSION="6"
- TRAVIS_NODE_VERSION="10.9.0" SCALAJS_VERSION="0.6.25"
- TRAVIS_NODE_VERSION="10.9.0" SCALAJS_VERSION="1.0.0-M6"

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 @@ -41,9 +35,9 @@ before_cache:

script:
# Your normal script
- sbt ++$TRAVIS_SCALA_VERSION squantsJVM/test:compile squantsJS/test:compile squantsJS/fastOptJS
- if [[ $TRAVIS_SCALA_VERSION == "2.11.11" ]]; then sbt ++$TRAVIS_SCALA_VERSION squantsNative/compile; fi;
- sbt ++$TRAVIS_SCALA_VERSION squantsJS/test squantsJVM/test
- 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
Expand Down
100 changes: 53 additions & 47 deletions README.md

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
import sbtcrossproject.{crossProject, CrossType}
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}

lazy val defaultSettings =
Project.defaultSettings ++
Compiler.defaultSettings ++
Publish.defaultSettings ++
Tests.defaultSettings ++
Formatting.defaultSettings ++
Console.defaultSettings ++
Docs.defaultSettings

lazy val squants = crossProject(JSPlatform, JVMPlatform, NativePlatform)
lazy val squants =
crossProject(JSPlatform, JVMPlatform, NativePlatform)
.crossType(CrossType.Full)
.in(file("."))
.settings(defaultSettings: _*)
.jvmConfigure(
_.enablePlugins(TutPlugin, SbtOsgi)
)
.jvmSettings(
osgiSettings,
tutTargetDirectory := file("."),
tutSourceDirectory := file("shared") / "src" / "main" / "tut"
)
.jvmSettings(Tests.defaultSettings: _*)
.jsSettings(
parallelExecution in Test := false,
excludeFilter in Test := "*Serializer.scala" || "*SerializerSpec.scala"
)
.jsSettings(Tests.defaultSettings: _*)

lazy val root = project.in(file("."))
.settings(defaultSettings: _*)
Expand All @@ -31,8 +36,4 @@ lazy val root = project.in(file("."))
publishLocal := {},
publishArtifact := false
)
.aggregate(squantsJVM, squantsJS, squantsNative)

lazy val squantsJVM = squants.jvm.enablePlugins(TutPlugin, SbtOsgi)
lazy val squantsJS = squants.js
lazy val squantsNative = squants.native
.aggregate(squants.jvm, squants.js, squants.native)
38 changes: 26 additions & 12 deletions project/Build.scala
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
import scalanativecrossproject.ScalaNativeCrossPlugin.autoImport._
import sbt.Keys._
import sbt._
import com.typesafe.sbt.osgi.SbtOsgi
import com.typesafe.sbt.osgi.SbtOsgi.autoImport._

object Versions {
val Squants = "1.3.0"
val Scala = "2.11.11"
val ScalaCross = Seq("2.12.2", "2.11.11", "2.10.6")
val Squants = "1.4.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")
val ScalaCross =
if (scalaJSVersion.startsWith("0.6")) {
Seq("2.10.7", "2.11.12", "2.12.7")
} else {
Seq("2.11.12", "2.12.7")
}

val ScalaTest = "3.0.3"
val ScalaTest = "3.0.5"
val ScalaCheck = "1.13.5"
val Json4s = "3.5.1"
val Json4s = "3.6.1"
}

object Dependencies {
Expand Down Expand Up @@ -114,12 +123,17 @@ object Publish {
}

object Tests {
val defaultSettings = Seq(
libraryDependencies ++=
Dependencies.scalaTest.value ++
Dependencies.scalaCheck.value ++
Dependencies.json4s.value
)
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
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.1.4
sbt.version=1.2.6
13 changes: 8 additions & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.4.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "0.4.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.22")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.7")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "0.6.0")
val scalaJSVersion =
Option(System.getenv("SCALAJS_VERSION")).getOrElse("0.6.25")

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

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

Expand All @@ -11,4 +14,4 @@ addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3")

addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.4")
addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.9")
3 changes: 1 addition & 2 deletions shared/src/main/scala/squants/energy/Power.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package squants.energy

import squants._
import squants.electro.{ Amperes, ElectricCurrent, ElectricPotential, Volts }
import squants.radio.{ Irradiance, RadiantIntensity, SpectralPower, _ }
import squants.radio.{ Irradiance, RadiantIntensity, SpectralPower, WattsPerMeter, WattsPerSquareMeter, WattsPerSteradian }
import squants.space.{ SolidAngle, SquareMeters, SquaredRadians }
import squants.time.{ Hours, TimeDerivative, TimeIntegral }

Expand Down Expand Up @@ -147,4 +147,3 @@ object PowerConversions {

implicit object PowerNumeric extends AbstractQuantityNumeric[Power](Power.primaryUnit)
}

2 changes: 0 additions & 2 deletions shared/src/main/scala/squants/market/MoneyContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

package squants.market

import scala.collection.SortedSet

/**
* MoneyContext
*
Expand Down
2 changes: 1 addition & 1 deletion shared/src/main/scala/squants/mass/AreaDensity.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
package squants.mass

import squants._
import squants.space.{Acres, SquareMeters}
import squants.space.Acres

/**
* @author garyKeorkunian
Expand Down
2 changes: 1 addition & 1 deletion shared/src/main/scala/squants/motion/Acceleration.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package squants.motion

import squants._
import squants.space.{ Feet, Millimeters, UsMiles }
import squants.time.{ Seconds, _ }
import squants.time.{ Seconds, TimeDerivative, TimeIntegral, SecondTimeDerivative, TimeSquared, Time }

/**
* Represents a quantity of acceleration
Expand Down
6 changes: 3 additions & 3 deletions shared/src/main/scala/squants/motion/Torque.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package squants.motion

import squants.mass.{Kilograms, MomentOfInertia, Pounds}
import squants.mass.{MomentOfInertia, Pounds}
import squants.space.{Feet, Meters}
import squants.{AbstractQuantityNumeric, Dimension, Energy, PrimaryUnit, Quantity, SiBaseUnit, UnitConverter, UnitOfMeasure}
import squants.{AbstractQuantityNumeric, Dimension, PrimaryUnit, Quantity, SiBaseUnit, UnitConverter, UnitOfMeasure}

/**
*
Expand Down Expand Up @@ -58,4 +58,4 @@ object TorqueConversions {
}

implicit object TorqueNumeric extends AbstractQuantityNumeric[Torque](Torque.primaryUnit)
}
}
36 changes: 21 additions & 15 deletions shared/src/main/tut/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.2.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.4.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.3.0**
([API Docs](https://oss.sonatype.org/service/local/repositories/releases/archive/org/typelevel/squants_2.11/1.3.0/squants_2.11-1.3.0-javadoc.jar/!/index.html#squants.package))
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))

Development Build: **1.4.0-SNAPSHOT**
([API Docs](https://oss.sonatype.org/service/local/repositories/snapshots/archive/org/typelevel/squants_2.11/1.4.0-SNAPSHOT/squants_2.11-1.4.0-SNAPSHOT-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))

[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.3.0"
"org.typelevel" %% "squants" % "1.4.0"
or

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


To use Squants in your Maven project add the following dependency
Expand All @@ -50,12 +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.3.0</version>
<version>1.4.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

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

Expand Down Expand Up @@ -499,7 +500,7 @@ This will fail because `lower` = `upper`:
QuantityRange(1.km, 1.km)
```

`QuantityRange` contains two functions that check if an element is part of the range, `contains` and `includes`.
`QuantityRange` contains two functions that check if an element is part of the range, `contains` and `includes`.
These differ in how they treat the range's upper bound: `contains()` _excludes_ it but `includes()` _includes_ it.

```tut
Expand Down Expand Up @@ -532,7 +533,7 @@ val rs3 = range / Kilowatts(400)
### QuantityRange operations

`QuantityRange` supports foreach, map, and foldLeft/foldRight. These vary slightly from the versions
in the Scala standard library in that they take a divisior as the first parameter. The examples below
in the Scala standard library in that they take a divisior as the first parameter. The examples below
illustrate their use.

Subdivide range into 1-Megawatt "slices", and foreach over each of slices:
Expand Down Expand Up @@ -742,7 +743,7 @@ import squants.{Quantity, Dimension}
import squants.space._
import squants.experimental.unitgroups.UnitGroup
val usCookingUnitGroup = new UnitGroup[Volume] {
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)
}
Expand All @@ -757,7 +758,7 @@ applicable.

## Formatters

Squants provides an experimental API for formatting Quantities in the "best unit." For example,
Squants provides an experimental API for formatting Quantities in the "best unit." For example,
convert Inches(12) to Feet(1). This is useful for producing human-friendly output.

To use a formatter, you must implement the `squants.formatters.Formatter` trait:
Expand All @@ -770,7 +771,7 @@ trait Formatter[A <: Quantity[A]] {

### Default Formatter implementation

There is a default formatter implementation in `squants.experimental.formatter.DefaultFormatter`. This builds on the `UnitGroup`
There is a default formatter implementation in `squants.experimental.formatter.DefaultFormatter`. This builds on the `UnitGroup`
API discussed above to choose the best `UnitOfMeasure` for a `Quantity`. The `DefaultFormatter` algorithm will probably
work for most use-cases, but users can create their own `Formatters` if they have custom needs.

Expand Down Expand Up @@ -823,7 +824,7 @@ import squants.experimental.unitgroups.misc.AstronomicalLengthUnitGroup

```tut:book
implicit val astroFormatter = new DefaultFormatter(AstronomicalLengthUnitGroup)
val earthToJupiter = 588000000.km
val earthToVoyager1 = 2.06e10.km
val earthToAlphaCentauri = 4.1315e+13.km
Expand All @@ -841,7 +842,7 @@ This example won't compile because there is no `Formatter[Mass]` in implicit sco

### SI Formatters and implicit syntax

When using SI units, and the default formatter algorithm, you don't have to declare a `Formatter` and place it in
When using SI units, and the default formatter algorithm, you don't have to declare a `Formatter` and place it in
implicit scope. The compiler can do that for you. This creates a very human-friendly API by using the appropriate
imports.

Expand Down Expand Up @@ -1204,6 +1205,11 @@ To make a release do the following:
sbt squantsNative/publishSigned
```

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

* Then make a release (Note: after this step the release cannot be replaced)
```
sbt sonatypeRelease
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package squants.electro
import org.scalatest.{FlatSpec, Matchers}
import squants.QuantityParseException
import squants.mass.Kilograms
import squants.space.{CubicMeters, Meters, SquareMeters}

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package squants.electro

import org.scalatest.{FlatSpec, Matchers}
import squants.QuantityParseException
import squants.space.{CubicMeters, Meters, SquareMeters}
import squants.space.Meters

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
package squants.electro

import org.scalatest.{FlatSpec, Matchers}
import squants.{MetricSystem, QuantityParseException}
import squants.QuantityParseException
import squants.space.Meters

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.scalatest.{FlatSpec, Matchers}
import squants.UnitOfMeasure
import squants.mass.{Kilograms, Mass}
import squants.mass.MassConversions._
import squants.space.{Inches, Length, Yards, UsMiles}
import squants.space.{Inches, Yards, UsMiles}
import squants.space.LengthConversions._
import squants.experimental.unitgroups.UnitGroup
import squants.experimental.unitgroups.uscustomary.space.UsCustomaryLengths
Expand Down
Loading

0 comments on commit 90ceb81

Please sign in to comment.