Skip to content

Commit

Permalink
Merge pull request #6 from shoebox/iOS-metadata
Browse files Browse the repository at this point in the history
@iOS Metdata
  • Loading branch information
shoebox committed Mar 4, 2014
2 parents 764973e + dd886ff commit b028e08
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "BSD",
"tags": ["hyperfiction", "macro","shoebox","openfl"],
"description": "Essential macros for native extensions",
"version": "1.0.1",
"releasenote": "Initial release",
"version": "1.0.2",
"releasenote": "@iOS meta",
"contributors": ["shoebox"]
}
13 changes: 10 additions & 3 deletions src/org/shoebox/macros/MacroMirrors.hx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class MacroMirrors{
* @return void
*/
static public function build( ) : Array<Field>{

//Fields
var aFields : Array<Field> = Context.getBuildFields( );
var oClass : Null<Ref<ClassType>> = Context.getLocalClass( );
Expand All @@ -70,7 +70,7 @@ class MacroMirrors{
for( field in aFields.copy( ) ){

//
aMetas = [ for( m in field.meta ) if( m.name == "CPP" || m.name == "JNI" ) m ];
aMetas = [ for( m in field.meta ) if( m.name == "CPP" || m.name == "JNI" || m.name == "IOS" ) m ];

//
if( aMetas.length == 0 )
Expand All @@ -79,7 +79,6 @@ class MacroMirrors{
//
for(m in aMetas)
{

if(m.name == "CPP" && Context.defined("cpp"))
{
aFields.push( _cpp(
Expand All @@ -96,6 +95,14 @@ class MacroMirrors{
( m.params.length > 1 ) ? _getString( m.params[ 1 ] ) : field.name
) );
}
else if( m.name == "IOS" && Context.defined("ios"))
{
aFields.push( _cpp(
field ,
( m.params.length > 0 ) ? _getString( m.params[ 0 ] ) : oClass.get( ).module,
( m.params.length > 1 ) ? _getString( m.params[ 1 ] ) : field.name
) );
}

}

Expand Down

0 comments on commit b028e08

Please sign in to comment.