編集コードはもちろん MPS エディターを必要とします。しかしモデルの生成と 自動テストと統合するためにコマンドラインからテストを実行することができます。 構築します。基礎として Ant が使用されます。このセクションでは MPS の使い方を説明します ant を介してコマンドラインから。
すべての例で、build.properties ファイルを使用します。 次の 2 つの特性
mps.home = // installation directory of MPS itself
mbeddr.home = // the root directory relative to which all other directories
// to projects etc. are specified
<project name="com.mbeddr.core build and test" default="all">
<property file="build.properties"/>
<path id="mps.ant.path">
<pathelement location="${mps.home}/lib/mps-backend.jar"/>
<pathelement location="${mps.home}/lib/jdom.jar"/>
<pathelement location="${mps.home}/lib/log4j.jar"/>
<pathelement location="${mps.home}/lib/mps-core.jar"/>
</path>
<taskdef resource="jetbrains/mps/build/ant/antlib.xml"
classpathref="mps.ant.path"/>
<jvmargs id="myargs">
<arg value="-ea"/>
<arg value="-Xss1024k"/>
<arg value="-Xmx1024m"/>
<arg value="-XX:MaxPermSize=92m"/>
<arg value="-XX:+HeapDumpOnOutOfMemoryError"/>
</jvmargs>
<!-- here is the place where all the following example code goes -->
</project>
プロジェクトで言語を構築する
プロジェクトの内容を構築することから始めます。これが必要な ant コードです。 上記のスケルトン Ant ファイルで囲む必要があります。
<!-- project with solutions that should be built -->
<property name="solutionproject.dir" value="path/to/some/solution/project"/>
<!-- two projects that contain languages used by solutionproject -->
<property name="langproject.dir" value="path/to/some/project"/>
<property name="other.langproject.dir" value="path/to/other/project"/>
<target name="build-solutions">
<mps.generate>
<jvmargs refid="myargs"/>
<!-- set up libs to point to the lang projects -->
<library name="langproject" dir="${mbeddr.home}/${langproject.dir}"/>
<library name="other.langproject"
dir="${mbeddr.home}/${other.langproject.dir}"/>
<!-- generate two solutions in the project -->
<modules dir="${mbeddr.home}/${solutionproject.fit}/solutions/solution1"/>
<modules dir="${mbeddr.home}/${solutionproject.fit}/solutions/solution2"/>
</mps.generate>
</target>