Skip to content

Commit e50bc75

Browse files
authored
Merge pull request #302 from dotty-staging/upstream
Migrations from Dotty
2 parents 988aaf3 + f1e2095 commit e50bc75

File tree

77 files changed

+91
-93
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+91
-93
lines changed

build.sbt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ lazy val squants = crossProject(JSPlatform, JVMPlatform, NativePlatform)
1515
.settings(defaultSettings: _*)
1616
.jvmSettings(
1717
osgiSettings,
18-
tutSettings,
1918
tutTargetDirectory := file("."),
2019
tutSourceDirectory := file("shared") / "src" / "main" / "tut"
2120
)
@@ -34,6 +33,6 @@ lazy val root = project.in(file("."))
3433
)
3534
.aggregate(squantsJVM, squantsJS, squantsNative)
3635

37-
lazy val squantsJVM = squants.jvm.enablePlugins(SbtOsgi)
36+
lazy val squantsJVM = squants.jvm.enablePlugins(TutPlugin, SbtOsgi)
3837
lazy val squantsJS = squants.js
3938
lazy val squantsNative = squants.native

project/Build.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@ object Tests {
124124

125125
object Formatting {
126126
import com.typesafe.sbt.SbtScalariform._
127+
import com.typesafe.sbt.SbtScalariform.autoImport.scalariformAutoformat
127128

128-
lazy val defaultSettings = scalariformSettings ++ Seq(
129+
lazy val defaultSettings = Seq(
130+
ScalariformKeys.autoformat := false,
129131
ScalariformKeys.preferences in Compile := defaultPreferences,
130132
ScalariformKeys.preferences in Test := defaultPreferences
131133
)
@@ -137,7 +139,7 @@ object Formatting {
137139
.setPreference(AlignSingleLineCaseStatements, true)
138140
.setPreference(CompactControlReadability, true)
139141
.setPreference(CompactStringConcatenation, false)
140-
.setPreference(DoubleIndentClassDeclaration, true)
142+
.setPreference(DoubleIndentConstructorArguments, true)
141143
.setPreference(FormatXml, true)
142144
.setPreference(IndentLocalDefs, false)
143145
.setPreference(IndentPackageBlocks, true)
@@ -228,7 +230,7 @@ object Console {
228230
}
229231

230232
object Docs {
231-
private def gitHash = sys.process.Process("git rev-parse HEAD").lines_!.head
233+
private def gitHash = sys.process.Process("git rev-parse HEAD").lineStream_!.head
232234
val defaultSettings = Seq(
233235
scalacOptions in (Compile, doc) ++= {
234236
val (bd, v) = ((baseDirectory in LocalRootProject).value, version.value)

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.15
1+
sbt.version=1.1.4

project/plugins.sbt

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.17")
1+
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.4.0")
2+
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "0.4.0")
3+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.22")
4+
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.7")
25

3-
addSbtPlugin("org.scala-native" % "sbt-crossproject" % "0.2.0")
6+
addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.2")
47

5-
addSbtPlugin("org.scala-native" % "sbt-scalajs-crossproject" % "0.2.0")
8+
addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.3")
69

7-
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.0")
10+
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1")
811

9-
addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.5.1")
12+
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3")
1013

11-
addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.8.0")
12-
13-
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.1")
14-
15-
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1")
16-
17-
addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.4.8")
14+
addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.4")

shared/src/main/scala/squants/Dimensionless.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ final class Dimensionless private (val value: Double, val unit: DimensionlessUni
4747
*/
4848
object Dimensionless extends Dimension[Dimensionless] {
4949
def apply[A](n: A, unit: DimensionlessUnit)(implicit num: Numeric[A]) = new Dimensionless(num.toDouble(n), unit)
50-
def apply = parse _
50+
def apply(value: Any) = parse(value)
5151
def name = "Dimensionless"
5252
def primaryUnit = Each
5353
def siUnit = Each

shared/src/main/scala/squants/electro/AreaElectricChargeDensity.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class AreaElectricChargeDensity private (val value: Double, val unit: Area
2323

2424
object AreaElectricChargeDensity extends Dimension[AreaElectricChargeDensity] {
2525
private[electro] def apply[A](n: A, unit: AreaElectricChargeDensityUnit)(implicit num: Numeric[A]) = new AreaElectricChargeDensity(num.toDouble(n), unit)
26-
def apply = parse _
26+
def apply(value: Any) = parse(value)
2727
def name = "AreaElectricChargeDensity"
2828
def primaryUnit = CoulombsPerSquareMeter
2929
def siUnit = CoulombsPerSquareMeter

shared/src/main/scala/squants/electro/Capacitance.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class Capacitance private (val value: Double, val unit: CapacitanceUnit)
3434

3535
object Capacitance extends Dimension[Capacitance] {
3636
private[electro] def apply[A](n: A, unit: CapacitanceUnit)(implicit num: Numeric[A]) = new Capacitance(num.toDouble(n), unit)
37-
def apply = parse _
37+
def apply(value: Any) = parse(value)
3838
def name = "Capacitance"
3939
def primaryUnit = Farads
4040
def siUnit = Farads

shared/src/main/scala/squants/electro/Conductivity.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class Conductivity private (val value: Double, val unit: ConductivityUnit)
3030

3131
object Conductivity extends Dimension[Conductivity] {
3232
private[electro] def apply[A](n: A, unit: ConductivityUnit)(implicit num: Numeric[A]) = new Conductivity(num.toDouble(n), unit)
33-
def apply = parse _
33+
def apply(value: Any) = parse(value)
3434
def name = "Conductivity"
3535
def primaryUnit = SiemensPerMeter
3636
def siUnit = SiemensPerMeter

shared/src/main/scala/squants/electro/ElectricCharge.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ final class ElectricCharge private (val value: Double, val unit: ElectricChargeU
4848

4949
object ElectricCharge extends Dimension[ElectricCharge] {
5050
private[electro] def apply[A](n: A, unit: ElectricChargeUnit)(implicit num: Numeric[A]) = new ElectricCharge(num.toDouble(n), unit)
51-
def apply = parse _
51+
def apply(value: Any) = parse(value)
5252
def name = "ElectricCharge"
5353
def primaryUnit = Coulombs
5454
def siUnit = Coulombs

shared/src/main/scala/squants/electro/ElectricChargeDensity.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class ElectricChargeDensity private (val value: Double, val unit: Electric
2424

2525
object ElectricChargeDensity extends Dimension[ElectricChargeDensity] {
2626
private[electro] def apply[A](n: A, unit: ElectricChargeDensityUnit)(implicit num: Numeric[A]) = new ElectricChargeDensity(num.toDouble(n), unit)
27-
def apply = parse _
27+
def apply(value: Any) = parse(value)
2828
def name = "ElectricChargeDensity"
2929
def primaryUnit = CoulombsPerCubicMeter
3030
def siUnit = CoulombsPerCubicMeter

0 commit comments

Comments
 (0)