Skip to content

Commit 5573357

Browse files
authored
Merge pull request #148 from cquiroz/next-release
Update to release on scala.js 1.0.1
2 parents bea2208 + 0265c1c commit 5573357

File tree

7 files changed

+57
-4
lines changed

7 files changed

+57
-4
lines changed

.github/release-drafter.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name-template: 'v$NEXT_PATCH_VERSION'
2+
tag-template: 'v$NEXT_PATCH_VERSION'
3+
template: |
4+
# What's Changed
5+
$CHANGES
6+
categories:
7+
- title: 'New'
8+
label: 'type: feature'
9+
- title: 'Bug Fixes'
10+
label: 'type: bug'
11+
- title: 'Maintenance'
12+
label: 'type: maintenance'
13+
- title: 'Documentation'
14+
label: 'type: docs'
15+
- title: 'Dependency Updates'
16+
label: 'type: dependencies'

.github/workflows/release-drafter.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
# branches to consider in the event; optional, defaults to all
6+
branches:
7+
- master
8+
9+
jobs:
10+
update_release_draft:
11+
runs-on: ubuntu-latest
12+
steps:
13+
# Drafts your next Release notes as Pull Requests are merged into "master"
14+
- uses: release-drafter/release-drafter@v5
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ jobs:
1111
- uses: olafurpg/setup-scala@v2
1212
- uses: olafurpg/setup-gpg@v2
1313
- name: Publish
14-
run: csbt ci-release
14+
run: |
15+
csbt ci-release
16+
SCALAJS_VERSION=0.6.32 csbt clean ci-release
1517
env:
1618
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
1719
PGP_SECRET: ${{ secrets.PGP_SECRET }}

.github/workflows/scala.yml

+1
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ jobs:
2727
- name: Run tests
2828
run: |
2929
csbt +macroUtils/publishLocal +testSuiteJS/test +testSuiteJVM/test
30+
SCALAJS_VERSION=0.6.32 csbt clean +macroUtils/publishLocal +testSuiteJS/test +testSuiteJVM/test

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
![build](https://github.com/cquiroz/scala-java-locales/workflows/build/badge.svg)
44
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.cquiroz/scala-java-locales_sjs0.6_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.cquiroz/scala-java-locales_sjs0.6_2.12)
5+
[![Scala.js](https://www.scala-js.org/assets/badges/scalajs-1.0.0.svg)](https://www.scala-js.org/)
56
[![Scala.js](https://www.scala-js.org/assets/badges/scalajs-0.6.29.svg)](https://www.scala-js.org/)
67

78
`scala-java-locales` is a clean-room BSD-licensed implementation of the `java.util.Locale` API and related classes as defined on JDK8, mostly for Scala.js usage. It enables the locale API in Scala.js projects and supports usage requiring locales like number and dates formatting.
@@ -51,8 +52,14 @@ libraryDependencies += "com.github.cquiroz" %%% "locales-minimal-en-db" % "0.6.0
5152

5253
## Default Locale
5354

54-
It is **highly** recommended that you set a default locale for your application with, e.g.
55+
Starting on 0.6.0 it is no longer necessary to register locales but only a minimal locale based on english is
56+
provided. You may want to use [sbt-locales](https://github.com/cquiroz/sbt-locales) to generate
57+
a custom locale database.
5558

59+
For example see:
60+
[gemini-locales](https://github.com/gemini-hlsw/gemini-locales/)
61+
62+
It is probably a good idea to set your default Locale
5663
```
5764
Locale.setDefault(Locale.forLanguageTag(<my-locale>))
5865
```
@@ -76,7 +83,6 @@ Locales and the CLDR specifications are vast subjects. The locales in this proje
7683
In general the API attempts to behave be as close as possible to what happens on the JVM, e.g. the numeric system in Java seems to default to `latn` unless explicitly requested on the locale name.
7784

7885
## Demo
79-
8086
A very simple `Scala.js` project is available at [scalajs-locales-demo](https://github.com/cquiroz/scalajs-locales-demo)
8187

8288
## Dependencies

build.sbt

+12
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Global / onChangedBuildSource := ReloadOnSourceChanges
88

99
resolvers in Global += Resolver.sonatypeRepo("public")
1010

11+
val scalaJSVersion06 = Option(System.getenv("SCALAJS_VERSION")).exists(_.startsWith("0.6"))
12+
1113
val commonSettings: Seq[Setting[_]] = Seq(
1214
cldrDbVersion := "36",
1315
organization := "io.github.cquiroz",
@@ -94,6 +96,9 @@ lazy val core = crossProject(JVMPlatform, JSPlatform)
9496
}
9597
}
9698
)
99+
.jvmSettings(
100+
skip.in(publish) := scalaJSVersion06
101+
)
97102

98103
lazy val localesFullCurrenciesDb = crossProject(JVMPlatform, JSPlatform)
99104
.settings(commonSettings: _*)
@@ -110,6 +115,9 @@ lazy val localesFullCurrenciesDb = crossProject(JVMPlatform, JSPlatform)
110115
supportISOCodes := true,
111116
libraryDependencies += "org.portable-scala" %%% "portable-scala-reflect" % "1.0.0"
112117
)
118+
.jvmSettings(
119+
skip.in(publish) := scalaJSVersion06
120+
)
113121

114122
lazy val localesFullDb = crossProject(JVMPlatform, JSPlatform)
115123
.settings(commonSettings: _*)
@@ -126,6 +134,9 @@ lazy val localesFullDb = crossProject(JVMPlatform, JSPlatform)
126134
supportISOCodes := true,
127135
libraryDependencies += "org.portable-scala" %%% "portable-scala-reflect" % "1.0.0"
128136
)
137+
.jvmSettings(
138+
skip.in(publish) := scalaJSVersion06
139+
)
129140

130141
lazy val localesMinimalEnDb = crossProject(JVMPlatform, JSPlatform)
131142
.settings(commonSettings: _*)
@@ -150,6 +161,7 @@ lazy val testSuite = crossProject(JVMPlatform, JSPlatform)
150161
publishLocal := {},
151162
publishArtifact := false,
152163
name := "scala-java-locales test",
164+
crossScalaVersions := Seq("2.12.10", "2.13.1"), // munit isn't working properly on tests
153165
libraryDependencies += "org.scalameta" %%% "munit" % "0.5.2",
154166
testFrameworks += new TestFramework("munit.Framework"),
155167
scalacOptions ~= (_.filterNot(

project/plugins.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
resolvers += Resolver.sonatypeRepo("public")
22

33
val scalaJSVersion =
4-
Option(System.getenv("SCALAJS_VERSION")).getOrElse("0.6.32")
4+
Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.0.1")
55

66
addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
77
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")

0 commit comments

Comments
 (0)