8000 Consolidate extensibility project into morphir project & work on typeOf by DamianReeves · Pull Request #404 · finos/morphir-scala · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Consolidate extensibility project into morphir project & work on typeOf #404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Sep 9, 2023
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
71 changes: 32 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
on:
pull_request:
push:
branches: ['main']
branches: ["main"]
release:
types:
- published
Expand All @@ -17,7 +17,7 @@ on:
# this will not cancel anything for normal git pushes
concurrency:
group: cancel-old-pr-runs-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
cancel-in-progress: true

jobs:
lint:
Expand All @@ -31,8 +31,8 @@ jobs:
- name: Setup Scala and Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
distribution: "temurin"
java-version: "17"
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Lint code
Expand All @@ -47,15 +47,14 @@ jobs:
- name: Check MDoc related files
run: ./mill -i -k __.mdoc


test-js:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
java: ['11'] # Note there is no need ro actually run this for multiple JVM versions for JS
scala: ['2.13.11', '3.3.0']
java: ["11"] # Note there is no need ro actually run this for multiple JVM versions for JS
scala: ["2.13.11", "3.3.1"]
steps:
- name: Checkout current branch
uses: actions/checkout@v3.5.2
Expand All @@ -64,7 +63,7 @@ jobs:
- name: Setup Scala and Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
distribution: "temurin"
java-version: ${{ matrix.java }}
- name: Cache scala dependencies
uses: coursier/cache-action@v6
Expand All @@ -75,10 +74,10 @@ jobs:

- name: Cache JS build output
# when in master repo: all commits to main branch and all additional tags
if: github.ref == 'refs/heads/main' || (github.ref != 'refs/heads/main' && startsWith( github.ref, 'refs/tags/') )
if: github.ref == 'refs/heads/main' || (github.ref != 'refs/heads/main' && startsWith( github.ref, 'refs/tags/') )
uses: actions/cache/save@v3
with:
path: |
path: |
out/morphir/${{matrix.scala}}/**/js/
key: ${{ runner.os }}-mill-js-${{matrix.java}}-${{ matrix.scala }}-${{ github.sha}}-${{ hashFiles('out') }}

Expand All @@ -88,8 +87,8 @@ jobs:
strategy:
fail-fast: false
matrix:
java: ['11', '17']
scala: ['2.13.11', '3.3.0']
java: ["11", "17"]
scala: ["2.13.11", "3.3.1"]
steps:
- name: Checkout current branch
uses: actions/checkout@v3.5.2
Expand All @@ -98,14 +97,14 @@ jobs:
- name: Setup Scala and Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
distribution: "temurin"
java-version: ${{ matrix.java }}
- name: Cache scala dependencies
uses: coursier/cache-action@v6

- name: Run JVM tests
run: |
./mill -i -k -j 0 "morphir[${{matrix.scala}}].__.jvm.__.compile" + "morphir[${{matrix.scala}}].__.jvm.publishArtifacts" + "morphir[${{matrix.scala}}].__.jvm.__.test"
./mill -i -k -j 0 "morphir[${{matrix.scala}}].__.jvm.__.compile" + "morphir[${{matrix.scala}}].__.jvm.publishArtifacts" + "morphir[${{matrix.scala}}].__.jvm.__.test"

- name: Cache JVM build output
# when in master repo: all commits to main branch and all additional tags
Expand All @@ -123,16 +122,16 @@ jobs:
strategy:
fail-fast: false
matrix:
java: ['11'] # Note there is no need ro actually run this for multiple JVM versions for native
scala: ['2.13.11', '3.3.0']
java: ["11"] # Note there is no need ro actually run this for multiple JVM versions for native
scala: ["2.13.11", "3.3.1"]
steps:
- name: Checkout current branch
uses: actions/checkout@v3.5.2
with:
fetch-depth: 0
- name: Install libuv
run: sudo apt-get update && sudo apt-get install -y libuv1-dev

- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
Expand All @@ -141,12 +140,12 @@ jobs:
- name: Setup Scala and Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
distribution: "temurin"
java-version: ${{ matrix.java }}

- name: Run Native tests
run: |
./mill -i -k -j 0 "morphir[${{matrix.scala}}].__.native.__.compile" + "morphir[${{matrix.scala}}].__.native.publishArtifacts" + "morphir[${{matrix.scala}}].__.native.__.test"
./mill -i -k -j 0 "morphir[${{matrix.scala}}].__.native.__.compile" + "morphir[${{matrix.scala}}].__.native.publishArtifacts" + "morphir[${{matrix.scala}}].__.native.__.test"

- name: Cache Native build output
# when in master repo: all commits to main branch and all additional tags
Expand All @@ -158,7 +157,7 @@ jobs:
key: ${{ runner.os }}-mill-native-${{matrix.java}}-${{ matrix.scala }}-${{ github.sha }}-${{ hashFiles('out') }}

publish-sonatype:
# when in master repo: all commits to main branch and all additional tags
# when in master repo: all commits to main branch and all additional tags
if: github.repository == 'finos/morphir-scala' && ( github.ref == 'refs/heads/main' || (github.ref != 'refs/heads/main' && startsWith( github.ref, 'refs/tags/') ) )
needs: [ci]

Expand All @@ -185,7 +184,7 @@ jobs:

- uses: actions/setup-java@v3
with:
java-version: '11'
java-version: "11"
distribution: temurin

- name: Cache scala dependencies
Expand All @@ -201,53 +200,47 @@ jobs:
out/morphir/2.13.11/**/jvm/
out/morphir/build/
key: ${{ runner.os }}-mill-jvm-11-2.13.11-${{ github.sha }}-${{ hashFiles('out') }}
restore-keys:
${{ runner.os }}-mill-jvm-11-2.13.11-${{ github.sha }}-
restore-keys: ${{ runner.os }}-mill-jvm-11-2.13.11-${{ github.sha }}-

- name: Restore Scala 3.3 JVM Build Output From Cache
uses: actions/cache/restore@v3
with:
path: |
out/morphir/3.3.0/**/jvm/
key: ${{ runner.os }}-mill-jvm-11-3.3.0-${{ github.sha }}-${{ hashFiles('out') }}
restore-keys:
${{ runner.os }}-mill-jvm-11-3.3.0-${{ github.sha }}-
out/morphir/3.3.1/**/jvm/
key: ${{ runner.os }}-mill-jvm-11-3.3.1-${{ github.sha }}-${{ hashFiles('out') }}
restore-keys: ${{ runner.os }}-mill-jvm-11-3.3.1-${{ github.sha }}-

- name: Restore Scala 2.13 JS Build Output From Cache
uses: actions/cache/restore@v3
with:
path: |
out/morphir/2.13.11/**/js/
key: ${{ runner.os }}-mill-js-11-2.13.11-${{ github.sha }}-${{ hashFiles('out') }}
restore-keys:
${{ runner.os }}-mill-js-11-2.13.11-${{ github.sha }}-
restore-keys: ${{ runner.os }}-mill-js-11-2.13.11-${{ github.sha }}-

- name: Restore Scala 3.3 JS Build Output From Cache
uses: actions/cache/restore@v3
with:
path: |
out/morphir/3.3.0/**/js/
key: ${{ runner.os }}-mill-js-11-3.3.0-${{ github.sha }}-${{ hashFiles('out') }}
restore-keys:
${{ runner.os }}-mill-js-11-3.3.0-${{ github.sha }}-
out/morphir/3.3.1/**/js/
key: ${{ runner.os }}-mill-js-11-3.3.1-${{ github.sha }}-${{ hashFiles('out') }}
restore-keys: ${{ runner.os }}-mill-js-11-3.3.1-${{ github.sha }}-

- name: Restore Scala 2.13 Native Build Output From Cache
uses: actions/cache/restore@v3
with:
path: |
out/morphir/2.13.11/**/native/
key: ${{ runner.os }}-mill-native-11-2.13.11-${{ github.sha }}-${{ hashFiles('out') }}
restore-keys:
${{ runner.os }}-mill-native-11-2.13.11-${{ github.sha }}-
restore-keys: ${{ runner.os }}-mill-native-11-2.13.11-${{ github.sha }}-

- name: Restore Scala 3.3 Native Build Output From Cache
uses: actions/cache/restore@v3
with:
path: |
out/morphir/3.3.0/**/native/
key: ${{ runner.os }}-mill-native-11-3.3.0-${{ github.sha }}-${{ hashFiles('out') }}
restore-keys:
${{ runner.os }}-mill-native-11-3.3.0-${{ github.sha }}-
out/morphir/3.3.1/**/native/
key: ${{ runner.os }}-mill-native-11-3.3.1-${{ github.sha }}-${{ hashFiles('out') }}
restore-keys: ${{ runner.os }}-mill-native-11-3.3.1-${{ github.sha }}-

- run: ./mill -i -j 0 io.kipp.mill.ci.release.ReleaseModule/publishAll

Expand Down
6 changes: 3 additions & 3 deletions CustomizeTheBuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
* The path to each setting is based on the path in the BuildSettings case class

For example, to disable the JavaScript and Native builds, as well as
to only build with Scala 3.3.0 do the following:
to only build with Scala 3.3.1 do the following:

```
# build.user.conf
js.enable=false
native.enable=false
scala.defaultCrossScalaVersions=3.3.0
scala.defaultCrossScalaVersions=3.3.1
```

It is very useful to generate the IntelliJ settings file in this mode
Expand Down Expand Up @@ -42,7 +42,7 @@ Use `.mill-jvm-opts` to set Java properties for the build.
## Dev Mode

In order to easily disable Native/JS builds and set the Scala
version to 3.3.0 you can also use a global environment variable.
version to 3.3.1 you can also use a global environment variable.
Add the following to your `.zprofile` (on OSX) or `.bashrc` (on Linux)
etc...

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
enablePlugins(MorphirElmPlugin)

scalaVersion := "3.3.0"
scalaVersion := "3.3.1"
46 changes: 26 additions & 20 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import $meta._
import $ivy.`de.tototec::de.tobiasroeser.mill.integrationtest::0.7.1`
import $ivy.`io.chris-kipp::mill-ci-release::0.1.9`
import $ivy.`com.lihaoyi::mill-contrib-buildinfo:$MILL_VERSION`
import $ivy.`com.carlosedp::mill-aliases::0.4.1`
import $file.project.deps, deps.{Deps, MillVersions, Versions => Vers}
import $file.project.modules.docs, docs.{Docusaurus2Module, MDocModule}
import com.carlosedp.aliases._
import de.tobiasroeser.mill.integrationtest._
import io.kipp.mill.ci.release.CiReleaseModule
import millbuild._
Expand Down Expand Up @@ -121,7 +123,6 @@ object morphir extends Cross[MorphirModule](buildSettings.scala.crossScalaVersio

def moduleDeps =
Seq(
morphir(mainScalaVersion).extensibility.jvm,
morphir(mainScalaVersion).jvm,
morphir(mainScalaVersion).runtime.jvm
)
Expand Down Expand Up @@ -167,15 +168,22 @@ trait MorphirModule extends Cross.Module[String] with CrossPlatform { morphir =>
trait Shared extends MorphirCommonCrossModule with MorphirPublishModule {
def ivyDeps = super.ivyDeps() ++ Agg(
Deps.com.beachape.enumeratum,
Deps.com.lihaoyi.fansi,
Deps.com.lihaoyi.geny,
Deps.com.lihaoyi.sourcecode,
Deps.com.lihaoyi.pprint,
Deps.org.typelevel.`paiges-core`,
Deps.org.typelevel.spire,
Deps.dev.zio.`izumi-reflect`,
Deps.dev.zio.zio,
Deps.dev.zio.`zio-json`,
Deps.dev.zio.`zio-prelude`
Deps.dev.zio.`zio-prelude`,
Deps.org.typelevel.`paiges-core`,
Deps.org.typelevel.spire
) ++ Agg.when(isScala3())(
Deps.com.softwaremill.magnolia_3.magnolia
) ++ Agg.when(isScala2())(
Deps.com.softwaremill.magnolia_2.magnolia
)

def compileIvyDeps = super.compileIvyDeps() ++ (if (crossScalaVersion.startsWith("2."))
Agg(
Deps.org.`scala-lang`.`scala-reflect`(crossScalaVersion),
Expand All @@ -190,7 +198,7 @@ trait MorphirModule extends Cross.Module[String] with CrossPlatform { morphir =>
super.scalacOptions() ++ additionalOptions
}

def platformSpecificModuleDeps = Seq(extensibility)
def platformSpecificModuleDeps = Seq(annotations)
}

object jvm extends Shared with MorphirJVMModule {
Expand Down Expand Up @@ -263,19 +271,8 @@ trait MorphirModule extends Cross.Module[String] with CrossPlatform { morphir =>
}
}

object extensibility extends CrossPlatform with CrossValue {
trait Shared extends MorphirCommonCrossModule with MorphirPublishModule {
def ivyDeps = super.ivyDeps() ++ Agg(
Deps.com.lihaoyi.sourcecode,
Deps.com.lihaoyi.fansi,
Deps.com.lihaoyi.pprint,
Deps.dev.zio.`izumi-reflect`,
Deps.org.typelevel.`paiges-core`,
Deps.org.typelevel.spire
)

}

object annotations extends CrossPlatform with CrossValue {
trait Shared extends MorphirCommonCrossModule with MorphirPublishModule
object jvm extends Shared with MorphirJVMModule
object js extends Shared with MorphirJSModule
object native extends Shared with MorphirNativeModule
Expand Down Expand Up @@ -402,7 +399,7 @@ trait MorphirModule extends Cross.Module[String] with CrossPlatform { morphir =>
def enableNative(module: Module): Boolean = crossValue.startsWith("2.13.") && !devMode
trait Shared extends MorphirCommonCrossModule with MorphirPublishModule {
def ivyDeps = Agg(Deps.org.typelevel.`scalac-compat-annotation`)
def platformSpecificModuleDeps = Seq(extensibility, morphir, toolkit.core, toolkit.codec.zio.json)
def platformSpecificModuleDeps = Seq(morphir, toolkit.core, toolkit.codec.zio.json)
}

object jvm extends Shared with MorphirJVMModule {
Expand Down Expand Up @@ -525,7 +522,7 @@ trait MorphirModule extends Cross.Module[String] with CrossPlatform { morphir =>
def ivyDeps = super.ivyDeps() ++ Agg(
Deps.com.lihaoyi.sourcecode
)
def platformSpecificModuleDeps = Seq(extensibility, morphir)
def platformSpecificModuleDeps = Seq(morphir, runtime)
}

object jvm extends Shared with MorphirJVMModule {
Expand Down Expand Up @@ -674,3 +671,12 @@ object site extends Docusaurus2Module with MDocModule {
override def compiledMdocs: Sources = T.sources(mdoc().path)
object test extends ScalaTests with TestModule.Munit {}
}

object MyAliases extends Aliases {
def fmt = alias("mill.scalalib.scalafmt.ScalafmtModule/reformatAll __.sources")
def checkfmt = alias("mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources")
def deps = alias("mill.scalalib.Dependency/showUpdates")
def testall = alias("__.test")
def compileall = alias("__.compile")
def comptestall = alias("__.compile", "__.test")
}
Loading
0