Script for importing features into any WSO2 Carbon Feature 3.2.0 (Beta)

This is small script that works for importing additional features into an existing feature for WSO2 Carbon 3.2.0. For example, for the BAM (Business Activity Monitor) Data publisher feature I wanted to additionally import the Event UI feature as well. Here’s a small script that I ran to make this simple.

Script:

grep "artifactId>.*ui.feature" -Rl . 
|grep -v ".svn" | xargs sed -i -e '
s//\
\t\t\t\torg.wso2.carbon.event.ui:\${wso2carbon.version}\
<\/importFeatureDef>\
/g' 
 

This has been tested for Carbon 3.2.0, but it should work for Carbon 3.1.0 as well.