Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 26 additions & 18 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,32 @@ jobs:
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: sbt
- name: Setup sbt
uses: sbt/setup-sbt@v1
- name: Build
- name: Setup Mill (MacOS/Ubuntu)
if: runner.os != 'Windows'
run: |
sbt -v compile
sbt -v test:compile
- name: Test
curl -L https://repo1.maven.org/maven2/com/lihaoyi/mill-dist/1.1.5/mill-dist-1.1.5-mill.sh -o mill
chmod +x mill
./mill version
- name: Setup Mill (Windows)
if: runner.os == 'Windows'
run: |
sbt -v test
curl.exe -L https://repo1.maven.org/maven2/com/lihaoyi/mill-dist/1.1.5/mill-dist-1.1.5-mill.bat -o mill.bat
./mill version
- name: Build
run: ./mill __.compile
- name: Test
run: ./mill __.test
- name: Sample
run: |
sbt -v "sampleJVM / runMain spores.sample.BuilderExample"
sbt -v "sampleJVM / runMain spores.sample.SporeExample"
sbt -v "sampleJVM / runMain spores.sample.AutoCaptureExample"
sbt -v "sampleJVM / runMain spores.sample.AgentMain"
sbt -v "sampleJVM / runMain spores.sample.Futures"
sbt -v "sampleJVM / runMain spores.sample.FutureMap"
sbt -v "sampleJVM / runMain spores.sample.ParallelTreeReduction"
sbt -v "sampleJS / run"
sbt -v "sampleNative / run"
run: >
./mill --no-daemon
sample.jvm.runMain spores.sample.BuilderExample +
sample.jvm.runMain spores.sample.SporeExample +
sample.jvm.runMain spores.sample.AutoCaptureExample +
sample.jvm.runMain spores.sample.AgentMain +
sample.jvm.runMain spores.sample.Futures +
sample.jvm.runMain spores.sample.FutureMap +
sample.jvm.runMain spores.sample.ParallelTreeReduction +
sample.jvm.runMain spores.sample.WorkflowMain +
sample.jvm.runMain spores.sample.ForComprehension +
sample.js.run +
sample.native.run
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*~
project/target/
target/
out/

.bsp/
.vscode/
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ Paper: Philipp Haller. Enhancing closures in Scala 3 with Spores3. 13th ACM SIGP
Add the following dependency to your `build.sbt`:

```
libraryDependencies += "com.phaller" %% "spores3" % "0.1.0"
libraryDependencies += "com.phaller" %%% "spores3" % "0.1.0"
```

Add the following dependency to your `build.mill`:

```
def mvnDeps = Seq(mvn"com.phaller::spores3::0.1.0")
```

## Overview
Expand Down
107 changes: 107 additions & 0 deletions build.mill
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
//| mill-version: 1.1.5
//| mill-jvm-opts: ["-Xss8m"]
//| mvnDeps:
//| - com.github.lolgab::mill-mima_mill1:0.2.0
package build

import mill._
import mill.scalalib._
import mill.scalalib.publish._
import mill.scalajslib._
import mill.scalanativelib._
import com.github.lolgab.mill.mima._

val scala3 = "3.3.7"
val scalaJS = "1.20.2"
val scalaNative = "0.5.10"
val upickle = "3.3.0"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to upgrade this as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into upgrading uPickle to 4.X and this will require some changes to the test cases as the newer uPickle versions produce different serialized output. I have another PR that addresses this and bumps the uPickle version to 4.X. So I will leave the uPickle version at 3.3.0 for this PR.

val utest = "0.9.5"

trait CommonTestModule extends TestModule.Utest {
def mvnDeps = Seq(mvn"com.lihaoyi::utest::$utest")
}

trait CommonMimaModule extends Mima {
def mimaPreviousVersions: T[Seq[String]] = Seq.empty[String]

def mimaReportBinaryIssues() = {
if (this.isInstanceOf[ScalaNativeModule] || this.isInstanceOf[ScalaJSModule]) Task.Command {}
else super.mimaReportBinaryIssues()
}
}

trait CommonPublishModule extends ScalaModule with PublishModule with CommonMimaModule {
def scalaVersion = scala3
def publishVersion = "0.3.0-SNAPSHOT"

def pomSettings = PomSettings(
description = "Spores3 provides abstractions for making closures in Scala safer and more flexible",
organization = "com.phaller",
url = "https://github.com/phaller/spores3",
licenses = Seq(License.`Apache-2.0`),
versionControl = VersionControl.github(owner = "phaller", repo = "spores3"),
developers = Seq(
Developer("phaller", "Philipp Haller", "https://github.com/phaller"),
Developer("jspenger", "Jonas Spenger", "https://github.com/jspenger")
)
)

def versionScheme: T[Option[VersionScheme]] = Some(VersionScheme.SemVerSpec)
}

trait CommonPlatformModule extends ScalaModule with PlatformScalaModule {
def platformSources = Task.Sources(
platformCrossSuffix match {
case "jvm" => Seq(os.sub / "src-jvm-native")
case "js" => Seq(os.sub / "src-js-native")
case "native" => Seq(os.sub / "src-js-native", os.sub / "src-jvm-native")
}*
)

override def sources = Task { super.sources() ++ platformSources() }
}

object spores3 extends Module {

trait Shared extends CommonPublishModule with CommonPlatformModule {
def artifactName = "spores3"
def mvnDeps = Seq(mvn"com.lihaoyi::upickle::$upickle")
}

object jvm extends Shared {
object test extends ScalaTests with CommonTestModule
}

object js extends Shared with ScalaJSModule {
def scalaJSVersion = scalaJS
object test extends ScalaJSTests with CommonTestModule
}

object native extends Shared with ScalaNativeModule {
def scalaNativeVersion = scalaNative
object test extends ScalaNativeTests with CommonTestModule
}
}

object sample extends Module {

trait Shared extends ScalaModule with CommonPlatformModule {
def scalaVersion = scala3
def mvnDeps = Seq(mvn"com.lihaoyi::upickle::$upickle")
}

object jvm extends Shared {
def moduleDeps = Seq(spores3.jvm)
}

object js extends Shared with ScalaJSModule {
def scalaJSVersion = scalaJS
def moduleDeps = Seq(spores3.js)
def scalaJSUseMainModuleInitializer = true
}

object native extends Shared with ScalaNativeModule {
def scalaNativeVersion = scalaNative
def moduleDeps = Seq(spores3.native)
}
}
76 changes: 0 additions & 76 deletions build.sbt

This file was deleted.

Loading
Loading