FeatureIDE

open-source Open-source module
tapir-extensions-feature-ide is an open-source module which is hosted at tapir-extensions. Feel free to contribute!

The FeatureIDE project allows to create both feature model files as well as variant configuration files with an Eclipse plugin. With this module we support the FeatureIDE files and allow to generate the features and the variants for usage in tapir.

Dependency

<dependency>
  <groupId>io.tapir-test</groupId>
  <artifactId>tapir-extensions-feature-ide</artifactId>
  <version>1.1.0</version>
</dependency>
Caution
Although the FeatureIDE extension is open-source, it requires the product line testing modules of tapir which are not part of the non-commercial licenses.

Features

To generate the features from your feature model file, you can use the dynamic active annotation FeatureIDEFeatures. Provide the path to your model file and the annotation will generate all features in it except the abstract ones.

@FeatureIDEFeatures('/model.xml')
class Features {  
}

Per default the features get the suffixes Feature. You can change the prefixes and the suffixes of your features with the annotation properties prefix and suffix.

@FeatureIDEFeatures(value='/model.xml', prefix='MyPrefix', suffix='MySuffix')
class Features {  
}

As with all of tapir’s dynamic active annotations you can implement an own annotation processor if you need even more control. The default annotation processor is FeatureIDEFeaturesProcessor with an order of -10000.

Caution
For technical reasons it is currently recommended to put the model files into the same source folder as the annotated class (e.g. src/main/java). Otherwise the annotation is not able to find the files during the build process.

Variants

To generate a variant from your variant configuration file, you can use the dynamic active annotation FeatureIDEVariant. Provide the path to your configuration file and the annotated class will be turned into a variant. All selected features are added to the variant.

@FeatureIDEVariant('/variant1.xml')
class Variant1 {  
}

Per default the annotation assumes that the features are contained in the same package as the variant and that all features have the suffix Feature. You can change this behavior using the annotation properties.

@FeatureIDEVariant(value='/variant1.xml', prefix='MyPrefix', suffix='MySuffix', featuresPackage="my.features")
class Variant1 {  
}

As with all of tapir’s dynamic active annotations you can implement an own annotation processor if you need even more control. The default annotation processor is FeatureIDEVariantProcessor with an order of -10000.