Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Merge pull request #16 from sideeffffect/multiplatform
Browse files Browse the repository at this point in the history
Multiplatform
  • Loading branch information
vigoo authored Mar 6, 2023
2 parents 80289a9 + 3732a04 commit 645af4a
Show file tree
Hide file tree
Showing 15 changed files with 114 additions and 41 deletions.
65 changes: 60 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,71 @@
name: Release
on:
pull_request:
push:
branches: [master, main]
tags: ["*"]
release:
types: [published]
jobs:

lint:
runs-on: ubuntu-22.04
steps:
- name: Checkout current branch
uses: actions/checkout@v3.3.0
- name: Setup Java
uses: actions/setup-java@v3.10.0
with:
distribution: temurin
java-version: 17
cache: 'sbt'
- run: sbt check

publishLocal:
runs-on: ubuntu-22.04
steps:
- name: Checkout current branch
uses: actions/checkout@v3.3.0
- name: Setup Java
uses: actions/setup-java@v3.10.0
with:
distribution: temurin
java-version: 8
cache: 'sbt'
- run: sbt +publishLocal

test:
runs-on: ubuntu-22.04
steps:
- name: Checkout current branch
uses: actions/checkout@v3.3.0
- name: Setup Java
uses: actions/setup-java@v3.10.0
with:
distribution: temurin
java-version: 17
cache: 'sbt'
- run: sbt +test

ci:
runs-on: ubuntu-22.04
needs: [lint, publishLocal, test]
steps:
- name: Aggregate of lint, and all tests
run: echo "ci passed"

publish:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [ci]
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v2.3.4
- name: Checkout current branch
uses: actions/checkout@v3.3.0
- name: Setup Java
uses: actions/setup-java@v3.10.0
with:
fetch-depth: 0
- uses: olafurpg/setup-scala@v13
distribution: temurin
java-version: 8
cache: 'sbt'
- run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
project/.bloop
project/target/
project/target
project/metals.sbt
.bsp
.bloop
.metals
.DS_Store
.DS_Store/
target/
.idea
target
.idea
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

ZIO Constraintless allows you to build programs as mere descriptions with maximum polymorphism, maximum modularity, zero abstraction leakage, and zero casting.

[![Development](https://img.shields.io/badge/Project%20Stage-Development-green.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-constraintless/workflows/Website/badge.svg) [![Sonatype Releases](https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-constraintless_2.12.svg?label=Sonatype%20Release)](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-constraintless_2.12/) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-constraintless_2.12.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-constraintless_2.12/) [![javadoc](https://javadoc.io/badge2/dev.zio/zio-constraintless-docs_2.12/javadoc.svg)](https://javadoc.io/doc/dev.zio/zio-constraintless-docs_2.12) [![ZIO Constraintless](https://img.shields.io/github/stars/zio/zio-constraintless?style=social)](https://github.com/zio/zio-constraintless)
[![Development](https://img.shields.io/badge/Project%20Stage-Development-green.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-constraintless/workflows/Website/badge.svg) [![Sonatype Releases](https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-constraintless_2.13.svg?label=Sonatype%20Release)](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-constraintless_2.13/) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-constraintless_2.13.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-constraintless_2.13/) [![javadoc](https://javadoc.io/badge2/dev.zio/zio-constraintless-docs_2.13/javadoc.svg)](https://javadoc.io/doc/dev.zio/zio-constraintless-docs_2.13) [![ZIO Constraintless](https://img.shields.io/github/stars/zio/zio-constraintless?style=social)](https://github.com/zio/zio-constraintless)

## Introduction

Expand Down
56 changes: 40 additions & 16 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
val Scala211 = "2.11.12"
val Scala212 = "2.12.17"
val Scala213 = "2.13.10"
val Scala3 = "3.2.2"

inThisBuild(
List(
organization := "dev.zio",
Expand All @@ -13,14 +18,13 @@ inThisBuild(
url("http://degoes.net")
)
),
resolvers +=
"Sonatype OSS Snapshots 01" at "https://s01.oss.sonatype.org/content/repositories/snapshots",
pgpPassphrase := sys.env.get("PGP_PASSWORD").map(_.toArray),
pgpPublicRing := file("/tmp/public.asc"),
pgpSecretRing := file("/tmp/secret.asc"),
resolvers +=
"Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
crossScalaVersions := List("2.12.16", "2.13.8", "3.1.2"),
crossScalaVersions := List(Scala211, Scala212, Scala213, Scala3),
scalaVersion := Scala213,
scalacOptions ++= List(
"-Xfatal-warnings",
"-feature",
"-language:higherKinds"
),
scalacOptions ++= (
if (scalaVersion.value.startsWith("3"))
Seq("-Ykind-projector")
Expand All @@ -29,13 +33,27 @@ inThisBuild(
)
)

addCommandAlias("fix", "; all scalafmtSbt scalafmtAll")
addCommandAlias("check", "; scalafmtSbtCheck; scalafmtCheckAll; Test/compile")

lazy val root =
project
.in(file("."))
.settings(publish / skip := true)
.aggregate(core, example, docs)
.settings(
publish / skip := true,
crossScalaVersions := List() // override because we set it in `inThisBuild`
)
.aggregate(
core.js,
core.jvm,
core.native,
docs,
examples.js,
examples.jvm,
examples.native
)

lazy val core = project
lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.in(file("core"))
.settings(
name := "zio-constraintless",
Expand All @@ -49,26 +67,32 @@ lazy val core = project
)
)
)
.enablePlugins(BuildInfoPlugin)

lazy val example = (project in (new File("examples")))
lazy val examples = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.in(file("examples"))
.settings(
name := "zio-constraintless-examples",
publish / skip := true
publish / skip := true,
crossScalaVersions -= Scala211
)
.dependsOn(core)
.enablePlugins(BuildInfoPlugin)

lazy val docs = project
.in(file("zio-constraintless-docs"))
.settings(
name := "zio-constraintless-docs",
crossScalaVersions -= Scala211,
scalacOptions -= "-Yno-imports",
scalacOptions -= "-Xfatal-warnings",
projectName := "ZIO Constraintless",
mainModuleName := (core / moduleName).value,
mainModuleName := (core.jvm / moduleName).value,
projectStage := ProjectStage.Development,
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(core),
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(core.jvm),
docsPublishBranch := "master",
ciWorkflowName := "Website"
)
.dependsOn(core)
.dependsOn(core.jvm)
.enablePlugins(BuildInfoPlugin)
.enablePlugins(WebsitePlugin)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ case class Prod[As <: TypeList, A, B](
a: Expr[As, A],
b: Expr[As, B],
c1: A IsElementOf As,
c2: B IsElementOf As,
c2: B IsElementOf As
) extends Expr[As, (A, B)]

case class Cond[As <: TypeList, A](
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.6.2
sbt.version = 1.8.2
10 changes: 8 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.7")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.11")
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.10")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.1.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.12.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.9")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
6 changes: 0 additions & 6 deletions project/project/metals.sbt

This file was deleted.

6 changes: 0 additions & 6 deletions project/project/project/metals.sbt

This file was deleted.

0 comments on commit 645af4a

Please sign in to comment.