Haxe Native UI Development
The goal of Basis is to provide access to native UI components. For example, in ios one would use UIView and in android one would use android.View along with layout xml.
Basis is the core haxelib which works with other haxlibs.
Current haxelibs in development:
- BasisApple (ios, and eventually osx)
- BasisAndroid
run command (make sure Basis has a capital "B"):
haxelib install Basis
Install haxelibs for platforms you wish to build
haxelib install BasisApple
haxelib install BasisAndroid
- You will also need tools specific to the platform you are building (android sdk, xcode...). See specific platform for more instruction.
There are examples for each target. See the other Basis haxelib targets bellow for examples.
- Download each haxelib source (Basis, BasisApple, BasisAndroid)
- Run command "ant testlib" from the root of the Basis directory
- Run command "ant testlib" from both BasisApple and BasisAndroid
If your working on the core Basis code you will need to build Basis then the other haxelibs before using them.
Example
<target name="main">
<appName value="Example" />
<source path="src" />
<builddir path="build" />
<target name="apple" type="Apple">
<framework name="UIKit" />
<framework name="Foundation" />
<framework name="CoreGraphics" />
<framework name="QuartzCore" />
<target name="ipad">
<device type="ios" />
<simulator use="true" type="ipad"/>
<main classpath="example.ApplicationMain" />
<debug value="true" />
<runWhenFinished value="true" />
</target>
</target>
</target>
The build files work similar to CSS in that all tags apply to child targets. In the example above the appName node would apply to the apple target and ipad target. When a target is built each sub target (if any) will also be built.
See platform specific haxelib for nodes specific to that haxelib
Attributes are optional unless marked otherwise.
- target
- Attributes
- name (required)
- The name of the target. This is what you will call from the command line. For example if you want to build the apple target: haxelib run basis build.xml apple
- type
- The haxelib that will build the target "apple" for BasisApple and "android" for BasisAndroid
- name (required)
- Attributes
- appName
- Attributes
- value
- The name of the application
- value
- Attributes
- source
- Attributes
- path
- A directory with haxe source to be included
- path
- Attributes
- builddir
- Attributes
- path
- where the build output will go
- path
- Attributes
- haxelib
- Attributes
- name
- the name of a haxelib to include
- name
- Attributes
- main
- Attributes
- classpath
- the fill class path to the main class
- classpath
- Attributes
- debug
- Attributes
- value
- if "true" build debug build
- value
- Attributes
- haxeArg
- Attributes
- value
- haxe compiler arg. Example
<haxeArg value="-D spod_macro" />
- haxe compiler arg. Example
- value
- Attributes
- runWhenFinished
- Attributes
- value
- if true the app will be run after it is built
- value
- Attributes
- asset
- Attributes
- path
- path to an asset directory
- path
- Attributes
License:
Copyright (c) 2013 Basis Contributors
Unless indicated otherwise, this code is provided under a MIT-style license.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.