-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add millw script for Windows builds * Add additional test-case * Create basic Name type #1
- Loading branch information
1 parent
c8297eb
commit b2b0fe1
Showing
6 changed files
with
248 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ output/ | |
.DS_STORE | ||
.idea_modules | ||
.idea | ||
.ionide | ||
.vscode | ||
out/ | ||
/.bloop/ | ||
/.metals/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,31 @@ | ||
import mill._ | ||
import mill.scalalib._ | ||
import mill.scalalib.scalafmt._ | ||
import $ivy.`com.lihaoyi::mill-contrib-bloop:$MILL_VERSION` | ||
|
||
object core extends Cross[CoreModule]("2.12.10", "2.13.1") { | ||
object core extends Cross[CoreModule]("2.12.10", "2.13.1") {} | ||
|
||
class CoreModule(val crossScalaVersion: String) | ||
extends CrossScalaModule | ||
with MorphirModule { | ||
def ivyDeps = Agg( | ||
ivy"com.lihaoyi::upickle::1.0.0" | ||
) | ||
object test extends Tests with MorphirTestModule {} | ||
} | ||
|
||
class CoreModule(val crossScalaVersion:String) extends CrossScalaModule with MorphirModule { | ||
def ivyDeps = Agg( | ||
ivy"com.lihaoyi::upickle::1.0.0" | ||
) | ||
object test extends Tests with MorphirTestModule { | ||
|
||
} | ||
} | ||
trait MorphirModule extends ScalafmtModule { this: ScalaModule => } | ||
|
||
trait MorphirModule extends ScalafmtModule { this:ScalaModule => | ||
} | ||
|
||
trait MorphirTestModule extends TestModule with ScalaModule { | ||
def ivyDeps = Agg( | ||
ivy"org.scalatest::scalatest:3.1.1", | ||
ivy"dev.zio::zio-test:${Versions.zio}", | ||
ivy"dev.zio::zio-test-sbt:${Versions.zio}", | ||
|
||
) | ||
def testFrameworks = Seq("org.scalatest.tools.Framework", "zio.test.sbt.ZTestFramework") | ||
trait MorphirTestModule extends TestModule { | ||
def ivyDeps = Agg( | ||
ivy"org.scalatest::scalatest:3.1.1", | ||
ivy"dev.zio::zio-test:${Versions.zio}", | ||
ivy"dev.zio::zio-test-sbt:${Versions.zio}" | ||
) | ||
def testFrameworks = | ||
Seq("org.scalatest.tools.Framework", "zio.test.sbt.ZTestFramework") | ||
} | ||
|
||
object Versions { | ||
val zio = "1.0.0-RC17" | ||
} | ||
val zio = "1.0.0-RC18" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
package com.morganstanley.morphir.ir.advanced | ||
import com.morganstanley.morphir.ir.Name | ||
|
||
sealed trait Type[+Extra] | ||
object Type { | ||
case class Function[A](argType:Type[A], returnType:Type[A], extra:A) extends Type[A] | ||
case class Unit[A](extra:A) extends Type[A] | ||
} | ||
case class Variable[A](name: Name, extra: A) extends Type[A] | ||
case class Function[A](argType: Type[A], returnType: Type[A], extra: A) | ||
extends Type[A] | ||
case class Unit[A](extra: A) extends Type[A] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
@echo off | ||
|
||
rem This is a wrapper script, that automatically download mill from GitHub release pages | ||
rem You can give the required mill version with --mill-version parameter | ||
rem If no version is given, it falls back to the value of DEFAULT_MILL_VERSION | ||
rem | ||
rem Project page: https://github.com/lefou/millw | ||
rem | ||
rem If you want to improve this script, please also contribute your changes back! | ||
rem | ||
rem Licensed under the Apache License, Version 2.0 | ||
|
||
rem setlocal seems to be unavailable on Windows 95/98/ME | ||
rem but I don't think we need to support them in 2019 | ||
setlocal enabledelayedexpansion | ||
|
||
set "DEFAULT_MILL_VERSION=0.5.0" | ||
|
||
rem %~1% removes surrounding quotes | ||
if [%~1%]==[--mill-version] ( | ||
rem shift command doesn't work within parentheses | ||
if not [%~2%]==[] ( | ||
set MILL_VERSION=%~2% | ||
) else ( | ||
echo You specified --mill-version without a version. | ||
echo Please provide a version that matches one provided on | ||
echo https://github.com/lihaoyi/mill/releases | ||
exit /b 1 | ||
) | ||
) | ||
|
||
if [!MILL_VERSION!]==[] ( | ||
if exist .mill-version ( | ||
set /p MILL_VERSION=<.mill-version | ||
) | ||
) | ||
|
||
if [!MILL_VERSION!]==[] ( | ||
set MILL_VERSION=%DEFAULT_MILL_VERSION% | ||
) | ||
|
||
set MILL_DOWNLOAD_PATH=%USERPROFILE%\.mill\download | ||
|
||
rem without bat file extension, cmd doesn't seem to be able to run it | ||
set MILL=%MILL_DOWNLOAD_PATH%\!MILL_VERSION!.bat | ||
|
||
if not exist "%MILL%" ( | ||
set VERSION_PREFIX=%MILL_VERSION:~0,4% | ||
set DOWNLOAD_SUFFIX=-assembly | ||
if [!VERSION_PREFIX!]==[0.0.] set DOWNLOAD_SUFFIX= | ||
if [!VERSION_PREFIX!]==[0.1.] set DOWNLOAD_SUFFIX= | ||
if [!VERSION_PREFIX!]==[0.2.] set DOWNLOAD_SUFFIX= | ||
if [!VERSION_PREFIX!]==[0.3.] set DOWNLOAD_SUFFIX= | ||
if [!VERSION_PREFIX!]==[0.4.] set DOWNLOAD_SUFFIX= | ||
set VERSION_PREFIX= | ||
|
||
rem there seems to be no way to generate a unique temporary file path (on native Windows) | ||
set DOWNLOAD_FILE=%MILL%.tmp | ||
|
||
echo Downloading mill %MILL_VERSION% from https://github.com/lihaoyi/mill/releases ... | ||
|
||
rem curl is bundled with recent Windows 10 | ||
rem but I don't think we can expect all the users to have it in 2019 | ||
rem bitadmin seems to be available on Windows 7 | ||
rem without /dynamic, github returns 403 | ||
rem bitadmin is sometimes needlessly slow but it looks better with /priority foreground | ||
if not exist "%MILL_DOWNLOAD_PATH%" mkdir "%MILL_DOWNLOAD_PATH%" | ||
bitsadmin /transfer millDownloadJob /dynamic /priority foreground "https://github.com/lihaoyi/mill/releases/download/%MILL_VERSION%/%MILL_VERSION%!DOWNLOAD_SUFFIX!" "!DOWNLOAD_FILE!" | ||
if not exist "!DOWNLOAD_FILE!" ( | ||
echo Could not download mill %MILL_VERSION% | ||
exit 1 | ||
) | ||
|
||
move /y "!DOWNLOAD_FILE!" "%MILL%" | ||
|
||
set DOWNLOAD_FILE= | ||
set DOWNLOAD_SUFFIX= | ||
) | ||
|
||
set MILL_DOWNLOAD_PATH= | ||
set MILL_VERSION= | ||
|
||
%MILL% -i %* |