aboutsummaryrefslogtreecommitdiff
path: root/stage2/plugins/Frege.scala
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2017-02-11 17:05:56 -0500
committerChristopher Vogt <oss.nsp@cvogt.org>2017-02-11 17:05:56 -0500
commitaca3c4dab2528b30ffad73b67ef95e41ab485304 (patch)
tree2e779dba3f043dfd7a36bf03c9107641aef63f3c /stage2/plugins/Frege.scala
parent59666ddfdca48ae79ef38bcf42427954c6fea17d (diff)
downloadcbt-aca3c4dab2528b30ffad73b67ef95e41ab485304.tar.gz
cbt-aca3c4dab2528b30ffad73b67ef95e41ab485304.tar.bz2
cbt-aca3c4dab2528b30ffad73b67ef95e41ab485304.zip
omit classpath when classpath is empty (= no dependencies, only jdk)
Diffstat (limited to 'stage2/plugins/Frege.scala')
-rw-r--r--stage2/plugins/Frege.scala11
1 files changed, 5 insertions, 6 deletions
diff --git a/stage2/plugins/Frege.scala b/stage2/plugins/Frege.scala
index c0868af..b5a4dd0 100644
--- a/stage2/plugins/Frege.scala
+++ b/stage2/plugins/Frege.scala
@@ -67,8 +67,6 @@ class FregeLib(
val d = Dependencies(dependencies)
val classpath = d.classpath
val cp = classpath.string
- if(classpath.files.isEmpty)
- throw new Exception("Trying to compile with empty classpath. Source files: " ++ sourceFiles.toString)
if( sourceFiles.isEmpty ){
None
@@ -78,11 +76,13 @@ class FregeLib(
if( d.lastModified > lastCompiled || sourceFiles.exists(_.lastModified > lastCompiled) ){
val _class = "frege.compiler.Main"
+ val fp = (fregeDependency.classpath.strings ++ fregeDependencies.map(_.classpath.string))
val dualArgs =
Seq(
"-target", fregeTarget,
- "-d", compileTarget.toString,
- "-fp", (fregeDependency.classpath.strings ++ fregeDependencies.map(_.classpath.string)).mkString(":")
+ "-d", compileTarget.toString
+ ) ++ (
+ if(fp.isEmpty) Nil else Seq("-fp", fp.mkString(":"))
)
val singleArgs = fregeOptions
val code =
@@ -111,8 +111,7 @@ ${singleArgs.mkString(" \\\n")} \\
\\
-bootclasspath \\
${fregeDependency.classpath.strings.mkString(":\\\n")} \\
--classpath \\
-${classpath.strings.mkString(":\\\n")} \\
+${if(classpath.strings.isEmpty) "" else (" -fp \\\n" ++ classpath.strings.mkString(":\\\n"))} \\
\\
${sourceFiles.sorted.mkString(" \\\n")}
"""