[Title] emulator-manager : build.xml is separated (mac vs win, ubuntu)
authorjihye kim <jihye1128.kim@samsung.com>
Mon, 26 Nov 2012 05:18:07 +0000 (14:18 +0900)
committerjihye kim <jihye1128.kim@samsung.com>
Mon, 26 Nov 2012 05:18:07 +0000 (14:18 +0900)
[Desc.] build.xml is separated (mac vs win, ubuntu) because of jar bundler
[Issue] N/A

build-mac.xml [moved from build.xml with 100% similarity]
build-other.xml [new file with mode: 0644]
package/build.linux
package/build.macos-64
package/build.windows

similarity index 100%
rename from build.xml
rename to build-mac.xml
diff --git a/build-other.xml b/build-other.xml
new file mode 100644 (file)
index 0000000..64f61ec
--- /dev/null
@@ -0,0 +1,83 @@
+<?xml version="1.0" standalone="yes"?>
+<project name="emulator-manager" basedir="." default="make-jar">
+
+       <property name="jar.file" value="emulator-manager.jar" />
+       <property name="mainclass" value="org.tizen.emulator.manager.EmulatorManager" />
+
+       <property name="swt.file" value="swt.jar" />
+
+       <path id="classpath">
+               <fileset dir="lib" includes="${swt.file}" />
+       </path>
+
+       <target name="clean">
+               <echo message="cleaning..." />
+               <delete dir="build" />
+               <delete file="${jar.file}" />
+       </target>
+    
+       <target name="make-properties">
+               <echo message="make properties..." />
+               <tstamp>
+                       <format property="build_time" pattern="yyyyMMdd-HHmm" timezone="GMT+9" locale="en" />
+               </tstamp>
+        <exec executable="cat" outputproperty="version">
+            <arg value="VERSION" />
+        </exec>
+               <exec executable="git" outputproperty="build_git_commit" failifexecutionfails="false">
+                       <arg value="rev-parse" />
+                       <arg value="--short" />
+                       <arg value="HEAD" />
+               </exec>
+               <propertyfile file="about.properties" comment="Auto-generated properties - DO NOT EDIT">
+                       <entry key="version" value="${version}" />
+                       <entry key="build_time" value="${build_time}" />
+                       <entry key="build_git_commit" value="${build_git_commit}" />
+               </propertyfile>
+       </target>
+
+       <target name="prepare-compile" depends="make-properties">
+               <echo message="prepare for compile..." />
+               <delete dir="build" />
+               <mkdir dir="build" />
+       </target>
+
+       <target name="compile" depends="prepare-compile">
+               <echo message="compiling..." />
+               <javac encoding="UTF-8" fork="true" srcdir="src:jaxb_src" destdir="build" debug="on" memorymaximumsize="128m">
+                       <classpath refid="classpath" />
+               </javac>
+       </target>
+
+       <target name="create-jar">
+               <echo message="creating jar..." />
+               <mkdir dir="build/res" />
+               <copy todir="build/res">
+                       <fileset dir="resource/res" />
+               </copy>
+               <jar jarfile="${jar.file}" basedir="build" duplicate="add">
+                       <fileset file="about.properties" />
+                       <manifest>
+                               <attribute name="Main-Class" value="${mainclass}" />
+                               <attribute name="Class-path" value="${swt.file}" />
+                       </manifest>
+               </jar>
+               <delete dir="build" />
+       </target>
+
+       <target name="make-jar" depends="compile, create-jar" />
+
+       <!-- for dibs system... -->
+       <path id="classpath-dibs">
+               <fileset dir="${classpath.dibs}" includes="${swt.file}" />
+       </path>
+
+       <target name="compile-dibs" depends="prepare-compile">
+               <echo message="compiling..." />
+               <javac encoding="UTF-8" fork="true" srcdir="src:jaxb_src" destdir="build" debug="on" memorymaximumsize="128m">
+                       <classpath refid="classpath-dibs" />
+               </javac>
+       </target>
+
+       <target name="make-jar-dibs" depends="compile-dibs, create-jar" />
+</project>
index 28fd4d8..35cf37f 100755 (executable)
@@ -12,7 +12,9 @@ clean()
 build() 
 {
        cd $SRCDIR
+       cp build-other.xml build.xml
        ant -buildfile build.xml -Dclasspath.dibs=${ROOTDIR}/tools/emulator/bin make-jar-dibs
+       rm build.xml
 }
 
 # install
@@ -23,7 +25,7 @@ install()
        mkdir -p $BIN_DIR/icons
        mkdir -p $BIN_DIR/templates
 
-       cp $SRCDIR/emulator-manager.jar $BIN_DIR/bin
+       mv $SRCDIR/emulator-manager.jar $BIN_DIR/bin
        cp $SRCDIR/supplement/emulator-manager.sh $BIN_DIR/bin/emulator-manager
        cp $SRCDIR/resource/res/em.ico $BIN_DIR/icons
        cp $SRCDIR/standard.xml $BIN_DIR/templates
index 9d2a95a..fc76673 100644 (file)
@@ -12,7 +12,9 @@ clean()
 build() 
 {
        cd $SRCDIR
+       cp build-mac.xml build.xml
        ant -buildfile build.xml -Dclasspath.dibs=${ROOTDIR}/tools/emulator/bin make-jar-mac
+       rm build.xml
 
        # for emulator-manager.app
        cp ${ROOTDIR}/tools/emulator/bin/swt.jar ./
index d529aa0..021d976 100755 (executable)
@@ -29,7 +29,10 @@ build()
        prepare
 
        cd $SRCDIR
+       cp build-other.xml build.xml
        ant -buildfile build.xml -Dclasspath.dibs=${PURIFIED_ROOTDIR}/tools/emulator/bin make-jar-dibs
+       rm build.xml
+
        gcc $SRCDIR/supplement/emulator-manager.c -o $SRCDIR/emulator-manager.exe -mwindows
 }
 
@@ -41,7 +44,7 @@ install()
        mkdir -p $BIN_DIR/icons
        mkdir -p $BIN_DIR/templates
 
-       cp $SRCDIR/emulator-manager.jar $BIN_DIR/bin
+       mv $SRCDIR/emulator-manager.jar $BIN_DIR/bin
        cp $SRCDIR/emulator-manager.exe $BIN_DIR/bin
        cp $SRCDIR/resource/res/em.ico $BIN_DIR/icons
        cp $SRCDIR/standard.xml $BIN_DIR/templates