How to install maxPrintString in assembly files

How to set this parameter in assembly files?

In REPL, this can be done using the commands below, but I want to avoid this every time I start the console:

:power vals.isettings.maxPrintString = 10000 
+1
source share
2 answers
 apm@mara :~$ scala Welcome to Scala version 2.11.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0). Type in expressions to have them evaluated. Type :help for more information. scala> "X" * 2000 res0: String = ... scala> :q apm@mara :~$ scala -Dscala.repl.maxprintstring=2000 Welcome to Scala version 2.11.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0). Type in expressions to have them evaluated. Type :help for more information. scala> "X" * 2000 res0: String = ... scala> 

Edit: the value seems to contain the res0: String = .

Also, since you said the build file, I noticed that this does not work:

 > apm@mara :~/goofy$ sbt [info] Set current project to goofy (in build file:/home/apm/goofy/) > set initialCommands in console := "$intp.isettings.maxPrintString = 2000" [info] Defining *:console::initialCommands [info] The new value will be used by compile:console, compile:consoleQuick and 1 others. [info] Run `last` for details. [info] Reapplying settings... [info] Set current project to goofy (in build file:/home/apm/goofy/) > console [info] Starting scala interpreter... [info] <console>:10: error: not found: value $intp val $ires0 = $intp.isettings.maxPrintString ^ <console>:7: error: not found: value $intp $intp.isettings.maxPrintString = 2000 ^ Welcome to Scala version 2.11.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0). Type in expressions to have them evaluated. Type :help for more information. scala> $intp.isettings.maxPrintString = 2000 $intp.isettings.maxPrintString: Int = 2000 

I remember that sbt evaluates initialCommands earlier, apparently before REPL can bind $intp .

But it works:

 apm@mara :~/goofy$ sbt -Dscala.repl.maxprintstring=2000 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384m; support was removed in 8.0 [info] Set current project to goofy (in build file:/home/apm/goofy/) > console [info] Starting scala interpreter... [info] Welcome to Scala version 2.10.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0). Type in expressions to have them evaluated. Type :help for more information. scala> "X" * 1500 res0: String = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX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XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
+1
source

Not the pretties method, but perhaps you can override the console task and set the property @ som-snytt talked about.

 val initializeMaxPrintString = taskKey[String]("Initialize scala.repl.maxprintstring") initializeMaxPrintString := { sys props "scala.repl.maxprintstring" = "10000" } console in Compile := (console in Compile dependsOn initializeMaxPrintString).value console in Compile := { val c = (console in Compile).value sys.props remove "scala.repl.maxprintstring" c } 

The drawback is the same as for @ som-snytt's answer, res0: String = will be taken into account.

+2
source

Source: https://habr.com/ru/post/975760/


All Articles