alexarchambault on 1.6.3
alexarchambault on master
1.6.3 (compare)
lihaoyi on gh-pages
5ad9ae5538f23cab92ccd8c6b1617d8… (compare)
alexarchambault on master
Partly revert 84d48542 (#923) … (compare)
--thin
)
install
command of coursier.
trying to parse docker logs, and im getting the following throwbale
java.lang.IllegalArgumentException: Unknown ansi-escape at index 3083 inside string cannot be parsed into an fansi.Str
fansi.ErrorMode$Throw$.handle(Fansi.scala:417)
fansi.ErrorMode$Throw$.handle(Fansi.scala:405)
fansi.Str$.apply(Fansi.scala:270)
fansi.Str$.implicitApply(Fansi.scala:225)
pprint.Renderer.$anonfun$rec$27(Renderer.scala:136)
pprint.Result$.fromString(Result.scala:53)
pprint.Renderer.rec(Renderer.scala:136)
pprint.Renderer.$anonfun$rec$15(Renderer.scala:97)
scala.collection.Iterator$$anon$10.next(Iterator.scala:448)
pprint.Util$ConcatIterator.check(Util.scala:32)
pprint.Util$ConcatIterator.hasNext(Util.scala:40)
pprint.Util$ConcatIterator.check(Util.scala:29)
pprint.Util$ConcatIterator.hasNext(Util.scala:40)
pprint.Util$ConcatIterator.check(Util.scala:29)
pprint.Util$ConcatIterator.hasNext(Util.scala:40)
pprint.Util$ConcatIterator.check(Util.scala:29)
pprint.Util$ConcatIterator.hasNext(Util.scala:40)
pprint.Util$ConcatIterator.check(Util.scala:29)
pprint.Util$ConcatIterator.hasNext(Util.scala:40)
pprint.Util$ConcatIterator.check(Util.scala:29)
pprint.Util$ConcatIterator.hasNext(Util.scala:40)
scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:500)
pprint.Truncated.next(Truncated.scala:93)
pprint.Truncated.next(Truncated.scala:11)
scala.collection.Iterator$$anon$10.next(Iterator.scala:448)
scala.collection.Iterator.foreach(Iterator.scala:929)
scala.collection.Iterator.foreach$(Iterator.scala:929)
scala.collection.AbstractIterator.foreach(Iterator.scala:1406)
ammonite.repl.ReplApiImpl.show(ApiImpls.scala:105)
ammonite.repl.ReplApiImpl.show$(ApiImpls.scala:92)
ammonite.repl.Repl$$anon$1.show(Repl.scala:76)
ammonite.repl.ReplApiImpl.show(ApiImpls.scala:88)
ammonite.repl.ReplApiImpl.show$(ApiImpls.scala:88)
ammonite.repl.Repl$$anon$1.show(Repl.scala:76)
ammonite.$sess.cmd125$.<init>(cmd125.sc:1)
ammonite.$sess.cmd125$.<clinit>(cmd125.sc)
is there any way i could preprocess the strings and get rid of those characters?
repl.pprinter
to not try to be clever with strings, but that's more work (not that much more tho)
Does the ammonite/mill's import $ivy
syntax have anything equivalent to sbts classpathTypes
which lets you import extra types of artifacts (just just jar/source etc)?
I am unable to use:
import $ivy.`org.vafer:jdeb:1.7`
because it declares its artifact to be type maven-plugin
(not jar) and is ignored by coursier.
In sbt you can fix this with:
classpathTypes += "maven-plugin"
Any workaround?
interp
api to load stuff into the classpath. That artifact is then taken into account for the compilation of the next stage of your script (or the downstream scripts) : http://ammonite.io/#Multi-stageScripts
@Baccata Yeah that works. Not pretty though:
coursier fetch org.vafer:jdeb:1.7
and then
import $ivy.`org.vafer:jdeb:1.7`
interp.load.cp(Seq(os.Path(coursier.cache.CacheDefaults.location + "/https/repo1.maven.org/maven2/org/vafer/jdeb/1.7/jdeb-1.7.jar")))
@
It not obvious how/where you would insert this into the ammonite code
i would like to use repl.sess.save and repl.sess.load in my scala code, - they are visible from the predef, but i would like to use them inside a class that belongs to a different package.
from what i understand, they become available after the shell is started with Main(), but id like the following piece of code to compile as well"
// def getArtificats(
// service: String,
// serviceVersion: String,
// serviceDependencyVersion: String,
// namespace: String
// ) {
//
//
// val sessionTag = s"$service:$serviceVersion:$serviceDependencyVersion"
// repl.sess.save(sessionTag)
//
// val dep = coursier.
// Dependency(
// coursier.Module(namespace, service),
// serviceVersion,
// attributes = coursier.Attributes(classifier = "fat")
// )
//
// printf(s"finished fetching dependencies for $service-$serviceVersion with dependencies from version $serviceDependencyVersion")
// repl.sess.load(sessionTag)
// printf(s"session $sessionTag restored ")
// }
instantiateInterpreter
and processModule
heads in the right direction, but the details seem hazy, especially around accessing bindings in the .sc
.