Skip to content

Scala 2.13.0 RC2 testing #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ tzdb/js/src/main/resources/
/.idea/
/threetenbp.iml
.metaserver/
.bloop/
.metals/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ cache:
script:
- sudo chmod +x /usr/local/bin/sbt
- sbt ++$TRAVIS_SCALA_VERSION -J-Xmx4G clean scalajavatimeJVM/compile scalajavatimeTestsJVM/compile
- if [[ $TRAVIS_SCALA_VERSION != "2.13.0-RC2" ]]; then sbt ++$TRAVIS_SCALA_VERSION -J-Xmx4G clean scalajavatimeTestsJVM/test scalajavatimeTestsJS/test scalajavatimeJVM/publishLocal scalajavatimeJS/publishLocal scalajavatimeTZDBJVM/publishLocal scalajavatimeTZDBJS/publishLocal; fi;
- sbt ++$TRAVIS_SCALA_VERSION -J-Xmx4G clean scalajavatimeTestsJVM/test scalajavatimeTestsJS/test scalajavatimeJVM/publishLocal scalajavatimeJS/publishLocal scalajavatimeTZDBJVM/publishLocal scalajavatimeTZDBJS/publishLocal
# docs/makeMicrosite
# Tricks to avoid unnecessary cache updates, from
# http://www.scala-sbt.org/0.13/docs/Travis-CI-with-sbt.html
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Scala 2.11, Scala 2.12 and Scala 2.13-M4 are supported.

To get started with SBT, add one (or both) of these dependencies:

- `libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.0.0-M13"` (for Scala)
- `libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.0.0-M13"` (for Scala.js, [Scala.js plugin](http://www.scala-js.org/tutorial/basic/#sbt-setup) required)
- `libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.0.0-RC2"` (for Scala)
- `libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.0.0-RC2"` (for Scala.js, [Scala.js plugin](http://www.scala-js.org/tutorial/basic/#sbt-setup) required)

#### Documentation

Expand Down
8 changes: 5 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import sbt._
import sbt.io.Using

val scalaVer = "2.12.8"
val tzdbVersion = "2018f"
val scalaJavaTimeVer = "2.0.0-RC1"
val tzdbVersion = "2019a"
val scalaJavaTimeVer = "2.0.0-RC2"
val scalaJavaTimeVersion = s"$scalaJavaTimeVer"
val scalaTZDBVersion = s"${scalaJavaTimeVer}_$tzdbVersion"

Expand Down Expand Up @@ -148,7 +148,7 @@ lazy val scalajavatime = crossProject(JVMPlatform, JSPlatform)
copyAndReplace(srcDirs, destinationDir)
}.taskValue,
libraryDependencies ++= Seq(
"io.github.cquiroz" %%% "scala-java-locales" % "0.3.12-cldr34"
"io.github.cquiroz" %%% "scala-java-locales" % "0.3.14-cldr35"
)
)

Expand Down Expand Up @@ -187,6 +187,8 @@ lazy val scalajavatimeTests = crossProject(JVMPlatform, JSPlatform)
Keys.`package` := file(""),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, scalaMajor)) if scalaMajor == 13 =>
Seq("org.scalatest" %%% "scalatest" % "3.1.0-SNAP11" % "test")
case Some((2, scalaMajor)) if scalaMajor <= 12 && (scalaJSVersion.startsWith("0.6.")) =>
Seq("org.scalatest" %%% "scalatest" % "3.0.7" % "test")
case _ => Seq.empty
Expand Down
13 changes: 13 additions & 0 deletions changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
<author>Stephen Colebourne (Java version)</author>
</properties>
<body>
<!-- types are add, fix, remove, update -->
<release version="2.0.0-RC2" date="" description="v2.0.0-RC2">
<action dev="cquiroz" type="update" >
Support scala.js 0.6.27
</action>
<action dev="cquiroz" type="update" >
Support scala.js 1.0.0-M7
</action>
<action dev="cquiroz" type="update" >
Support scala 2.13.0-RC2
</action>
</release>
<!-- types are add, fix, remove, update -->
<release version="2.0.0-RC1" date="" description="v2.0.0-RC1">
<action dev="cquiroz" type="update" >
Expand Down Expand Up @@ -48,6 +60,7 @@
<action dev="cquiroz" type="upstream" >
Avoid copying the set of available time-zone IDs
</action>
</release>
<release version="2.0.0-M13" date="2018-02-21" description="v2.0.0-M13">
<action dev="cquiroz" type="update" >
Update to scala.js 0.6.22
Expand Down
14 changes: 7 additions & 7 deletions docs/src/main/tut/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ Both Scala 2.11 and Scala 2.12 (2.0.0-M8 and later) are supported.

To get started with SBT, add one of these dependencies:

* `libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.0.0-RC1"` (for Scala)
* `libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.0.0-RC1"` (for Scala.js, [Scala.js plugin](http://www.scala-js.org/tutorial/basic/#sbt-setup) required)
* `libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.0.0-RC2"` (for Scala)
* `libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.0.0-RC2"` (for Scala.js, [Scala.js plugin](http://www.scala-js.org/tutorial/basic/#sbt-setup) required)

To get the latest snapshots add the repo

Expand All @@ -70,8 +70,8 @@ resolvers +=

and either:

* `libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.0.0-RC2-SNAPSHOT"` (for Scala)
* `libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.0.0-RC2-SNAPSHOT"` (for Scala.js, [Scala.js plugin](http://www.scala-js.org/tutorial/basic/#sbt-setup) required)
* `libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.0.0-RC3-SNAPSHOT"` (for Scala)
* `libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.0.0-RC3-SNAPSHOT"` (for Scala.js, [Scala.js plugin](http://www.scala-js.org/tutorial/basic/#sbt-setup) required)

### Time zones

Expand All @@ -84,7 +84,7 @@ If you don't need to use timezones in your application you can just stop here. B
The timezone for js is provided in a separate bundle which contains all time zones available from
[IANA Time Zone Database](https://www.iana.org/time-zones). To use them you need to add the following dependency

* `libraryDependencies += "io.github.cquiroz" %%% "scala-java-time-tzdb" % "2.0.0-RC1_2018f"` (for Scala.js, [Scala.js plugin](http://www.scala-js.org/tutorial/basic/#sbt-setup) required)
* `libraryDependencies += "io.github.cquiroz" %%% "scala-java-time-tzdb" % "2.0.0-RC2_2019a"` (for Scala.js, [Scala.js plugin](http://www.scala-js.org/tutorial/basic/#sbt-setup) required)

Note that the db is fairly large and due to the characteristics of the API it's not very ammenable to optimization
This database is published every now and then so it maybe old. For current version see the following section.
Expand All @@ -101,7 +101,7 @@ To do that you need to:
* Add `sbt-tzdb` to your list of plugins (Note you need sbt 1.x)

```scala
addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % "0.3.1")
addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % "0.3.2")
```

* Enable the plugin for your `Scala.js` project:
Expand Down Expand Up @@ -154,7 +154,7 @@ Have a look at the [issues](https://github.com/cquiroz/scala-java-time/issues) o

##### 2.0

A stable release of 2.0 will be published with only `java.time` on its binary after RC-2 is published.
A stable release of 2.0 will be published with only `java.time` on its binary after RC3 is published.

#### FAQs

Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/tut/release_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ docs/publishMicrosite

Important: Remember to clean between different scala.js versions

on 1.0.0-M6
on 1.0.0-M7

```
SCALAJS_VERSION=1.0.0-M6 sbt
SCALAJS_VERSION=1.0.0-M7 sbt
clean
+publishSigned
sonatyeRelease
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)

addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")

addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % "0.3.1")
addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % "0.3.2")
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ object UsabilityChrono {
System.out.printf(" 1st of year: %s; end of year: %s%n", first, last)
val before: LocalDate = LocalDate.of(-500, 1, 1)
val chronos: java.util.Set[Chronology] = Chronology.getAvailableChronologies
import scala.collection.JavaConversions._
for (chrono <- chronos) {
import scala.collection.JavaConverters._
for (chrono <- chronos.asScala) {
val date: ChronoLocalDate = chrono.dateNow
val date2: ChronoLocalDate = chrono.date(before)
System.out.printf(" %20s: %22s, %22s%n", chrono.getId, date, date2)
Expand Down Expand Up @@ -173,4 +173,4 @@ object UsabilityChrono {
c = IsoChronology.INSTANCE
c.toString
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ object TestTzdbZoneRulesCompiler {
"org$threeten$bp$zone$TzdbZoneRulesCompiler$$parseLeapSecondRule" // !!! WTF?
else if (scalaVersion.startsWith("2.12"))
"parseLeapSecondRule"
else if (scalaVersion.startsWith("2.13"))
"parseLeapSecondRule"
else
???
PARSE_LSR = classOf[TzdbZoneRulesCompiler].getDeclaredMethod(methodName, classOf[String])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ object FluentAPIChecker {
dow = dow.plus(1)
val offset: ZoneOffset = ZoneOffset.ofHours(1)
val paris: ZoneId = ZoneId.of("Europe/Paris")
import scala.collection.JavaConversions._
for (trans <- paris.getRules.getTransitions) {
import scala.collection.JavaConverters._
for (trans <- paris.getRules.getTransitions.asScala) {
System.out.println("Paris transition: " + trans)
}
System.out.println("Summer time Paris starts: " + paris.getRules.getTransitionRules.get(0))
Expand All @@ -111,4 +111,4 @@ object FluentAPIChecker {
i += 1
}
}
}
}
55 changes: 19 additions & 36 deletions tests/shared/src/test/scala/org/threeten/bp/Performance.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import java.util.Map
import java.util.Random
import java.util.TreeMap
import org.threeten.bp.format.DateTimeFormatter
import scala.collection.JavaConverters._

/** Test Performance. */
object Performance {
Expand Down Expand Up @@ -88,13 +89,11 @@ object Performance {
}
}
System.out.println()
import scala.collection.JavaConversions._
for (name <- RESULTS.keySet) {
for (name <- RESULTS.keySet.asScala) {
System.out.println(name + " " + Arrays.toString(RESULTS.get(name)))
}
System.out.println()
import scala.collection.JavaConversions._
for (name <- RESULTS.keySet) {
for (name <- RESULTS.keySet.asScala) {
val r: Array[Long] = RESULTS.get(name)
val percent: BigDecimal = BigDecimal.valueOf(r(6), 1)
var max: String = " " + NF.format(r(0))
Expand Down Expand Up @@ -167,8 +166,7 @@ object Performance {
private def queryListDateTime(list: java.util.List[LocalDateTime]): Unit = {
var total: Long = 0
val start: Long = System.nanoTime
import scala.collection.JavaConversions._
for (dt <- list) {
for (dt <- list.asScala) {
total += dt.getYear
total += dt.getMonth.getValue
total += dt.getDayOfMonth
Expand All @@ -185,8 +183,7 @@ object Performance {
val buf: StringBuilder = new StringBuilder
val format: DateTimeFormatter = DateTimeFormatter.ISO_DATE.withLocale(Locale.ENGLISH)
val start: Long = System.nanoTime
import scala.collection.JavaConversions._
for (dt <- list) {
for (dt <- list.asScala) {
buf.setLength(0)
buf.append(format.format(dt))
}
Expand All @@ -198,8 +195,7 @@ object Performance {
private def deriveDateTime(list: java.util.List[LocalDateTime]): Unit = {
var total: Long = 0
val start: Long = System.nanoTime
import scala.collection.JavaConversions._
for (dt <- list) {
for (dt <- list.asScala) {
total += dt.get(YEAR)
total += dt.get(MONTH_OF_YEAR)
total += dt.get(DAY_OF_MONTH)
Expand Down Expand Up @@ -238,8 +234,7 @@ object Performance {
private def queryListLocalDate(list: java.util.List[LocalDate]): Unit = {
var total: Long = 0
val start: Long = System.nanoTime
import scala.collection.JavaConversions._
for (dt <- list) {
for (dt <- list.asScala) {
total += dt.getYear
total += dt.getMonth.getValue
total += dt.getDayOfMonth
Expand All @@ -253,8 +248,7 @@ object Performance {
val buf: StringBuilder = new StringBuilder
val format: DateTimeFormatter = DateTimeFormatter.ISO_DATE.withLocale(Locale.ENGLISH)
val start: Long = System.nanoTime
import scala.collection.JavaConversions._
for (dt <- list) {
for (dt <- list.asScala) {
buf.setLength(0)
buf.append(format.format(dt))
}
Expand Down Expand Up @@ -290,8 +284,7 @@ object Performance {
private def queryListTime(list: java.util.List[LocalTime]): Unit = {
var total: Long = 0
val start: Long = System.nanoTime
import scala.collection.JavaConversions._
for (dt <- list) {
for (dt <- list.asScala) {
total += dt.getHour
total += dt.getMinute
total += dt.getSecond
Expand All @@ -306,8 +299,7 @@ object Performance {
val buf: StringBuilder = new StringBuilder
val format: DateTimeFormatter = DateTimeFormatter.ISO_TIME.withLocale(Locale.ENGLISH)
val start: Long = System.nanoTime
import scala.collection.JavaConversions._
for (dt <- list) {
for (dt <- list.asScala) {
buf.setLength(0)
buf.append(format.format(dt))
}
Expand All @@ -319,8 +311,7 @@ object Performance {
private def deriveTime(list: java.util.List[LocalTime]): Unit = {
var total: Long = 0
val start: Long = System.nanoTime
import scala.collection.JavaConversions._
for (dt <- list) {
for (dt <- list.asScala) {
total += dt.get(HOUR_OF_DAY)
total += dt.get(MINUTE_OF_HOUR)
total += dt.get(SECOND_OF_MINUTE)
Expand Down Expand Up @@ -359,8 +350,7 @@ object Performance {
private def queryListZonedDateTime(list: java.util.List[ZonedDateTime]): Unit = {
var total: Long = 0
val start: Long = System.nanoTime
import scala.collection.JavaConversions._
for (dt <- list) {
for (dt <- list.asScala) {
total += dt.getYear
total += dt.getMonth.getValue
total += dt.getDayOfMonth
Expand All @@ -377,8 +367,7 @@ object Performance {
val buf: StringBuilder = new StringBuilder
val format: DateTimeFormatter = DateTimeFormatter.ISO_DATE.withLocale(Locale.ENGLISH)
val start: Long = System.nanoTime
import scala.collection.JavaConversions._
for (dt <- list) {
for (dt <- list.asScala) {
buf.setLength(0)
buf.append(format.format(dt))
}
Expand Down Expand Up @@ -414,8 +403,7 @@ object Performance {
private def queryListInstant(list: java.util.List[Instant]): Unit = {
var total: Long = 0
val start: Long = System.nanoTime
import scala.collection.JavaConversions._
for (dt <- list) {
for (dt <- list.asScala) {
total += dt.getEpochSecond
total += dt.getNano
}
Expand All @@ -427,8 +415,7 @@ object Performance {
private def formatListInstant(list: java.util.List[Instant]): Unit = {
val buf: StringBuilder = new StringBuilder
val start: Long = System.nanoTime
import scala.collection.JavaConversions._
for (dt <- list) {
for (dt <- list.asScala) {
buf.setLength(0)
buf.append(dt.toString)
}
Expand Down Expand Up @@ -464,8 +451,7 @@ object Performance {
private def queryListDate(list: java.util.List[Date]): Unit = {
var total: Long = 0
val start: Long = System.nanoTime
import scala.collection.JavaConversions._
for (dt <- list) {
for (dt <- list.asScala) {
total += dt.getTime
}
val end: Long = System.nanoTime
Expand All @@ -476,8 +462,7 @@ object Performance {
private def formatListDate(list: java.util.List[Date]): Unit = {
val buf: StringBuilder = new StringBuilder
val start: Long = System.nanoTime
import scala.collection.JavaConversions._
for (dt <- list) {
for (dt <- list.asScala) {
buf.setLength(0)
buf.append(dt.toString)
}
Expand Down Expand Up @@ -516,8 +501,7 @@ object Performance {
private def queryListGCal(list: java.util.List[GregorianCalendar]): Unit = {
var total: Long = 0
val start: Long = System.nanoTime
import scala.collection.JavaConversions._
for (gcal <- list) {
for (gcal <- list.asScala) {
total += gcal.get(Calendar.YEAR)
total += gcal.get(Calendar.MONTH + 1)
total += gcal.get(Calendar.DAY_OF_MONTH)
Expand All @@ -535,8 +519,7 @@ object Performance {
val buf: StringBuilder = new StringBuilder
val format: SimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH)
val start: Long = System.nanoTime
import scala.collection.JavaConversions._
for (gcal <- list) {
for (gcal <- list.asScala) {
buf.setLength(0)
buf.append(format.format(gcal.getTime))
}
Expand Down
Loading