0
我有一个名为jarPLCExample.xml
的ant文件,它需要一些类文件并生成一个jar文件。这个文件的<jar>
标签部分在sbt中看起来像什么?将创建jar文件的ant脚本转换为sbt
<project name="jar_myplc" default="jar_myplc" basedir=".">
<property file="../resources/v2.properties"/>
<property name="dist.dir" value="C://where_jar_files_go/lib"/>
<property name="dist.file" value="${dist.dir}/PLC.jar"/>
<target name="jar_myplc">
<tstamp>
<format property="TODAY" pattern="dd/MM/yyyy hh:mm aa" locale="au"/>
</tstamp>
<delete file="${dist.file}" quiet="true"/>
<jar destfile="${dist.file}">
<fileset dir="${v2.out.root}" includes="com/companyname/server/applic/**/*.class"/>
<fileset dir="${v2.out.root}" includes="com/companyname/common/utils/SeaDef*.class"/>
</jar>
<copy file="${dist.file}" todir="C:/deploy"/>
</target>
SBT组装没有好这个,因为它似乎可以排除与包括广口瓶,但没有源文件包和源文件名作为需要在这里完成。
对'随流'显然很重要:我期望sbt将要从源代码编译,因此不需要显式使用.class文件作为上面的ant任务。
我已经在基本目录中有一个build.sbt,并且将这个文件称为jarPLCExample.sbt是明智的,但我不知道如何让sbt加载一个特定的文件。因此,我将在一个文件中包含两个项目,并通过更改顺序手动设置当前项目。 (因为他们都有相同的密钥,第二个似乎覆盖第一个--命令将始终只显示一个项目)。