Skip to content

Commit e240461

Browse files
authored
Merge pull request #99 from cquiroz/scala-2.13.0-RC1
Scala 2.13.0 RC2 testing
2 parents 4c16e52 + 0234722 commit e240461

19 files changed

+89
-106
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@ tzdb/js/src/main/resources/
3636
/.idea/
3737
/threetenbp.iml
3838
.metaserver/
39+
.bloop/
40+
.metals/

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ cache:
4848
script:
4949
- sudo chmod +x /usr/local/bin/sbt
5050
- sbt ++$TRAVIS_SCALA_VERSION -J-Xmx4G clean scalajavatimeJVM/compile scalajavatimeTestsJVM/compile
51-
- 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;
51+
- sbt ++$TRAVIS_SCALA_VERSION -J-Xmx4G clean scalajavatimeTestsJVM/test scalajavatimeTestsJS/test scalajavatimeJVM/publishLocal scalajavatimeJS/publishLocal scalajavatimeTZDBJVM/publishLocal scalajavatimeTZDBJS/publishLocal
5252
# docs/makeMicrosite
5353
# Tricks to avoid unnecessary cache updates, from
5454
# http://www.scala-sbt.org/0.13/docs/Travis-CI-with-sbt.html

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Scala 2.11, Scala 2.12 and Scala 2.13-M4 are supported.
1717

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

20-
- `libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.0.0-M13"` (for Scala)
21-
- `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)
20+
- `libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.0.0-RC2"` (for Scala)
21+
- `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)
2222

2323
#### Documentation
2424

build.sbt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import sbt._
33
import sbt.io.Using
44

55
val scalaVer = "2.12.8"
6-
val tzdbVersion = "2018f"
7-
val scalaJavaTimeVer = "2.0.0-RC1"
6+
val tzdbVersion = "2019a"
7+
val scalaJavaTimeVer = "2.0.0-RC2"
88
val scalaJavaTimeVersion = s"$scalaJavaTimeVer"
99
val scalaTZDBVersion = s"${scalaJavaTimeVer}_$tzdbVersion"
1010

@@ -148,7 +148,7 @@ lazy val scalajavatime = crossProject(JVMPlatform, JSPlatform)
148148
copyAndReplace(srcDirs, destinationDir)
149149
}.taskValue,
150150
libraryDependencies ++= Seq(
151-
"io.github.cquiroz" %%% "scala-java-locales" % "0.3.12-cldr34"
151+
"io.github.cquiroz" %%% "scala-java-locales" % "0.3.14-cldr35"
152152
)
153153
)
154154

@@ -187,6 +187,8 @@ lazy val scalajavatimeTests = crossProject(JVMPlatform, JSPlatform)
187187
Keys.`package` := file(""),
188188
libraryDependencies ++= {
189189
CrossVersion.partialVersion(scalaVersion.value) match {
190+
case Some((2, scalaMajor)) if scalaMajor == 13 =>
191+
Seq("org.scalatest" %%% "scalatest" % "3.1.0-SNAP11" % "test")
190192
case Some((2, scalaMajor)) if scalaMajor <= 12 && (scalaJSVersion.startsWith("0.6.")) =>
191193
Seq("org.scalatest" %%% "scalatest" % "3.0.7" % "test")
192194
case _ => Seq.empty

changes.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@
88
<author>Stephen Colebourne (Java version)</author>
99
</properties>
1010
<body>
11+
<!-- types are add, fix, remove, update -->
12+
<release version="2.0.0-RC2" date="" description="v2.0.0-RC2">
13+
<action dev="cquiroz" type="update" >
14+
Support scala.js 0.6.27
15+
</action>
16+
<action dev="cquiroz" type="update" >
17+
Support scala.js 1.0.0-M7
18+
</action>
19+
<action dev="cquiroz" type="update" >
20+
Support scala 2.13.0-RC2
21+
</action>
22+
</release>
1123
<!-- types are add, fix, remove, update -->
1224
<release version="2.0.0-RC1" date="" description="v2.0.0-RC1">
1325
<action dev="cquiroz" type="update" >
@@ -48,6 +60,7 @@
4860
<action dev="cquiroz" type="upstream" >
4961
Avoid copying the set of available time-zone IDs
5062
</action>
63+
</release>
5164
<release version="2.0.0-M13" date="2018-02-21" description="v2.0.0-M13">
5265
<action dev="cquiroz" type="update" >
5366
Update to scala.js 0.6.22

docs/src/main/tut/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ Both Scala 2.11 and Scala 2.12 (2.0.0-M8 and later) are supported.
5858

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

61-
* `libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.0.0-RC1"` (for Scala)
62-
* `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)
61+
* `libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.0.0-RC2"` (for Scala)
62+
* `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)
6363

6464
To get the latest snapshots add the repo
6565

@@ -70,8 +70,8 @@ resolvers +=
7070

7171
and either:
7272

73-
* `libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.0.0-RC2-SNAPSHOT"` (for Scala)
74-
* `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)
73+
* `libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.0.0-RC3-SNAPSHOT"` (for Scala)
74+
* `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)
7575

7676
### Time zones
7777

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

87-
* `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)
87+
* `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)
8888

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

103103
```scala
104-
addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % "0.3.1")
104+
addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % "0.3.2")
105105
```
106106

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

155155
##### 2.0
156156

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

159159
#### FAQs
160160

docs/src/main/tut/release_process.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ docs/publishMicrosite
99

1010
Important: Remember to clean between different scala.js versions
1111

12-
on 1.0.0-M6
12+
on 1.0.0-M7
1313

1414
```
15-
SCALAJS_VERSION=1.0.0-M6 sbt
15+
SCALAJS_VERSION=1.0.0-M7 sbt
1616
clean
1717
+publishSigned
1818
sonatyeRelease

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
1414

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

17-
addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % "0.3.1")
17+
addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % "0.3.2")

tests/jvm/src/test/scala/org/threeten/bp/UsabilityChrono.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ object UsabilityChrono {
114114
System.out.printf(" 1st of year: %s; end of year: %s%n", first, last)
115115
val before: LocalDate = LocalDate.of(-500, 1, 1)
116116
val chronos: java.util.Set[Chronology] = Chronology.getAvailableChronologies
117-
import scala.collection.JavaConversions._
118-
for (chrono <- chronos) {
117+
import scala.collection.JavaConverters._
118+
for (chrono <- chronos.asScala) {
119119
val date: ChronoLocalDate = chrono.dateNow
120120
val date2: ChronoLocalDate = chrono.date(before)
121121
System.out.printf(" %20s: %22s, %22s%n", chrono.getId, date, date2)
@@ -173,4 +173,4 @@ object UsabilityChrono {
173173
c = IsoChronology.INSTANCE
174174
c.toString
175175
}
176-
}
176+
}

tests/jvm/src/test/scala/org/threeten/bp/zone/TestTzdbZoneRulesCompiler.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ object TestTzdbZoneRulesCompiler {
7777
"org$threeten$bp$zone$TzdbZoneRulesCompiler$$parseLeapSecondRule" // !!! WTF?
7878
else if (scalaVersion.startsWith("2.12"))
7979
"parseLeapSecondRule"
80+
else if (scalaVersion.startsWith("2.13"))
81+
"parseLeapSecondRule"
8082
else
8183
???
8284
PARSE_LSR = classOf[TzdbZoneRulesCompiler].getDeclaredMethod(methodName, classOf[String])

tests/shared/src/test/scala/org/threeten/bp/FluentAPIChecker.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ object FluentAPIChecker {
8383
dow = dow.plus(1)
8484
val offset: ZoneOffset = ZoneOffset.ofHours(1)
8585
val paris: ZoneId = ZoneId.of("Europe/Paris")
86-
import scala.collection.JavaConversions._
87-
for (trans <- paris.getRules.getTransitions) {
86+
import scala.collection.JavaConverters._
87+
for (trans <- paris.getRules.getTransitions.asScala) {
8888
System.out.println("Paris transition: " + trans)
8989
}
9090
System.out.println("Summer time Paris starts: " + paris.getRules.getTransitionRules.get(0))
@@ -111,4 +111,4 @@ object FluentAPIChecker {
111111
i += 1
112112
}
113113
}
114-
}
114+
}

tests/shared/src/test/scala/org/threeten/bp/Performance.scala

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import java.util.Map
5353
import java.util.Random
5454
import java.util.TreeMap
5555
import org.threeten.bp.format.DateTimeFormatter
56+
import scala.collection.JavaConverters._
5657

5758
/** Test Performance. */
5859
object Performance {
@@ -88,13 +89,11 @@ object Performance {
8889
}
8990
}
9091
System.out.println()
91-
import scala.collection.JavaConversions._
92-
for (name <- RESULTS.keySet) {
92+
for (name <- RESULTS.keySet.asScala) {
9393
System.out.println(name + " " + Arrays.toString(RESULTS.get(name)))
9494
}
9595
System.out.println()
96-
import scala.collection.JavaConversions._
97-
for (name <- RESULTS.keySet) {
96+
for (name <- RESULTS.keySet.asScala) {
9897
val r: Array[Long] = RESULTS.get(name)
9998
val percent: BigDecimal = BigDecimal.valueOf(r(6), 1)
10099
var max: String = " " + NF.format(r(0))
@@ -167,8 +166,7 @@ object Performance {
167166
private def queryListDateTime(list: java.util.List[LocalDateTime]): Unit = {
168167
var total: Long = 0
169168
val start: Long = System.nanoTime
170-
import scala.collection.JavaConversions._
171-
for (dt <- list) {
169+
for (dt <- list.asScala) {
172170
total += dt.getYear
173171
total += dt.getMonth.getValue
174172
total += dt.getDayOfMonth
@@ -185,8 +183,7 @@ object Performance {
185183
val buf: StringBuilder = new StringBuilder
186184
val format: DateTimeFormatter = DateTimeFormatter.ISO_DATE.withLocale(Locale.ENGLISH)
187185
val start: Long = System.nanoTime
188-
import scala.collection.JavaConversions._
189-
for (dt <- list) {
186+
for (dt <- list.asScala) {
190187
buf.setLength(0)
191188
buf.append(format.format(dt))
192189
}
@@ -198,8 +195,7 @@ object Performance {
198195
private def deriveDateTime(list: java.util.List[LocalDateTime]): Unit = {
199196
var total: Long = 0
200197
val start: Long = System.nanoTime
201-
import scala.collection.JavaConversions._
202-
for (dt <- list) {
198+
for (dt <- list.asScala) {
203199
total += dt.get(YEAR)
204200
total += dt.get(MONTH_OF_YEAR)
205201
total += dt.get(DAY_OF_MONTH)
@@ -238,8 +234,7 @@ object Performance {
238234
private def queryListLocalDate(list: java.util.List[LocalDate]): Unit = {
239235
var total: Long = 0
240236
val start: Long = System.nanoTime
241-
import scala.collection.JavaConversions._
242-
for (dt <- list) {
237+
for (dt <- list.asScala) {
243238
total += dt.getYear
244239
total += dt.getMonth.getValue
245240
total += dt.getDayOfMonth
@@ -253,8 +248,7 @@ object Performance {
253248
val buf: StringBuilder = new StringBuilder
254249
val format: DateTimeFormatter = DateTimeFormatter.ISO_DATE.withLocale(Locale.ENGLISH)
255250
val start: Long = System.nanoTime
256-
import scala.collection.JavaConversions._
257-
for (dt <- list) {
251+
for (dt <- list.asScala) {
258252
buf.setLength(0)
259253
buf.append(format.format(dt))
260254
}
@@ -290,8 +284,7 @@ object Performance {
290284
private def queryListTime(list: java.util.List[LocalTime]): Unit = {
291285
var total: Long = 0
292286
val start: Long = System.nanoTime
293-
import scala.collection.JavaConversions._
294-
for (dt <- list) {
287+
for (dt <- list.asScala) {
295288
total += dt.getHour
296289
total += dt.getMinute
297290
total += dt.getSecond
@@ -306,8 +299,7 @@ object Performance {
306299
val buf: StringBuilder = new StringBuilder
307300
val format: DateTimeFormatter = DateTimeFormatter.ISO_TIME.withLocale(Locale.ENGLISH)
308301
val start: Long = System.nanoTime
309-
import scala.collection.JavaConversions._
310-
for (dt <- list) {
302+
for (dt <- list.asScala) {
311303
buf.setLength(0)
312304
buf.append(format.format(dt))
313305
}
@@ -319,8 +311,7 @@ object Performance {
319311
private def deriveTime(list: java.util.List[LocalTime]): Unit = {
320312
var total: Long = 0
321313
val start: Long = System.nanoTime
322-
import scala.collection.JavaConversions._
323-
for (dt <- list) {
314+
for (dt <- list.asScala) {
324315
total += dt.get(HOUR_OF_DAY)
325316
total += dt.get(MINUTE_OF_HOUR)
326317
total += dt.get(SECOND_OF_MINUTE)
@@ -359,8 +350,7 @@ object Performance {
359350
private def queryListZonedDateTime(list: java.util.List[ZonedDateTime]): Unit = {
360351
var total: Long = 0
361352
val start: Long = System.nanoTime
362-
import scala.collection.JavaConversions._
363-
for (dt <- list) {
353+
for (dt <- list.asScala) {
364354
total += dt.getYear
365355
total += dt.getMonth.getValue
366356
total += dt.getDayOfMonth
@@ -377,8 +367,7 @@ object Performance {
377367
val buf: StringBuilder = new StringBuilder
378368
val format: DateTimeFormatter = DateTimeFormatter.ISO_DATE.withLocale(Locale.ENGLISH)
379369
val start: Long = System.nanoTime
380-
import scala.collection.JavaConversions._
381-
for (dt <- list) {
370+
for (dt <- list.asScala) {
382371
buf.setLength(0)
383372
buf.append(format.format(dt))
384373
}
@@ -414,8 +403,7 @@ object Performance {
414403
private def queryListInstant(list: java.util.List[Instant]): Unit = {
415404
var total: Long = 0
416405
val start: Long = System.nanoTime
417-
import scala.collection.JavaConversions._
418-
for (dt <- list) {
406+
for (dt <- list.asScala) {
419407
total += dt.getEpochSecond
420408
total += dt.getNano
421409
}
@@ -427,8 +415,7 @@ object Performance {
427415
private def formatListInstant(list: java.util.List[Instant]): Unit = {
428416
val buf: StringBuilder = new StringBuilder
429417
val start: Long = System.nanoTime
430-
import scala.collection.JavaConversions._
431-
for (dt <- list) {
418+
for (dt <- list.asScala) {
432419
buf.setLength(0)
433420
buf.append(dt.toString)
434421
}
@@ -464,8 +451,7 @@ object Performance {
464451
private def queryListDate(list: java.util.List[Date]): Unit = {
465452
var total: Long = 0
466453
val start: Long = System.nanoTime
467-
import scala.collection.JavaConversions._
468-
for (dt <- list) {
454+
for (dt <- list.asScala) {
469455
total += dt.getTime
470456
}
471457
val end: Long = System.nanoTime
@@ -476,8 +462,7 @@ object Performance {
476462
private def formatListDate(list: java.util.List[Date]): Unit = {
477463
val buf: StringBuilder = new StringBuilder
478464
val start: Long = System.nanoTime
479-
import scala.collection.JavaConversions._
480-
for (dt <- list) {
465+
for (dt <- list.asScala) {
481466
buf.setLength(0)
482467
buf.append(dt.toString)
483468
}
@@ -516,8 +501,7 @@ object Performance {
516501
private def queryListGCal(list: java.util.List[GregorianCalendar]): Unit = {
517502
var total: Long = 0
518503
val start: Long = System.nanoTime
519-
import scala.collection.JavaConversions._
520-
for (gcal <- list) {
504+
for (gcal <- list.asScala) {
521505
total += gcal.get(Calendar.YEAR)
522506
total += gcal.get(Calendar.MONTH + 1)
523507
total += gcal.get(Calendar.DAY_OF_MONTH)
@@ -535,8 +519,7 @@ object Performance {
535519
val buf: StringBuilder = new StringBuilder
536520
val format: SimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH)
537521
val start: Long = System.nanoTime
538-
import scala.collection.JavaConversions._
539-
for (gcal <- list) {
522+
for (gcal <- list.asScala) {
540523
buf.setLength(0)
541524
buf.append(format.format(gcal.getTime))
542525
}

0 commit comments

Comments
 (0)