Skip to content

Commit

Permalink
Update to newest Scala 3.2.1 and Scala Native 0.4.9 (#43)
Browse files Browse the repository at this point in the history
* Update to Scala 3.2.1

* Remove travis file
  • Loading branch information
ekrich authored Nov 29, 2022
1 parent b2ac3e0 commit c0d5f60
Show file tree
Hide file tree
Showing 11 changed files with 1,353 additions and 1,191 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ target/

# vscode
/.vscode/

# scripts generated
/scripts/.coursier
/scripts/.scalafmt*
7 changes: 4 additions & 3 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
version = 1.5.1
style = defaultWithAlign
docstrings = JavaDoc
version = 3.6.1
preset = default
docstrings.style = Asterisk
assumeStandardLibraryStripMargin = true
project.git = true
runner.dialect = scala3
53 changes: 0 additions & 53 deletions .travis.yml

This file was deleted.

18 changes: 14 additions & 4 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/stensorflow_native0.4_2.13.svg)](https://maven-badges.herokuapp.com/maven-central/org.ekrich/stensorflow_native0.4_2.13)
[![Maven Central](https://img.shields.io/maven-central/v/org.ekrich/stensorflow_native0.4_3.svg)](https://maven-badges.herokuapp.com/maven-central/org.ekrich/stensorflow_native0.4_3)

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 @@ -30,9 +30,18 @@ All available versions can be seen at the [Maven Repository](https://mvnreposito
Otherwise follow the [Getting Started](https://scala-native.readthedocs.io/en/latest/user/setup.html)
instructions for Scala Native if you are not already setup.

## Scala Build Versions

| Scala Version | Native (0.4.9+) |
| ---------------------- | :-------------------: |
| 3.2.x ||

Use version `0.3.0` or greater for Scala Native `0.4.9+` and Scala 3.
Refer to release notes for older versions of Scala and Scala Native

## Additional libraries

The TensorFlow C library is required and the current version is `2.10.0`.
The TensorFlow C library is required and the current version is `2.11.0`.

* Linux/Ubuntu can TensorFlow following the following directions:

Expand All @@ -50,7 +59,7 @@ $ sudo ldconfig /usr/local/lib
* macOS can install TensorFlow using [Homebrew](https://formulae.brew.sh/formula/libtensorflow)
which will install into the `/usr/local/Cellar/libtensorflow/<version>` directory.

Note: macOS Catalina 10.15.x or greater is required to install TensorFlow via
Note: macOS 11 or greater is recommended to install TensorFlow via
Homebrew and is used in CI.

```
Expand All @@ -60,7 +69,7 @@ $ brew install libtensorflow
* Other OSes need to have `libtensorflow` available on the system.

## Usage and Help
[![scaladoc](https://www.javadoc.io/badge/org.ekrich/stensorflow_native0.4_2.13.svg?label=scaladoc)](https://www.javadoc.io/doc/org.ekrich/stensorflow_native0.4_2.13)
[![scaladoc](https://www.javadoc.io/badge/org.ekrich/stensorflow_native0.4_3.svg?label=scaladoc)](https://www.javadoc.io/doc/org.ekrich/stensorflow_native0.4_3)
[![Join chat https://gitter.im/ekrich/stensorflow](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ekrich/stensorflow?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Reference the link above for Scaladoc. The documentation is a little sparse but hopefully will improve with time.
Expand All @@ -82,5 +91,6 @@ In addition, look at the [stensorflow unit tests](https://github.com/ekrich/sten

## Versions

Release [0.3.0](https://github.com/ekrich/tensorflow/releases/tag/v0.3.0) - (2022-11-29)<br/>
Release [0.2.0](https://github.com/ekrich/tensorflow/releases/tag/v0.2.0) - (2021-12-13)<br/>
Release [0.1.0](https://github.com/ekrich/tensorflow/releases/tag/v0.1.0) - (2021-07-02)<br/>
23 changes: 8 additions & 15 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
addCommandAlias("run", "stensorflow/run")
// stensorflow build
val scala3 = "3.2.1"

val scala211 = "2.11.12"
val scala212 = "2.12.17"
val scala213 = "2.13.10"
val scala300 = "3.1.0"
val versionsNative = Seq(scala3)

val versionsNative = Seq(scala211, scala212, scala213)

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

Expand All @@ -17,7 +13,8 @@ inThisBuild(
organization := "org.ekrich",
homepage := Some(url("https://github.com/ekrich/stensorflow")),
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 @@ -30,12 +27,8 @@ inThisBuild(
)

lazy val commonSettings = Seq(
addCompilerPlugin(
"org.scala-native" % "junit-plugin" % nativeVersion cross CrossVersion.full),
libraryDependencies += "org.scala-native" %%% "junit-runtime" % nativeVersion,
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-s", "-v"),
logLevel := Level.Info, // Info, Debug
nativeLinkStubs := true
logLevel := Level.Info // Info, Debug
)

lazy val root = project
Expand All @@ -57,4 +50,4 @@ lazy val stensorflow = project
crossScalaVersions := versionsNative,
commonSettings
)
.enablePlugins(ScalaNativePlugin)
.enablePlugins(ScalaNativePlugin, ScalaNativeJUnitPlugin)
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ resolvers ++= Resolver.sonatypeOssRepos("snapshots")

// Current releases
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.9")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.11")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "5.0.0-M3")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.11")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "5.0.0-M3")
Binary file removed scripts/.coursier
Binary file not shown.
Binary file removed scripts/.scalafmt-1.5.1
Binary file not shown.
5 changes: 3 additions & 2 deletions scripts/scalafmt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/usr/bin/env bash

# uncomment to debug
# set -x

HERE="`dirname $0`"
VERSION="1.5.1"
VERSION=$(sed -nre "s#\s*version[^0-9]+([0-9.]+)#\1#p" $HERE/../.scalafmt.conf)
COURSIER="$HERE/.coursier"
SCALAFMT="$HERE/.scalafmt-$VERSION"

Expand All @@ -13,7 +14,7 @@ if [ ! -f $COURSIER ]; then
fi

if [ ! -f $SCALAFMT ]; then
$COURSIER bootstrap com.geirsson:scalafmt-cli_2.12:$VERSION --main org.scalafmt.cli.Cli -o $SCALAFMT
$COURSIER bootstrap org.scalameta:scalafmt-cli_2.13:$VERSION -r sonatype:snapshots --main org.scalafmt.cli.Cli -o $SCALAFMT
chmod +x $SCALAFMT
fi

Expand Down
Loading

0 comments on commit c0d5f60

Please sign in to comment.