You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
2.5 KiB
60 lines
2.5 KiB
9 years ago
|
<project name="DigitalDisplay" basedir="" default="deploy">
|
||
9 years ago
|
|
||
|
<import file="../common.xml"/>
|
||
|
|
||
|
<property name="sample_type" value="digital_display"/>
|
||
9 years ago
|
<property name="data_source" value="DigitalDisplayDM_DB"/>
|
||
9 years ago
|
<property name="package" value="org.wso2.carbon.device.mgt.iot.sample.digitaldisplay"/>
|
||
9 years ago
|
|
||
9 years ago
|
<target name="create-db" depends="clean">
|
||
|
<mkdir dir="${db.dir}"/>
|
||
|
<property name="dbURL" value="jdbc:h2:file:${basedir}/${db.dir}/${data_source};DB_CLOSE_ON_EXIT=FALSE"/>
|
||
|
|
||
|
<sql driver="org.h2.Driver" url="${dbURL}" userid="${db.username}" password="${db.password}" autocommit="true" onerror="continue">
|
||
|
<classpath>
|
||
|
<pathelement location="${lib.dir}/h2-database-engine_1.2.140.wso2v3.jar"/>
|
||
|
</classpath>
|
||
|
<fileset file="dbscripts/${db.type}_${sample_type}.sql"/>
|
||
|
</sql>
|
||
9 years ago
|
<copy file="${db.dir}/${data_source}.h2.db" toDir="${target.db.dir}" overwrite="yes"/>
|
||
|
|
||
|
<xmltask source="${iot.conf}" dest="${iot.conf}" report="true">
|
||
|
<insert path="/IoTDeviceTypeConfigManager[1]">
|
||
|
<![CDATA[
|
||
|
<IotDeviceTypeConfig type="${sample_type}">
|
||
|
<DatasourceName>jdbc/${data_source}</DatasourceName>
|
||
|
</IotDeviceTypeConfig>
|
||
|
]]>
|
||
|
</insert>
|
||
|
</xmltask>
|
||
9 years ago
|
</target>
|
||
9 years ago
|
|
||
9 years ago
|
<target name="build">
|
||
|
<exec dir="src" executable="sh">
|
||
|
<arg line="-c 'mvn clean install'" />
|
||
|
</exec>
|
||
9 years ago
|
</target>
|
||
|
|
||
9 years ago
|
<target name="deploy" depends="create-db,build">
|
||
9 years ago
|
<copy toDir="${target.sketch.dir}/${sample_type}">
|
||
9 years ago
|
<fileset dir="sketch"/>
|
||
|
</copy>
|
||
9 years ago
|
<copy file="src/${package}.service.impl/target/${sample_type}.war" toDir="${target.webapp.dir}" overwrite="yes"/>
|
||
|
<copy file="src/${package}.plugin.impl/target/${package}.plugin.impl-${target.version}.jar" toDir="${target.dropins.dir}" overwrite="yes"/>
|
||
9 years ago
|
<copy file="page/${sample_type}.hbs" toDir="${target.page.dir}" overwrite="yes"/>
|
||
9 years ago
|
<copy toDir="${target.unit.dir}/${sample_type}">
|
||
9 years ago
|
<fileset dir="units"/>
|
||
|
</copy>
|
||
|
</target>
|
||
|
|
||
|
<target name="clean">
|
||
9 years ago
|
<delete file="${target.db.dir}/${data_source}.h2.db"/>
|
||
|
<delete dir="${target.sketch.dir}/${sample_type}"/>
|
||
9 years ago
|
<delete file="${target.page.dir}/${sample_type}.hbs"/>
|
||
9 years ago
|
<delete dir="${target.unit.dir}/${sample_type}"/>
|
||
9 years ago
|
<xmltask source="${iot.conf}" dest="${iot.conf}" report="true">
|
||
|
<remove path="/IoTDeviceTypeConfigManager/IotDeviceTypeConfig[type='${sample_type}']"/>
|
||
|
</xmltask>
|
||
9 years ago
|
</target>
|
||
|
|
||
|
</project>
|