1 <?xml version="1.0" standalone="yes"?>
2 <project name="emulator-skin" basedir="." default="make-jar">
4 <condition property="isWindows">
5 <os family="windows" />
7 <condition property="isLinux">
10 <condition property="isMac">
14 <property environment="env" />
15 <property name="jar.file" value="emulator-skin.jar" />
16 <property name="mainclass" value="org.tizen.emulator.skin.EmulatorSkinMain" />
18 <property name="swt.file" value="swt.jar" />
21 <fileset dir="lib" includes="${swt.file}" />
25 <echo message="cleaning..." />
26 <delete dir="build" />
27 <delete file="${jar.file}" />
30 <target name="make-properties">
31 <echo message="make properties..." />
33 <format property="build_time" pattern="yyyyMMdd-HHmm" timezone="GMT+9" locale="en" />
35 <exec executable="cat" outputproperty="version">
36 <arg value="../../VERSION" />
38 <exec executable="git" outputproperty="build_git_commit" failifexecutionfails="false">
39 <arg value="rev-parse" />
40 <arg value="--short" />
43 <propertyfile file="src/about.properties" comment="Auto-generated properties - DO NOT EDIT">
44 <entry key="version" value="${version}" />
45 <entry key="build_time" value="${build_time}" />
46 <entry key="build_git_commit" value="${build_git_commit}" />
50 <target name="prepare-compile" depends="make-properties">
51 <echo message="prepare for compile..." />
52 <delete dir="build" />
56 <target name="compile" depends="prepare-compile">
57 <echo message="compiling..." />
58 <javac encoding="UTF-8" fork="true" srcdir="src:jaxb_src" destdir="build" debug="on" memorymaximumsize="128m">
59 <classpath refid="classpath" />
63 <target name="create-jar">
64 <echo message="creating jar..." />
65 <mkdir dir="build/icons" />
66 <copy todir="build/icons">
67 <fileset dir="resource/icons" />
69 <copy todir="build/images">
70 <fileset dir="resource/images" />
72 <jar jarfile="${jar.file}" basedir="build" duplicate="add">
73 <fileset file="src/about.properties" />
75 <attribute name="Main-Class" value="${mainclass}" />
76 <attribute name="Class-path" value="${swt.file}" />
79 <delete dir="build" />
82 <target name="create-native-linux" if="isLinux" unless="isMac">
83 <echo message="create native shared library on linux..." />
84 <javah classpath="build;lib/swt.jar" destdir="native_src">
85 <class name="org.tizen.emulator.skin.EmulatorShmSkin" />
87 <exec dir="native_src" executable="gcc" failifexecutionfails="false">
90 <arg line="share.c" />
92 <arg line="shared.o" />
93 <arg line="-I${env.JAVA_JNI_H_INCLUDE_PATH}" />
94 <arg line="-I${env.JAVA_JNI_H_INCLUDE_PATH}/linux" />
96 <exec dir="native_src" executable="gcc" failifexecutionfails="false">
97 <arg line="shared.o" />
98 <arg line="-shared" />
100 <arg line="libshared.so" />
103 <fileset dir="native_src" includes="**/*.h" />
107 <target name="create-native-mac" if="isMac">
108 <echo message="create native shared library on mac..." />
109 <javah classpath="build;lib/swt.jar" destdir="native_src">
110 <class name="org.tizen.emulator.skin.EmulatorShmSkin" />
112 <exec dir="native_src" executable="gcc" failifexecutionfails="false">
113 <arg line="-mmacosx-version-min=10.4" />
115 <arg line="share.c" />
117 <arg line="share.o" />
118 <arg line="-I${env.JAVA_JNI_H_INCLUDE_PATH}" />
120 <exec dir="native_src" executable="gcc" failifexecutionfails="false">
121 <arg line="-dynamiclib" />
122 <arg line="share.o" />
124 <arg line="libshared.dylib" />
127 <fileset dir="native_src" includes="**/*.h" />
131 <target name="make-jar" depends="compile, create-native-linux, create-native-mac, create-jar" />
133 <!-- for dibs system... -->
134 <path id="classpath-dibs">
135 <fileset dir="${classpath.dibs}" includes="${swt.file}" />
138 <target name="compile-dibs" depends="prepare-compile">
139 <echo message="compiling..." />
140 <javac encoding="UTF-8" fork="true" srcdir="src:jaxb_src" destdir="build" debug="on" memorymaximumsize="128m">
141 <classpath refid="classpath-dibs" />
145 <target name="make-jar-dibs" depends="compile-dibs, create-native-linux, create-native-mac, create-jar" />