Skip to content

Commit

Permalink
Update Scala Native and cleanup for Scala 3 (#70)
Browse files Browse the repository at this point in the history
* Update version

* Update scalafmt and add script to workflow

* Update Scala Native to 0.4.3 and Scala 3

* Add semver strategy

* Update docs prior to format

* Format with new scalafmt

* Update readme for release
  • Loading branch information
ekrich authored Feb 1, 2022
1 parent 7f7ec9f commit f2e66cf
Show file tree
Hide file tree
Showing 10 changed files with 1,754 additions and 1,407 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/check-link.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Check Lint
on:
push:
branches: [ main ]
pull_request:
jobs:
check-lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- run: ./scripts/check-lint.sh
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@

# vscode
/.vscode/

# IntelliJ
/.idea/

# scripts generated
/scripts/.coursier
/scripts/.scalafmt*
34 changes: 25 additions & 9 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
version = 3.3.1
style = defaultWithAlign
docstrings = JavaDoc
# Test upgrades: $ scripts/scalafmt --test 2> diff.txt
version = 3.4.0
runner.dialect = scala213source3
preset = default

# JavaDoc style (ported from Java)
docstrings.style = Asterisk
assumeStandardLibraryStripMargin = true
project.git = true
# changed 1.6 or after
align.openParenCallSite = true
align.openParenDefnSite = true
# avoid wrapping parens on new line
danglingParentheses.defnSite = false
danglingParentheses.callSite = false

# This creates less of a diff but is not default
# but is more aligned with Scala.js syntax.
newlines.beforeCurlyLambdaParams = multilineWithCaseOnly

# Keep control sites more streamlined
indent.ctrlSite = 4
danglingParentheses.ctrlSite = false

# Default is not recommended
indentOperator.exemptScope = aloneEnclosed

# allow dialect for Scala 3
fileOverride {
"glob:**/scala-3/**.scala" {
runner.dialect = scala3
}
}
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ converted to [LLVM IR](http://llvm.org/). Finally LLVM code is optimized
and compiled by [Clang](http://clang.llvm.org/) to produce a native executable.

## Getting started
[![Maven Central](https://img.shields.io/maven-central/v/org.ekrich/sblas_native0.4_2.11.svg)](https://maven-badges.herokuapp.com/maven-central/org.ekrich/sblas_native0.4_2.11)
[![Maven Central](https://img.shields.io/maven-central/v/org.ekrich/sblas_native0.4_2.13.svg)](https://maven-badges.herokuapp.com/maven-central/org.ekrich/sblas_native0.4_2.13)

If you are already familiar with Scala Native you can jump right in by adding the following dependency in your `sbt` build file.

Expand All @@ -43,6 +43,18 @@ $ sudo apt-get install libatlas-base-dev

* Other OSes need to have `libcblas` available on the system.

## Scala Build Versions

| Scala Version | Native (0.4.0) | Native (0.4.3+) |
| ---------------------- | :-------------------: | :------------: |
| 2.11.x |||
| 2.12.x |||
| 2.13.x |||
| 3.x.x | ||

Use version sblas `0.3.0` for Scala Native `0.4.0`.
Use version sblas `0.4.0` for Scala Native `0.4.3` with Scala 3 support.

## Usage and Help
[![scaladoc](https://www.javadoc.io/badge/org.ekrich/sblas_native0.4_2.11.svg?label=scaladoc)](https://www.javadoc.io/doc/org.ekrich/sblas_native0.4_2.11)
[![Join chat https://gitter.im/ekrich/sblas](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ekrich/sblas?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Expand All @@ -57,7 +69,7 @@ $ cd <directory entered after the prompt>
$ sbt run
```

In addition, look at the [sblas unit tests](https://github.com/ekrich/sblas/blob/v0.3.0/sblas/src/test/scala/org/ekrich/blas/unsafe/BlasTest.scala) for other examples of usage.
In addition, look at the [sblas unit tests](https://github.com/ekrich/sblas/blob/main/sblas/src/test/scala/org/ekrich/blas/unsafe/BlasTest.scala) for other examples of usage.

## BLAS References and External Documentation

Expand All @@ -83,6 +95,7 @@ IBM Website:

## Versions

Release [0.4.0](https://github.com/ekrich/sblas/releases/tag/v0.4.0) - (2022-02-01)<br/>
Release [0.3.0](https://github.com/ekrich/sblas/releases/tag/v0.3.0) - (2021-03-20)<br/>
Release [0.2.0](https://github.com/ekrich/sblas/releases/tag/v0.2.0) - (2019-12-05)<br/>
Release [0.1.1](https://github.com/ekrich/sblas/releases/tag/v0.1.1) - (2019-05-01)<br/>
15 changes: 9 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
// sblas build
val prevVersion = "0.2.0"
val nextVersion = "0.3.0"
val prevVersion = "0.3.0"
val nextVersion = "0.4.0"

val scala211 = "2.11.12"
val scala212 = "2.12.15"
val scala213 = "2.13.8"
val scala300 = "3.0.0"
val scala3 = "3.1.1"

val versionsNative = Seq(scala212, scala211, scala213)
val versionsNative = Seq(scala211, scala212, scala213, scala3)

ThisBuild / scalaVersion := scala213
ThisBuild / crossScalaVersions := versionsNative
ThisBuild / versionScheme := Some("early-semver")

inThisBuild(
List(
description := "BLAS interface for Scala Native",
organization := "org.ekrich",
homepage := Some(url("https://github.com/ekrich/sblas")),
licenses := List(
"Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
"Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")
),
developers := List(
Developer(
id = "ekrich",
Expand All @@ -31,7 +33,8 @@ inThisBuild(
dynver := sbtdynver.DynVer
.getGitDescribeOutput(new java.util.Date)
.mkVersion(versionFmt, "")
))
)
)

// stable snapshot is not great for publish local
def versionFmt(out: sbtdynver.GitDescribeOutput): String = {
Expand Down
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
resolvers += Resolver.sonatypeRepo("snapshots")

// includes sbt-dynver sbt-pgp sbt-sonatype sbt-git
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.0.1")

// Scala Native support
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.2")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.3")
Loading

0 comments on commit f2e66cf

Please sign in to comment.