1fsc(1)                           USER COMMANDS                          fsc(1)
2
3
4

NAME

6       fsc - Fast offline compiler for the Scala 2 language
7

SYNOPSIS

9       fsc  [ <options> ] <source files>
10

PARAMETERS

12       <options>
13              Command line options. See OPTIONS below.
14
15       <source files>
16              One or more source files to be compiled (such as MyClass.scala).
17

OPTIONS

19       The offline compiler supports all options of scalac plus the following:
20
21       -reset Reset compile server caches.
22
23       -shutdown
24              Shut  down  the  compilation  daemon.   The  daemon  attempts to
25              restart itself as necessary, but sometimes an explicit  shutdown
26              is  required. A common example is if jars on the class path have
27              changed.
28
29       -server <hostname:portnumber>
30              Specify compile server host at port number.  Usually this option
31              is  not  needed.  Note that the hostname must be for a host that
32              shares the same filesystem.
33
34       -J<flag>
35              Pass <flag> directly to the Java VM for the compilation daemon.
36

DESCRIPTION

38       The fsc tool submits Scala compilation jobs to  a  compilation  daemon.
39       The  first time it is executed, the daemon is started automatically. On
40       subsequent runs, the same daemon can be reused,  thus  resulting  in  a
41       faster  compilation.  The  tool is especially effective when repeatedly
42       compiling with the same class paths, because the compilation daemon can
43       reuse a compiler instance.
44
45       The  compilation  daemon  is  smart enough to flush its cached compiler
46       when the class path changes.  However, if the  contents  of  the  class
47       path  change,  for  example due to upgrading a library, then the daemon
48       should be explicitly shut down with -shutdown.
49
50       Note that the scala script runner will also use the offline compiler by
51       default, with the same advantages and caveats.
52

EXAMPLE

54       The following session shows a typical speed up due to using the offline
55       compiler.
56
57       > fsc -verbose -d /tmp test.scala
58       ...
59       [Port number: 32834]
60       [Starting new Scala compile server instance]
61       [Classpath = ...]
62       [loaded directory path ... in 692ms]
63       ...
64       [parsing test.scala]
65       ...
66       [total in 943ms]
67
68       > fsc -verbose -d /tmp test.scala
69       ...
70       [Port number: 32834]
71       [parsing test.scala]
72       ...
73       [total in 60ms]
74
75       > fsc -verbose -d /tmp test.scala
76       ...
77       [Port number: 32834]
78       [parsing test.scala]
79       ...
80       [total in 42ms]
81
82       > fsc -verbose -shutdown
83       [Scala compile server exited]
84
85

ENVIRONMENT

87       JAVACMD
88              Specify the java command to be used for running the Scala  code.
89              Arguments  may be specified as part of the environment variable;
90              spaces, quotation marks, etc., will be passed  directly  to  the
91              shell for expansion.
92
93       JAVA_HOME
94              Specify JDK/JRE home directory. This directory is used to locate
95              the java command unless JAVACMD variable set.
96
97       JAVA_OPTS
98              Specify the options to be passed to the java command defined  by
99              JAVACMD.
100
101              One  might  for  example  configure  the memory usage of the JVM
102              with: JAVA_OPTS="-Xmx2G -Xss16M"
103

EXIT STATUS

105       fsc returns a zero exit status if it succeeds to compile the  specified
106       input files. Non zero is returned in case of failure.
107

AUTHOR

109       Written by Martin Odersky and other members of the Scala team.
110

REPORTING BUGS

112       Report bugs to https://github.com/scala/bug/issues.
113
115       This is open-source software, available to you under the Apache License
116       2.0. See accompanying "copyright" or "LICENSE" file for copying  condiā€
117       tions.  There  is  NO warranty; not even for MERCHANTABILITY or FITNESS
118       FOR A PARTICULAR PURPOSE.
119

SEE ALSO

121       scala(1), scalac(1), scaladoc(1), scalap(1)
122
123
124
125version 0.5                       March 2012                            fsc(1)
Impressum