Skip to content

SubScript developer's cheat sheet

anatoliykmetyuk edited this page Nov 21, 2014 · 6 revisions

Commands

Application developer's commands

These commands are used when working with projects that use SubScript.

Operation Command Description
Build gradle build Builds the project - compiles it and then creates a jar-file with the bytecode.
Run gradle run Runs the project.
Debug gradle debug Launches SubScript Debugger to debug the project.

Core developer's commands

These commands are used when working with SubScript distribution.

Operation Command Description
Build SubScript ant build Builds SubScript without publishing.
Publish to local Maven repository ant publish-local -Ddocs.skip=1 Builds SubScript and publishes it to the local Maven repository. -Ddocs.skip=1 tells Ant to skip documentation generation, which may be time-consuming.
Clean everything ant all.clean Removes all the compiled class files, including the locker.
Run OperatorsSuite test build/pack/bin/scala subscript.test.OperatorsSuiteApp Tests SubScript operators. -v at the end will produce verbose output.
View AST $SUBSCRIPT_HOME/build/pack/bin/scalac -Ybrowse:$PHASE $SOURCE_FILE
  • $SUBSCRIPT_HOME - a path to the SubScript root folder. $SUBSCRIPT_HOME/build/pack/bin/scalac will point to the SubScript Scala compiler executable when $SUBSCRIPT_HOME is set correctly.
  • $PHASE - the compiler phase after which the AST will be displayed (e.g. 1 or parser). The names of the phases can be found in the compiler documentation.
  • $SOURCE_FILE
  • - a path to the source file to be examined.
Note that if the source file depends on a third-party bytecode (one that doesn't belong to Scala or SubScript distributions), it should be included using the -classpath flag as defined by the compiler documentation.
Print Syntax Trees $SUBSCRIPT_HOME/build/pack/bin/scalac -Xprint:$PHASE [-Yshow-trees-compact] $SOURCE_FILE Prints the syntax trees after the specified phase to the console.
Typer debug output $SUBSCRIPT_HOME/build/pack/bin/scalac -Ytyper-debug $SOURCE_FILE Print the typer phase debug information to the output.
Clone this wiki locally