Skip to content

Commit

Permalink
Update version to 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed May 28, 2022
1 parent 003ee03 commit 21a4b0d
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 31 deletions.
53 changes: 39 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM openjdk:11
RUN apt update
RUN apt install -y make
RUN mkdir /irk
RUN git clone https://github.com/propensive/dotty /irk/scala
RUN git clone https://github.com/lampepfl/dotty /irk/scala
RUN mkdir -p /irk/bin
RUN curl -Lo /irk/sbt.tgz https://github.com/sbt/sbt/releases/download/v1.6.1/sbt-1.6.1.tgz
RUN tar xvf /irk/sbt.tgz -C /irk
Expand Down Expand Up @@ -48,20 +48,20 @@ RUN cp -r /irk/one/mod/gesticulate/res/gesticulate /irk/bin/

RUN cd /irk && scala/bin/scalac \
-classpath bin \
-Xmax-inlines 64 \
-language:experimental.fewerBraces \
-language:experimental.saferExceptions \
-language:experimental.erasedDefinitions \
-d bin \
src/core/*.scala \
one/mod/acyclicity/src/core/*.scala \
one/mod/adversaria/src/core/*.scala \
one/mod/caesura/src/core/*.scala \
one/mod/cataract/src/core/*.scala \
one/mod/clairvoyant/src/css/*.scala \
one/mod/clairvoyant/src/time/*.scala \
one/mod/clairvoyant/src/file/*.scala \
one/mod/clairvoyant/src/html/*.scala \
one/mod/clairvoyant/src/http/*.scala \
one/mod/clairvoyant/src/time/*.scala \
one/mod/clairvoyant/src/uri/*.scala \
one/mod/contextual/src/core/*.scala \
one/mod/cosmopolite/src/core/*.scala \
Expand All @@ -75,30 +75,55 @@ RUN cd /irk && scala/bin/scalac \
one/mod/gossamer/src/core/*.scala \
one/mod/guillotine/src/core/*.scala \
one/mod/harlequin/src/core/*.scala \
one/mod/honeycomb/src/core/*.scala \
one/mod/imperial/src/core/*.scala \
one/mod/iridescence/src/core/*.scala \
one/mod/jovian/src/core/*.scala \
one/mod/kaleidoscope/src/core/*.scala \
one/mod/probably/src/core/*.scala \
one/mod/probably/src/cli/*.scala \
one/mod/probably/src/core/*.scala \
one/mod/probably/src/tolerance/*.scala \
one/mod/punctuation/src/core/*.scala \
one/mod/punctuation/src/ansi/*.scala \
one/mod/punctuation/src/html/*.scala \
one/mod/profanity/src/java/**/*.java \
one/mod/profanity/src/core/*.scala \
one/mod/profanity/src/java/**/*.java \
one/mod/rudiments/src/core/*.scala \
one/mod/scintillate/src/uri/*.scala \
one/mod/scintillate/src/core/*.scala \
one/mod/scintillate/src/server/*.scala \
one/mod/scintillate/src/servlet/*.scala \
one/mod/slalom/src/core/*.scala \
one/mod/tarantula/src/core/*.scala \
one/mod/turbulence/src/core/*.scala \
one/mod/wisteria/src/core/*.scala \
one/mod/xylophone/src/core/*.scala

RUN cd /irk && scala/bin/scalac \
-classpath bin \
-Xmax-inlines 64 \
-language:experimental.fewerBraces \
-language:experimental.saferExceptions \
-language:experimental.erasedDefinitions \
-d bin \
one/mod/honeycomb/src/core/*.scala

RUN cd /irk && scala/bin/scalac \
-classpath bin \
-Xmax-inlines 64 \
-language:experimental.fewerBraces \
-language:experimental.saferExceptions \
-language:experimental.erasedDefinitions \
-d bin \
one/mod/punctuation/src/ansi/*.scala \
one/mod/punctuation/src/core/*.scala \
one/mod/punctuation/src/html/*.scala \
one/mod/scintillate/src/core/*.scala \
one/mod/scintillate/src/server/*.scala \
one/mod/scintillate/src/servlet/*.scala \
one/mod/scintillate/src/uri/*.scala \
one/mod/tarantula/src/core/*.scala

RUN cd /irk && scala/bin/scalac \
-classpath bin \
-Xmax-inlines 64 \
-language:experimental.fewerBraces \
-language:experimental.saferExceptions \
-language:experimental.erasedDefinitions \
-d bin \
src/core/*.scala

RUN unzip -q -o -d /irk/bin /irk/scala/dist/target/pack/lib/tasty-core*.jar
RUN unzip -q -o -d /irk/bin /irk/scala/dist/target/pack/lib/compiler-interface*.jar
RUN unzip -q -o -d /irk/bin /irk/scala/dist/target/pack/lib/scala-library*.jar
Expand Down
4 changes: 2 additions & 2 deletions build.irk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"imports": ["../one/build.irk"],
"imports": ["one/build.irk"],
"publishing": {
"username": "propensive",
"group": "com.propensive",
Expand All @@ -25,7 +25,7 @@
"acyclicity/core", "jovian/core", "scintillate/core", "euphemism/core", "honeycomb/core",
"exoskeleton/core", "clairvoyant/time", "imperial/core", "tarantula/core"],
"sources": ["src/core"],
"version": "0.4.4",
"version": "0.5.0",
"docs": ["doc"],
"artifact": {
"main": "irk.Irk",
Expand Down
2 changes: 1 addition & 1 deletion doc/.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.4
0.5.0
1 change: 0 additions & 1 deletion one
Submodule one deleted from 768d5c
7 changes: 5 additions & 2 deletions src/core/compilation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ object Compiler:
val ctx = initCtx.fresh
setup(Array[String]("-d", out.fullname.s, "-deprecation", "-feature", "-Wunused:all",
"-new-syntax", "-Yrequire-targetName", "-Ysafe-init", "-Yexplicit-nulls",
"-Ycheck-all-patmat", ""), ctx).map(_(1)).get
"-Xmax-inlines", "64",
"-Ycheck-all-patmat", "-classpath", classpathText.s, ""), ctx).map(_(1)).get

def run(files: List[File], classpath: Text): List[Diagnostic] =
val ctx = currentCtx.fresh
Expand All @@ -64,10 +65,10 @@ object Compiler:
val sources = files.to(List).map:
file => PlainFile(Path(file.fullname.s))


val run: Run = Scala3.newRun(using ctx2)
cancel.future.andThen:
_ => run.isCancelled = true

run.compile(sources)
finish(Scala3, run)(using ctx2)
reporter.errors.to(List)
Expand All @@ -92,7 +93,9 @@ object Compiler:
catch case err: Throwable =>
if !cancel.isCompleted then
Out.println(StackTrace(err).ansi)

Compiler.synchronized:
Scala3 = new dotty.tools.dotc.Compiler()

Result.Terminal(ansi"The compiler crashed")
else Result.Aborted
4 changes: 3 additions & 1 deletion src/core/irk.scala
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ case class Step(path: File, publishing: Option[Publishing], name: Text,
: Result =
try
val t0 = now()
classesDir.children.foreach(_.delete())
classesDir.children.foreach:
case file: Unix.File => file.delete()
case dir: Unix.Directory => dir.delete()
val cp = compileClasspath(build)
val result = Compiler.compile(id, srcFiles.to(List), cp, classesDir, scriptFile, cancel)
val time = now() - t0
Expand Down
30 changes: 20 additions & 10 deletions src/core/main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,33 @@ object Irk extends Daemon():
props.load(getClass.nn.getClassLoader.nn.getResourceAsStream("compiler.properties").nn)
props.get("version.number").toString.show

def homeDir: Directory = Home()
def homeDir: Unix.Directory = Home()

def cacheDir: Directory =
try unsafely(Home.Cache[jovian.DiskPath]() / t"irk").directory(Ensure)
def cacheDir: Unix.Directory =
try
unsafely(Home.Cache[jovian.DiskPath]() / t"irk").directory(Ensure) match
case dir: Unix.Directory => dir
catch case err: IoError =>
throw AppError(t"The user's cache directory could not be created", err)

def libDir: Directory =
try unsafely(Home.Cache[jovian.DiskPath]() / t"lib").directory(Ensure)
def libDir: Unix.Directory =
try
unsafely(cacheDir / t"lib").directory(Ensure) match
case dir: Unix.Directory => dir
catch case err: IoError =>
throw AppError(t"The user's cache directory could not be created", err)

def tmpDir: Directory =
try unsafely(cacheDir / t"tmp").directory(Ensure)
def tmpDir: Unix.Directory =
try
unsafely(cacheDir / t"tmp").directory(Ensure) match
case dir: Unix.Directory => dir
catch case err: IoError =>
throw AppError(t"The user's temporary directory could not be created", err)

def hashesDir: Directory =
try unsafely(cacheDir / t"hashes").directory(Ensure)
def hashesDir: Unix.Directory =
try
unsafely(cacheDir / t"hashes").directory(Ensure) match
case dir: Unix.Directory => dir
catch case err: IoError =>
throw AppError(t"The user's cache directory could not be created", err)

Expand Down Expand Up @@ -193,7 +201,9 @@ object Irk extends Daemon():
if path.exists() && seen.contains(digest) then readBuilds(build, seen, tail*)
else if path.exists() then
Out.println(ansi"Reading build file ${palette.File}(${path.relativeTo(build.pwd.path).get.show})")
val buildConfig = Json.parse(path.file().read[Text](1.mb)).as[BuildConfig]
val buildConfig = locally:
import unsafeExceptions.canThrowAny
Json.parse(path.file().read[Text](1.mb)).as[BuildConfig]
buildConfig.gen(path, build, seen + digest, files*)
else throw AppError(txt"""Build contains an import reference to a nonexistant build""")

Expand Down

0 comments on commit 21a4b0d

Please sign in to comment.