Fix C# build break due to C++ property macro modification 81/105481/1
authorNick Holland <nick.holland@partner.samsung.com>
Fri, 16 Dec 2016 17:32:17 +0000 (17:32 +0000)
committerNick Holland <nick.holland@partner.samsung.com>
Fri, 16 Dec 2016 17:32:17 +0000 (17:32 +0000)
C# property generator script now strips out
any comments inserted after the property macro.

E.g. the following macro was breaking the script due to the // deprecated comment

DALI_PROPERTY_REGISTRATION( Toolkit, Button, "unselectedStateImage",               MAP,     UNSELECTED_STATE_IMAGE                ) // Deprecated property

Change-Id: Ifbbd45c71a44768c50d9bd2735d5aa0c5f4ddb7d

plugins/dali-swig/property-wrapper.rb

index 9d8394c..37a8cf9 100755 (executable)
@@ -119,6 +119,14 @@ def extractToolkitPropertyInfo( propertyMacro )
     # Extract the property name, type
     property = $propertyStruct.new;
 
+    #First strip out any comments at the end of the macro, some have text like // deprecated
+    commentIndex = propertyMacro.index("//");
+
+    if( commentIndex )
+        propertyMacro = propertyMacro.slice(0..commentIndex-1)
+    end
+
+
     # Split the macro definition by comma and quotes, close bracket and delete any empty segments
     data = propertyMacro.split(/[\s,")]/).reject { |s| s.empty? }
 
@@ -177,6 +185,7 @@ def extractToolkitPropertyInfo( propertyMacro )
         property.type = data[4]
       end
 
+      # last item should be property enum, e.g. INPUT_POINT_SIZE
       property.enum = data[data.length-1]
 
     end