public
Last active

NMML File Specification

  • Download Gist
gistfile1.xml
XML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501
<?xml version="1.0" encoding="utf-8"?>
<project>
<!-- <meta />
Use meta nodes to set metadata for your application. The description is ignored
on most targets, but is useful for packaging like Chrome Apps or Opera Widgets.
For compatibility with Android and webOS, the package name must include at least
three "sections", and the version should have exactly three "sections"
-->
<meta title="Example Application" description="A really cool application!" package="com.example.myapp" version="1.0.0" company="My Company" />
<!-- <app />
Use app nodes to set the "main" class for your project, and optionally configure
the output file name, path and (if targeting Flash) SWF version.
Use the preloader attribute to specify a custom class name to use as the preloader for your
application. This applies to Flash and HTML5, which require a preloader by default.
-->
<app main="com.example.myapp.MyApp" file="MyProject" path="Export" preloader="CustomPreloaderClass" swf-version="11" />
<!-- <window />
Use window nodes to specify how an application should be run.
Not all of the available options apply to each target. Most of these properties are also
optional.
If you specify a width and height of 0, it will use the full screen size on most platforms.
-->
<window width="0" height="0" background="0xFFFFFF" fps="30" />
<window width="800" height="600" orientation="portrait" fps="60" background="0xFFFFFF" resizable="false" borderless="false" vsync="false" fullscreen="false" antialiasing="4" />
<!-- <source />
Use source nodes to add classpaths for Haxe code
-->
<source path="path/to/my/code" />
<!-- <haxelib />
Use haxelib nodes to include classes or NME extensions from haxelib
The root path of a haxelib is always used as a Haxe classpath. If the
library also includes an "include.nmml" file, it will be read and
processed. This is how NME extensions can their required NMML binaries,
haxelibs, defines or other additional options.
Similar to include nodes, the base path is updated to begin with the
location of the file. If the "include.nmml" file specified a path as
"assets", it would become "path/to/haxelib/assets" when processed.
-->
<haxelib name="actuate" />
<!-- <ndll />
You can include native binaries for HXCPP/NME using ndll nodes.
Specify the name of the library you would like to include, as well as
the haxelib project where it can be found. The command-line tools will
search for an /ndll directory, with binaries for the current target.
For example, a library called "example" may be placed in a directory
structure like this:
./ndll/Android/libexample.so
./ndll/iPhone/libexample.iphoneos.a
./ndll/iPhone/libexample.iphonesim.a
./ndll/Linux/example.ndll
./ndll/Linux64/example.ndll
./ndll/Mac/example.ndll
./ndll/webOS/example.so
./ndll/Windows/example.ndll
If you are specifying a binary through an include file, you do not
need to specify a "haxelib" attribute, as the directory of the include
file will be searched for the NDLL you wish to use.
Otherwise, libraries will be search for in the HXCPP haxelib by
default.
-->
<ndll name="nme" />
<ndll name="sqlite" />
<ndll name="example" haxelib="example" />
<!-- <include />
Use the include node to process additional NMML files.
TYou can target a path which includes an "include.nmml" file, or you
can specify the exact path to an XML/NMML file.
If you are testing an NME extension locally, or do not wish to submit
your extension to haxelib, you can use an include node.
-->
<include path="shared.nmml" />
<include path="path/to/my/extension" />
<!-- <icon />
Use icon nodes to add icons to your project.
If you specify a bitmap icon, you can include multiple icon nodes, each
with a different icon size. Otherwise you can specify an SVG file, and
the command-line tools will attempt to process the SVG and generate
icons for each requested size for the current target.
-->
<icon path="icon.svg" />
<icon path="icon.png" size="32" />
<icon path="icon.png" width="64" height="64" />
<!-- <assets />
Use asset nodes to add resources to your project.
The path attribute can point to either a file or a directory. These files will
be copied (or embedded) in your final project, and can be accessed using the
nme.Assets class.
For example, if you include the following node in your NMML file:
<assets path="images/MyImage.jpg" />
You can access it in your application like this:
var bitmapData = Assets.getBitmapData ("images/MyImage.png");
The target path will mirror the source path by default, but you also can include
a rename attribute, if you wish to use a different target path. The nme.Assets
class will use the *target* path by default, so using the rename attribute will
alter the names you use to reference your files.
If you would prefer to set the ID for your asset file yourself, use a name
attribute. This only applies to asset nodes which point to a file, not a
directory path.
When pointing to a directory, you can use the include or exclude attributes to
specify patterns for including files automatically. Wildcards are supported.
To include all the files under the directory, for example, use an include
value of "*". You can separate multiple patterns using "|" characters.
You can nest assets nodes inside of each other. If you specify a directory in the
top assets node, its path will be appended to the paths you specify in subsequent
nodes.
The type for each file will be determined automatically, based on each file
extension, but you can use the type attribute to set it for the file or directory
yourself. If you are nesting a node inside of another assets node, you can also
use the name of the type as the name of your node.
These are the current types:
binary
font
image
music
sound
template
text
Some targets can only support playing one music file at a time. You should use
"music" for files which are designed to play as background music, and "sound" for
all other audio. "binary" and "text" are generic types which are available as a ByteArray or
String in your application. Most targets can use them interchangeably.
If an asset is specified as "template", it will not be copied/embedded as an ordinary
asset, but instead will be copied to the root directory of your project, so you can
replace any of the template HX, HXML or platform-specific files for the target.
-->
<assets path="assets" include="*" />
<assets path="../../assets" rename="assets" include="*" />
<assets path="assets/images" rename="images" include="*.jpg|*.png" exclude="example.jpg" />
<assets path="assets">
<assets path="images" include="*" type="image" />
<sound path="sound/mySound.wav" name="MySound" />
<music path="sound/BackgroundMusic.mp3" />
</assets>
<!-- <template />
Use template nodes to include "template" type assets.
Using a template node is shorthand for creating an assets node with the type specified
as "template"
These files are copied into the destination directory before compiling your project, so
you can overwrite any of the classes, compile scripts or platform-specific template files
for your project.
Template files are also processed, so you can use the haXe templating system to replace
values. For example, if you set a variable called MY_VALUE, you could place this in your
files by writing ::MY_VALUE:: in the file's text.
-->
<template path="appinfo.json" if="webos" />
<template path="Assets/android/libs" rename="libs" if="android" />
<!-- <library />
Use library nodes to embed SWF assets in your application.
Unlike including a SWF file using an assets node, embedding it as a library will cause
the command-line tools to generate classes for each of the symbols found in the SWF
file. You can use these classes to instantiate the symbols directly.
The "path" attribute should point to the file. The file will be saved in a
"libraries" folder by default, with the name of the original SWF.
For example, if you have a symbol in your SWF file, with "linkage" set to
"com.example.MySquare", you could create copies of this symbol using this code:
import com.example.MySquare;
...
var square = new MySquare ();
You must have "swf" installed through haxelib in order to use this feature.
The library node may also be used in the future if there are other sensible
container formats
-->
<library path="Source/library.swf" />
<!-- <set />
Use set nodes to specify values for use, locally, in the NME command-line tools.
These values are present while processing NMML files, and determining how to build
for a specific platform.
These values will generally *not* apply to the Haxe compiler or C++ compilers, directly.
-->
<set name="fullscreen" />
<set name="DOCS_DIR" value="docs" />
<!-- <unset />
Use unset nodes to remove a value that was previously defined locally.
-->
<unset name="fullscreen" />
<!-- "if"
You can add "if" attributes to practically any node in an NMML file.
Use this in combination with local defines to control the output of your application.
The command-line tools will create defines for the current target, automatically. Use
this if you need to handle platforms differently.
-->
<window width="800" height="600" if="flash" />
<!--- "unless"
Similar to the "if" attribute, you can add "unless" attributes to ignore nodes
unless the specified value has been defined locally.
-->
<window width="800" height="600" unless="fullscreen" />
<!-- <haxeflag />
Use haxeflag nodes to specify additional arguments when running the Haxe compiler.
You can set your additional flag using the name attribute, or optionally you can
also include a value attribute if the flag requires a value.
-->
<haxeflag name="--no-traces" />
<haxeflag name="-swf-lib" value="library.swf" if="flash" />
<!-- <haxedef />
Use haxedef nodes to define values for use in your Haxe code. This is similar to the
set node, but instead of applying to the NME command-line tools, it applies to your
Haxe classes.
You can use these defines to control conditional compilation inside of your code:
#if special
// do something special!
#else
// do something ordinary
#end
This is the same as using a haxeflag node, with "-D" added before the name of your
define.
-->
<haxedef name="special" />
<!-- <setenv />
Use setenv nodes to specify or override values in your system's environment variables.
These values will apply locally to the NME command-line tools and globally when calling
child process, like C++ compilers or other packaging tools.
-->
<setenv name="GLOBAL_DEFINE" />
<setenv name="JAVA_HOME" value="path/to/custom/jdk" if="android" />
<!-- <java />
Use java nodes to include custom Java classes in Android applications.
-->
<java path="path/to/java/classes" />
<!-- <certificate />
Use the certificate node to release-sign Android or BlackBerry applications.
If you do not include the password attribute, you will be prompted for your certificate password
at the command-line.
For Android, the alias will be set to the file name of your certificate by default,
without the extension. If the alias name is different, you can use the alias attribute.
If you have set the password attribute, the alias_password attribute will default to the same
value. Otherwise you can add an alias-password attribute to specify a different value.
BlackBerry does not use the "alias" or "alias-password" attributes.
-->
<certificate path="path/to/certificate.crt" password="1234" alias="my-alias" alias-password="4321" />
<!-- <ios/>
Control iOS-specific values when compiling.
The "deployment" attribute can set the minimum iOS version you wish to target.
The "binaries" attribute can be "armv6", "armv7" or "fat"
The "devices" attribute can specify "ipad", "iphone" or "universal"
If you select a device, it can set the binaries. For example, if you only want to
target the iPad, only armv7 will be required, or if you wish to target both, it will
create a universal binary by default.
-->
<ios deployment="3.2" binaries="fat" devices="universal" />
<!-- <dependency />
Use dependency nodes to specify native frameworks or references that
are required to compile your project
-->
<dependency name="GameKit.framework" if="ios" />
<!-- <path />
Use path nodes to add directories to your system's PATH environment variable.
-->
<path value="path/to/add/to/system/PATH" />
<!-- <error />
Use error nodes to throw your own errors during the build process, if necessary.
-->
<error value="ERROR: Something is wrong" />
<!-- <section />
Use section nodes to group multiple nodes together. This is most useful when
combined with the "if" and "unless" attributes.
-->
<section if="webos">
<assets path="assets/webos" include="*" />
</section>
<!-- Miscellaneous values
The command-line tools currently recognize a few miscellaneous values. You can
modify these values using set nodes.
PRERENDERED_ICON
ANDROID_INSTALL_LOCATION
DOCS_DIR
VSDEBUG
"PRERENDERED_ICON" is used with iOS. You can change this value to specify that
your application icons have been prerendered, so that XCode will not apply the
iOS "gloss" to your icon graphics.
"ANDROID_INSTALL_LOCATION" lets you customize the value specifying where your
application can be installed on Android. The default value requests an install
on the user's SD card.
"DOCS_DIR" lets you customize the output directory when using the "document"
command against your project.
"VSDEBUG" will be used if you compile for Windows using the -vsdebug flag.
Instead of launching normally, the compiled application will be opened with
Visual Studio (using this value for devenv or VCExpress.exe) for debugging.
-->
</project>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.