Skip to content

Commit

Permalink
compiles with 1280x960 Openni - ant build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Wouter Verweirder committed Jan 26, 2013
1 parent 31766c7 commit 66d12d4
Show file tree
Hide file tree
Showing 7 changed files with 210 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ bin/airkinect-2-core.swc

.settings/org.eclipse.core.resources.prefs

build/*

extension/*

cert/*
Expand Down
Binary file modified bin/airkinect-2-core-mssdk.ane
Binary file not shown.
Binary file modified bin/airkinect-2-core-openni.ane
Binary file not shown.
18 changes: 18 additions & 0 deletions build/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#FLEX_HOME = C:\\Program Files (x86)\\Adobe\\Adobe Flash Builder 4.6\\sdks\\4.6.0
FLEX_HOME = /Applications/Adobe Flash Builder 4.6/sdks/4.6.0

Extension.EXTENSION_NAME = airkinect-2-core
Extension.EXTENSION_CLASS = com.as3nui.nativeExtensions.air.kinect.Kinect

Extension.NATIVE_LIBRARY_BIN_FOLDER = /Users/wouter/Documents/experiments/as3nui/airkinect-2-native/bin
Extension.NATIVE_LIBRARY_OSX_OPENNI = KinectExtension.framework
Extension.NATIVE_LIBRARY_WINDOWS_OPENNI = KinectExtensionRelease-OpenNI.dll
Extension.NATIVE_LIBRARY_WINDOWS_MSSDK = KinectExtensionRelease-MSSDK.dll

Extension.AIR_CERTIFICATE_FILE = debugCert.p12
Extension.AIR_CERTIFICATE_NAME = debugCert
Extension.AIR_CERTIFICATE_PASSWORD = debugPW
Extension.AIR_ORG_NAME = as3nui
Extension.AIR_ORG_UNIT = as3nui
Extension.AIR_COUNTRY = US
Extension.AIR_KEY_TYPE = 2048-RSA
162 changes: 162 additions & 0 deletions build/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="extension-ant-build">
<property file="build.properties"/>
<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
<property name="Flex.ADT" value="${FLEX_HOME}/lib/adt.jar"/>

<!-- Folder Properties -->
<dirname property="Extension.BUILD_ROOT" file="${ant.file.extension-ant-build}"/>
<property name="Extension.MODULE_ROOT" value="${Extension.BUILD_ROOT}/.."/>

<!-- Project properties -->
<property name="Extension.MODULE_SRC_ROOT" value="${Extension.MODULE_ROOT}/src"/>
<property name="Extension.LIBS_ROOT" value="${Extension.MODULE_ROOT}/libs"/>
<property name="Extension.BIN_ROOT" location="${Extension.MODULE_ROOT}/bin"/>

<!-- Certificate Properties -->
<property name="Extension.AIR_CERTIFICATE_ROOT" location="${Extension.MODULE_ROOT}/cert"/>

<!-- Native Extension -->
<property name="Extension.EXTENSION_TMP_ROOT" value="${Extension.MODULE_ROOT}/tmp"/>

<available file="${Extension.BIN_ROOT}" type="dir" property="Extension.bin_root.present"/>
<available file="${Extension.BIN_ROOT}/${Extension.EXTENSION_NAME}.ane" type="file" property="Extension.bin.present"/>
<available file="${Extension.AIR_CERTIFICATE_ROOT}/${Extension.AIR_CERTIFICATE_FILE}" type="file" property="Extension.cert.present"/>
<available file="${Extension.BIN_ROOT}/${Extension.EXTENSION_NAME}.swc" type="file" property="Extension.swc.present"/>

<target name="Clean">
<delete includeemptydirs="true">
<fileset dir="${Extension.BIN_ROOT}"/>
</delete>
</target>

<target name="Create BIN Folder" unless="Extension.bin_root.present">
<mkdir dir="${Extension.BIN_ROOT}"/>
</target>

<target name="Build Extension SWC" depends="Create BIN Folder" unless="Extension.swc.present">
<compc output="${Extension.BIN_ROOT}/${Extension.EXTENSION_NAME}.swc">
<load-config filename="${FLEX_HOME}/frameworks/air-config.xml" />
<include-sources file="${Extension.MODULE_SRC_ROOT}/"/>
<include-libraries file="${Extension.LIBS_ROOT}/"/>
</compc>
</target>

<target name="Generate Certificate" unless="Extension.cert.present">
<mkdir dir="${Extension.AIR_CERTIFICATE_ROOT}"/>
<java jar="${Flex.ADT}" fork="true">
<arg value="-certificate"/>
<arg value="-cn"/>
<arg value="${Extension.AIR_CERTIFICATE_NAME}"/>
<arg value="-ou"/>
<arg value="${Extension.AIR_ORG_UNIT}"/>
<arg value="-o"/>
<arg value="${Extension.AIR_ORG_NAME}"/>
<arg value="-c"/>
<arg value="${Extension.AIR_COUNTRY}"/>
<arg value="${Extension.AIR_KEY_TYPE}"/>
<arg value="${Extension.AIR_CERTIFICATE_ROOT}/${Extension.AIR_CERTIFICATE_FILE}"/>
<arg value="${Extension.AIR_CERTIFICATE_PASSWORD}"/>
</java>
</target>

<target name="Build Native Extension (OpenNI)" depends="Build Extension SWC, Generate Certificate">
<unzip src="${Extension.BIN_ROOT}/${Extension.EXTENSION_NAME}.swc" dest="${Extension.EXTENSION_TMP_ROOT}"/>

<!-- copy the mac framework to the tmp folder -->
<copy todir="${Extension.EXTENSION_TMP_ROOT}/${Extension.NATIVE_LIBRARY_OSX_OPENNI}">
<fileset dir="${Extension.NATIVE_LIBRARY_BIN_FOLDER}/${Extension.NATIVE_LIBRARY_OSX_OPENNI}" />
</copy>

<!-- copy the windows dll to the tmp folder -->
<copy todir="${Extension.EXTENSION_TMP_ROOT}">
<fileset file="${Extension.NATIVE_LIBRARY_BIN_FOLDER}/${Extension.NATIVE_LIBRARY_WINDOWS_OPENNI}" />
</copy>

<!-- copy the extension.xml to the tmp folder -->
<copy todir="${Extension.EXTENSION_TMP_ROOT}">
<fileset file="${Extension.BUILD_ROOT}/extension.xml" />
</copy>

<!-- replace NATIVE_LIBRARY_WINDOWS & NATIVE_LIBRARY_OSX in the extension.xml -->
<replace file="${Extension.EXTENSION_TMP_ROOT}/extension.xml" token="NATIVE_LIBRARY_WINDOWS" value="${Extension.NATIVE_LIBRARY_WINDOWS_OPENNI}" />
<replace file="${Extension.EXTENSION_TMP_ROOT}/extension.xml" token="NATIVE_LIBRARY_OSX" value="${Extension.NATIVE_LIBRARY_OSX_OPENNI}" />

<java jar="${Flex.ADT}" fork="true" dir="${Extension.EXTENSION_TMP_ROOT}" failonerror="true">
<arg value="-package"/>
<arg value="-storetype"/>
<arg value="pkcs12"/>
<arg value="-keystore"/>
<arg value="${Extension.AIR_CERTIFICATE_ROOT}/${Extension.AIR_CERTIFICATE_FILE}"/>
<arg value="-storepass"/>
<arg value="${Extension.AIR_CERTIFICATE_PASSWORD}"/>
<arg value="-tsa"/>
<arg value="none"/>
<arg value="-target"/>
<arg value="ane"/>
<arg value="${Extension.BIN_ROOT}/${Extension.EXTENSION_NAME}-openni.ane"/>
<arg value="extension.xml"/>
<arg value="-swc"/>
<arg value="${Extension.BIN_ROOT}/${Extension.EXTENSION_NAME}.swc"/>
<arg value="-platform"/>
<arg value="Windows-x86"/>
<arg value="library.swf"/>
<arg line="'${Extension.NATIVE_LIBRARY_WINDOWS_OPENNI}'"/>
<arg value="-platform"/>
<arg value="MacOS-x86"/>
<arg value="library.swf"/>
<arg line="'${Extension.NATIVE_LIBRARY_OSX_OPENNI}'"/>
</java>
<delete dir="${Extension.EXTENSION_TMP_ROOT}"/>
</target>

<target name="Build Native Extension (MSSDK)" depends="Build Extension SWC, Generate Certificate">
<unzip src="${Extension.BIN_ROOT}/${Extension.EXTENSION_NAME}.swc" dest="${Extension.EXTENSION_TMP_ROOT}"/>

<!-- copy the mac framework to the tmp folder -->
<copy todir="${Extension.EXTENSION_TMP_ROOT}/${Extension.NATIVE_LIBRARY_OSX_OPENNI}">
<fileset dir="${Extension.NATIVE_LIBRARY_BIN_FOLDER}/${Extension.NATIVE_LIBRARY_OSX_OPENNI}" />
</copy>

<!-- copy the windows dll to the tmp folder -->
<copy todir="${Extension.EXTENSION_TMP_ROOT}">
<fileset file="${Extension.NATIVE_LIBRARY_BIN_FOLDER}/${Extension.NATIVE_LIBRARY_WINDOWS_MSSDK}" />
</copy>

<!-- copy the extension.xml to the tmp folder -->
<copy todir="${Extension.EXTENSION_TMP_ROOT}">
<fileset file="${Extension.BUILD_ROOT}/extension.xml" />
</copy>

<!-- replace NATIVE_LIBRARY_WINDOWS & NATIVE_LIBRARY_OSX in the extension.xml -->
<replace file="${Extension.EXTENSION_TMP_ROOT}/extension.xml" token="NATIVE_LIBRARY_WINDOWS" value="${Extension.NATIVE_LIBRARY_WINDOWS_MSSDK}" />
<replace file="${Extension.EXTENSION_TMP_ROOT}/extension.xml" token="NATIVE_LIBRARY_OSX" value="${Extension.NATIVE_LIBRARY_OSX_OPENNI}" />

<java jar="${Flex.ADT}" fork="true" dir="${Extension.EXTENSION_TMP_ROOT}" failonerror="true">
<arg value="-package"/>
<arg value="-storetype"/>
<arg value="pkcs12"/>
<arg value="-keystore"/>
<arg value="${Extension.AIR_CERTIFICATE_ROOT}/${Extension.AIR_CERTIFICATE_FILE}"/>
<arg value="-storepass"/>
<arg value="${Extension.AIR_CERTIFICATE_PASSWORD}"/>
<arg value="-tsa"/>
<arg value="none"/>
<arg value="-target"/>
<arg value="ane"/>
<arg value="${Extension.BIN_ROOT}/${Extension.EXTENSION_NAME}-mssdk.ane"/>
<arg value="extension.xml"/>
<arg value="-swc"/>
<arg value="${Extension.BIN_ROOT}/${Extension.EXTENSION_NAME}.swc"/>
<arg value="-platform"/>
<arg value="Windows-x86"/>
<arg value="library.swf"/>
<arg line="'${Extension.NATIVE_LIBRARY_WINDOWS_MSSDK}'"/>
<arg value="-platform"/>
<arg value="MacOS-x86"/>
<arg value="library.swf"/>
<arg line="'${Extension.NATIVE_LIBRARY_OSX_OPENNI}'"/>
</java>
<delete dir="${Extension.EXTENSION_TMP_ROOT}"/>
</target>
</project>
20 changes: 20 additions & 0 deletions build/extension.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<extension xmlns="http://ns.adobe.com/air/extension/3.1">
<id>com.as3nui.nativeExtensions.air.kinect</id>
<versionNumber>2.2.0</versionNumber>
<platforms>
<platform name="Windows-x86">
<applicationDeployment>
<nativeLibrary>NATIVE_LIBRARY_WINDOWS</nativeLibrary>
<initializer>AIRKinectInitializer</initializer>
<finalizer>AIRKinectFinalizer</finalizer>
</applicationDeployment>
</platform>
<platform name="MacOS-x86">
<applicationDeployment>
<nativeLibrary>NATIVE_LIBRARY_OSX</nativeLibrary>
<initializer>AIRKinectInitializer</initializer>
<finalizer>AIRKinectFinalizer</finalizer>
</applicationDeployment>
</platform>
</platforms>
</extension>
10 changes: 10 additions & 0 deletions src/com/as3nui/nativeExtensions/air/kinect/Kinect.as
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ package com.as3nui.nativeExtensions.air.kinect {
*/
[Event(name="stopped", type="com.as3nui.nativeExtensions.air.kinect.events.DeviceEvent")]

/**
* Dispatched when an error occurs on the device. This happens during the startup of the device.
*/
[Event(name="error", type="com.as3nui.nativeExtensions.air.kinect.events.DeviceErrorEvent")]

/**
* Dispatched when the device sends us extra info. This happens during the startup of the device.
*/
[Event(name="info", type="com.as3nui.nativeExtensions.air.kinect.events.DeviceInfoEvent")]

/**
* Dispatched when the depth bitmapdata is updated.
*/
Expand Down

0 comments on commit 66d12d4

Please sign in to comment.