Skip to content

Commit

Permalink
Merge pull request #1 from personnummer/develop
Browse files Browse the repository at this point in the history
Add scala version
  • Loading branch information
frozzare authored Apr 28, 2020
2 parents 5ddc3e2 + e3ef931 commit a0b2263
Show file tree
Hide file tree
Showing 10 changed files with 549 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: test

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11.0.x
- name: Run tests
run: sbt test
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
*.class
*.log

# sbt specific
.cache
.history
.lib/
dist/*
target/
lib_managed/
src_managed/
project/boot/
project/plugins/project/
**/.bloop

# Scala-IDE specific
.scala_dependencies
.worksheet

.idea

# ENSIME specific
.ensime_cache/
.ensime

.metals/
metals.sbt
metals/project/

.vscode/

local.*

.DS_Store
1 change: 1 addition & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = "2.4.2"
45 changes: 45 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import Dependencies._

ThisBuild / scalaVersion := "2.12.8"
ThisBuild / version := "3.0.0"
ThisBuild / organization := "personnummer"
ThisBuild / organizationName := "personnummer"

lazy val root = (project in file("."))
.settings(
name := "Personnummer",
libraryDependencies += scalaTest % Test,
libraryDependencies ++= Seq(
"io.circe" %% "circe-core",
"io.circe" %% "circe-generic",
"io.circe" %% "circe-parser"
).map(_ % "0.13.0" % Test)
)

ThisBuild / description := "Validate Swedish personal identity numbers."
ThisBuild / licenses := List(
"MIT" -> new URL("https://opensource.org/licenses/MIT")
)
ThisBuild / homepage := Some(url("https://personnummer.dev"))
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/personnummer/scala"),
"scm:[email protected]:personnummer/scala.git"
)
)
ThisBuild / developers := List(
Developer(
id = "personnummer",
name = "Personnummer and Contributors",
email = "[email protected]",
url = url("http://personnummer.dev")
)
)
ThisBuild / pomIncludeRepository := { _ => false }
ThisBuild / publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
ThisBuild / publishMavenStyle := true
24 changes: 24 additions & 0 deletions license
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
MIT License

Copyright (c) 2020 - Personnummer and Contributors

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
5 changes: 5 additions & 0 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import sbt._

object Dependencies {
lazy val scalaTest = "org.scalatest" %% "scalatest" % "3.0.5"
}
1 change: 1 addition & 0 deletions project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.2.7
17 changes: 16 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
# scala
# personnummer

Validate Swedish personal identity numbers. Follows version 3 of the [specification](https://github.com/personnummer/meta#package-specification-v3).

## Example

```scala
import personnummer.Personnummer

Personnummer.valid("198507099805")
//=> true
```

## License

MIT
Loading

0 comments on commit a0b2263

Please sign in to comment.