-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'version-1.5.x' into NODE-2606
- Loading branch information
Showing
65 changed files
with
533 additions
and
244 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
lang/jvm/src/main/scala/com/wavesplatform/lang/FileCompiler.scala
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,33 @@ | ||
package com.wavesplatform.lang | ||
|
||
import com.google.common.base.Charsets | ||
import com.google.common.io | ||
import com.wavesplatform.lang.v1.estimator.v3.ScriptEstimatorV3 | ||
|
||
import java.io.File | ||
|
||
object FileCompiler extends App { | ||
private val estimator = ScriptEstimatorV3.latest | ||
|
||
args | ||
.foreach { path => | ||
val scriptFile = new File(path).getAbsoluteFile | ||
require(scriptFile.isFile, s"$path is not a file") | ||
val baseDirectory = scriptFile.getParentFile | ||
val imports = baseDirectory | ||
.listFiles({ (pathname: File) => | ||
pathname.isFile && pathname.getAbsoluteFile != scriptFile | ||
}) | ||
.map { f => | ||
f.getName -> io.Files.asCharSource(f, Charsets.UTF_8).read() | ||
} | ||
.toMap | ||
|
||
API | ||
.compile(io.Files.asCharSource(scriptFile, Charsets.UTF_8).read(), estimator, libraries = imports) | ||
.fold( | ||
error => throw new RuntimeException(s"$error while compiling $path"), | ||
_ => println(s"successfully compiled $path") | ||
) | ||
} | ||
} |
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
20 changes: 0 additions & 20 deletions
20
lang/shared/src/main/scala/com/wavesplatform/lang/FileCompiler.scala
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.