Add sample src build

merge-requests/1/head
charithag 9 years ago
parent 9ee4a09057
commit e642a2634e

@ -410,14 +410,13 @@
<tasks> <tasks>
<mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/webapps"/> <mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/webapps"/>
<!--Make samples directory for distribution-->
<mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/samples"/> <mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/samples"/>
<mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/repository/resources/sketches"/> <mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/repository/resources/sketches"/>
<mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/repository/resources/scripts"/> <mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/repository/resources/scripts"/>
<!--Default sample-->
<mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/statistics"/> <mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/statistics"/>
<mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/repository/components/patches"/> <mkdir dir="target/wso2carbon-core-${carbon.kernel.version}/repository/components/patches"/>
@ -429,9 +428,14 @@
<fileset dir="src/repository/jaggeryapps"/> <fileset dir="src/repository/jaggeryapps"/>
</copy> </copy>
<!--Copy samples to distribution-->
<copy todir="target/wso2carbon-core-${carbon.kernel.version}/samples" <copy todir="target/wso2carbon-core-${carbon.kernel.version}/samples"
overwrite="true"> overwrite="true">
<fileset dir="src/samples"/> <fileset dir="src/samples">
<exclude name="**/*.iml"/>
<exclude name="**/.DS_Store"/>
<exclude name="**/target/"/>
</fileset>
</copy> </copy>
<copy todir="target/wso2carbon-core-${carbon.kernel.version}/repository/resources/sketches" <copy todir="target/wso2carbon-core-${carbon.kernel.version}/repository/resources/sketches"
@ -475,7 +479,7 @@
</goals> </goals>
</execution> </execution>
<!--Default sample--> <!--Install default samples-->
<execution> <execution>
<id>install_samples</id> <id>install_samples</id>
<phase>package</phase> <phase>package</phase>
@ -500,6 +504,7 @@
</copy> </copy>
<move file="target/wso2carbon-core-${carbon.kernel.version}/samples/arduino/build.xml" toFile="target/wso2carbon-core-${carbon.kernel.version}/samples/arduino/build.xml.disable"/> <move file="target/wso2carbon-core-${carbon.kernel.version}/samples/arduino/build.xml" toFile="target/wso2carbon-core-${carbon.kernel.version}/samples/arduino/build.xml.disable"/>
<move file="target/wso2carbon-core-${carbon.kernel.version}/samples/raspberrypi/build.xml" toFile="target/wso2carbon-core-${carbon.kernel.version}/samples/raspberrypi/build.xml.disable"/> <move file="target/wso2carbon-core-${carbon.kernel.version}/samples/raspberrypi/build.xml" toFile="target/wso2carbon-core-${carbon.kernel.version}/samples/raspberrypi/build.xml.disable"/>
<move file="target/wso2carbon-core-${carbon.kernel.version}/samples/sample_pom.xml" toFile="target/wso2carbon-core-${carbon.kernel.version}/samples/pom.xml" overwrite="true"/>
</tasks> </tasks>
</configuration> </configuration>
<goals> <goals>

@ -4,6 +4,7 @@
<property name="sample_type" value="arduino"/> <property name="sample_type" value="arduino"/>
<property name="data_source" value="ArduinoDM_DB"/> <property name="data_source" value="ArduinoDM_DB"/>
<property name="package" value="org.wso2.carbon.device.mgt.iot.sample.arduino"/>
<target name="create-db" depends="clean"> <target name="create-db" depends="clean">
<mkdir dir="${db.dir}"/> <mkdir dir="${db.dir}"/>
@ -26,13 +27,19 @@
]]> ]]>
</insert> </insert>
</xmltask> </xmltask>
</target>
<target name="build">
<exec dir="src" executable="sh">
<arg line="-c 'mvn clean install'" />
</exec>
</target> </target>
<target name="deploy" depends="create-db"> <target name="deploy" depends="create-db,build">
<copy toDir="${target.sketch.dir}/${sample_type}"> <copy toDir="${target.sketch.dir}/${sample_type}">
<fileset dir="sketch"/> <fileset dir="sketch"/>
</copy> </copy>
<copy file="src/${package}.service.impl/target/${package}/service/impl-${target.version}.jar" toDir="${target.dropins.dir}" overwrite="yes"/>
<copy toDir="${target.unit.dir}/${sample_type}"> <copy toDir="${target.unit.dir}/${sample_type}">
<fileset dir="units"/> <fileset dir="units"/>
</copy> </copy>

@ -2,8 +2,10 @@
<property name="lib.dir" value="../../repository/components/plugins"/> <property name="lib.dir" value="../../repository/components/plugins"/>
<property name="iot.conf" value="../../repository/conf/iot/iot-config.xml"/> <property name="iot.conf" value="../../repository/conf/iot/iot-config.xml"/>
<property name="target.db.dir" value="../../repository/database"/> <property name="target.db.dir" value="../../repository/database"/>
<property name="target.dropins.dir" value="../../repository/components/dropins"/>
<property name="target.sketch.dir" value="../../repository/resources/sketches"/> <property name="target.sketch.dir" value="../../repository/resources/sketches"/>
<property name="target.unit.dir" value="../../repository/deployment/server/jaggeryapps/iotserver/units"/> <property name="target.unit.dir" value="../../repository/deployment/server/jaggeryapps/iotserver/units"/>
<property name="target.version" value="1.0.0-SNAPSHOT"/>
<property name="db.username" value="wso2carbon"/> <property name="db.username" value="wso2carbon"/>
<property name="db.password" value="wso2carbon"/> <property name="db.password" value="wso2carbon"/>
<property name="db.dir" value="database"/> <property name="db.dir" value="database"/>

Loading…
Cancel
Save