ant
compile
ターゲットは、<src path="..."/>
タグを使用して指定されたsrc
フォルダのいずれかにあるすべてのファイルをコンパイルします。私の質問は、編集の順番です。 ant
は最初にsrc
タグで参照されるファイルをコンパイルしますか(つまり、最初にJavaファイルを${xtext.project.path}/src
にコンパイルします)、次に2番目のsrc
タグなどをコンパイルしますか?コンパイルされたファイルはどのような順序ですか?私はフォルダ間の依存関係を把握しようとしています。antターゲットでのコンパイルの順序
<target name="compile">
<echo message="${ant.project.name}: ${ant.file}"/>
<deps-load-path conf="core" pathid="core.ivy.classpath" />
<deps-load-path conf="test" pathid="test.ivy.classpath" />
<javac debug="true" includeantruntime="false" debuglevel="source,lines,vars" destdir="${bin.path}" source="1.8" target="1.8">
<src path="${xtext.project.path}/src"/>
<src path="${xtext.project.path}/src-gen"/>
<src path="${project.path}/src"/>
<src path="${project.path}/src-gen-umpletl"/>
<src path="${project.path}/src-gen-umple"/>
<src path="${project.path}/test"/>
<src path="${vendors.path}/jopt-simple/src"/>
<exclude name="**/.git"/>
<exclude name="**/*.ump" />
<exclude name="**/data" />
<classpath refid="project.classpath"/>
<classpath refid="validator.project.classpath"/>
<classpath refid="core.ivy.classpath" />
<classpath refid="test.ivy.classpath" />
<!-- Add compiler arguments here, see https://ant.apache.org/manual/using.html#arg for details, example below
<compilerarg value="-Xlint:deprecation" />
-->
</javac>
<copy todir="${bin.path}" overwrite="true">
<fileset dir="${project.path}/src"><include name="**/*.grammar"/></fileset>
<fileset dir="${project.path}/src"><include name="**/*.error"/></fileset>
</copy>
<delete file="cruise.umple/src/rules.grammar"/>
<delete file="cruise.umple/bin/rules.grammar"/>
</target>
他の質問に答えることができるのだろうかと思います。 'project.classpath'は' $ {bin.path} 'と同じ場所にファイルのどこかで定義されます。これはコンパイルされたファイルが書き込まれる場所です。 '$ {bin.path}'はクラスパスの依存関係と '.class'ファイルが書き込まれる場所の両方になりますか?私は '$ {bin.path}'が各ビルドの前に削除されるという事実を知っていますので、 'compile'ターゲットを実行する前にフォルダ内に何もありません。 'compile'ターゲットとして生成される' .class'ファイルは 'classpath'に追加されて実行されますか? – Adam
私はこれについて別の質問をしました:http://stackoverflow.com/questions/42913499/classpath-and-ant-builds – Adam