From 7162819ff25fd6b90ab1c1dca97a30af3d0c5a14 Mon Sep 17 00:00:00 2001 From: Nick Holland Date: Fri, 16 Dec 2016 17:32:17 +0000 Subject: [PATCH] Fix C# build break due to C++ property macro modification 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/dali-swig/property-wrapper.rb b/plugins/dali-swig/property-wrapper.rb index 9d8394c..37a8cf9 100755 --- a/plugins/dali-swig/property-wrapper.rb +++ b/plugins/dali-swig/property-wrapper.rb @@ -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 -- 2.7.4