Compiling Scala code with Ant
来源:百度文库 编辑:神马文学网 时间:2024/04/29 00:59:19
What they don't cover there is what is needed to bundle up that compiled Scala code and put it somewhere that Railo can get at.
Here's the Ant task I use to create and deploy a JAR: Read on for more details of the build-scala and docs-scala tasks... The build-scala task compiles the .scala files to .class files (and is very similar to that shown on the Scala website): The docs-scala task generates JavaDoc-style API documentation from the source code. It's a good idea to do this automatically every time you build the system so the documentation is always up to date. I don't commit the generated docs to git so that no one accidentally gets hold of an old version. And finally the init-scala task sets up the Scala environment for the build / docs tasks: Note that we're relying on the MySQL JDBC driver (the Publisher reads large numbers of records from the database and converts them to a specific XML representation that is needed by a search engine). The last part of the Ant build file is the high-level properties that specify where Scala is installed and the source, build and docs directories: My repo is structured so the build.xml file is in a build folder at the top level, Scala is installed in a scala folder also at the top level (yes, a minimal Scala installation is under git as part of our build process) and the Publisher code is in the publisher folder at the top level (with the source code under a src folder). source: http://corfield.org/blog/index.cfm/do/blog.entry/entry/Compiling_Scala_code_with_Ant
${www} defines my web root and ${scala.home} defines where Scala is installed on my system.
destdir="${docs.dir}"
deprecation="yes" unchecked="yes" addparams="-access:private"
windowtitle="Publisher Documentation"
doctitle="<div>Publisher</div>"
classpathref="build.classpath">