All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.build-template.xml Maven / Gradle / Ivy

Go to download

Jason is a fully-fledged interpreter for an extended version of AgentSpeak, a BDI agent-oriented logic programming language.

There is a newer version: 2.3
Show newest version
<?xml version="1.0" encoding="ISO-8859-1" ?>

<!--

                    This file was generated by Jason <VERSION>
                    http://jason.sf.net

                    <DATE>
-->

<project name   ="<PROJECT-ID>"
         basedir=".."
         default="run">

    <property name="mas2j.project.file" value="<PROJECT-FILE>"/>
    <property name="debug" value="<DEBUG>"/> <!-- use "-debug" to run in debug mode -->
    <property name="build.dir" value="${basedir}/bin/classes" />

    <property name="jasonJar" value="<JASON-JAR>"/>

    <path id="project.classpath">
        <pathelement location="${basedir}"/>
        <pathelement location="${build.dir}"/>
        <pathelement location="${jasonJar}"/>
<PATH-LIB>
    </path>

    <!-- tasks the user can override in his/her c-build.xml script -->
    <target name="user-init">

    </target>
    <target name="user-end">
    </target>

    <target name="init">
        <mkdir dir="${build.dir}" />
        <antcall target="user-init" />
    </target>

    <target name="compile" depends="init">
        <condition property="srcdir" value="${basedir}/src/java" else="${basedir}" >
            <available file="${basedir}/src/java" />
        </condition>
        <javac srcdir="${srcdir}" destdir="${build.dir}" debug="true" optimize="true" includeantruntime="false" >
            <classpath refid="project.classpath"/>
        </javac>
    </target>

    <target name="jar" depends="compile">
        <mkdir dir="${basedir}/lib" />
        <delete file="${ant.project.name}.jar" />
        <copy file="${jasonJar}" tofile="${ant.project.name}.jar" />
        <copy file="${mas2j.project.file}" tofile="default.mas2j" />
        <jar update="yes" jarfile="${ant.project.name}.jar" >
            <fileset dir="${basedir}">
                <include name="**/*.asl" />
                <include name="**/*.mas2j" />
            </fileset>
            <fileset dir="${build.dir}">
                <include name="**/*.class" />
            </fileset>
            <zipgroupfileset dir="${basedir}/lib" includes="**/*.jar" />
            <zipgroupfileset dir="${jasonJar}/../../libs" includes="*.jar" />
            <manifest>
                  <attribute name="Main-Class" value="jason.infra.centralised.RunCentralisedMAS"/>
            </manifest>
        </jar>
        <delete file="default.mas2j" />
    </target>


    <target name="jnlp" depends="jar" >
        <mkdir dir="${basedir}/${ant.project.name}-jws"/>
        <java classname="jason.infra.centralised.CreateJNLP"
              failonerror="true" fork="yes" dir="${basedir}/${ant.project.name}-jws" >
            <classpath refid="project.classpath"/>
            <arg line="${ant.project.name} ${mas2j.project.file}"/>
        </java>
        <copy todir="${basedir}/${ant.project.name}-jws" failonerror="no">
            <fileset dir="${basedir}/lib" includes="**/*.jar" />
            <fileset dir="${basedir}" includes="${ant.project.name}.jar" />
            <fileset dir="<JASON-HOME>/src/images" includes="Jason-GMoreau-Icon.jpg" />
        </copy>
        <signjar jar="${basedir}/${ant.project.name}-jws/${ant.project.name}.jar" alias="jason"
            storepass="rbjhja" keypass="rbjhja" keystore="<JASON-HOME>/src/jasonKeystore" />
        <echo message="**" />
        <echo message="** Java Web Start application created in directory ${ant.project.name}-jws" />
        <echo message="** Update the codebase (in the second line of the .jnlp file)" />
        <echo message="** with the URL where you will upload the application." />
        <echo message="**" />
    </target>


    <target name="run" depends="compile" >
        <echo message="Running project ${ant.project.name}" />
        <java classname="<PROJECT-RUNNER-CLASS>"
              failonerror="true" fork="yes" dir="${basedir}" >
            <classpath refid="project.classpath"/>
            <arg line="${mas2j.project.file} ${debug} <RUN-ARGS>"/>
            <!-- jvmarg line="-Xmx500M -Xss8M"/ -->
        </java>
        <antcall target="user-end" />
    </target>

    <target name="clean" >
        <delete failonerror="no" includeEmptyDirs="true" verbose="true">
            <fileset dir="${basedir}" includes="**/*.class"/>
        </delete>
    </target>

<OTHER-TASK>

</project>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy