tag | 1f016bf7698b7d7b356b601d740203b30a9019f0 | |
---|---|---|
tagger | David Bosschaert <bosschae@adobe.com> | Tue Jan 21 10:47:57 2020 +0000 |
object | 830ace7bfe7620dee8bd9831f51b24928f1aaa14 |
[maven-release-plugin] copy for tag org.apache.sling.feature.diff-0.0.4
commit | 830ace7bfe7620dee8bd9831f51b24928f1aaa14 | [log] [tgz] |
---|---|---|
author | David Bosschaert <bosschae@adobe.com> | Tue Jan 21 10:47:42 2020 +0000 |
committer | David Bosschaert <bosschae@adobe.com> | Tue Jan 21 10:47:42 2020 +0000 |
tree | 1ee1fa8d117146fd2f470cb6692cd131936c746c | |
parent | c626085cce4381dc5de257d910722d67f36b8fc7 [diff] |
[maven-release-plugin] prepare release org.apache.sling.feature.diff-0.0.4
This tool aims to provide to Apache Sling users an easy-to-use tool which is able to detect differences between different released version of the same Apache Sling Feature Model.
Given two different versions of the same org.apache.sling.feature.Feature
, all we need to do is comparing them
import static org.apache.sling.feature.diff.FeatureDiff.compareFeatures; import org.apache.sling.feature.Feature import org.apache.sling.feature.diff.DiffRequest; import org.apache.sling.feature.diff.DiffRequest; ... Feature previous = // somehow obtained Feature current = // somehow obtained DiffRequest diffRequest = new DiffRequest() .setPrevious(previous) .setCurrent(current) .setResultId("org.apache.sling:org.apache.sling.diff:1.0.0"); Feature featureDiff = compareFeatures(diffRequest);
The resulting featureDiff
is a new Feature
instance which prototypes from previous
and where necessary removals sections are populated and new elements may be added.
###Please note
The FeatureDiff.compareFeatures(Feature, Feature)
rejects (aka throws an IllegalArgumentException
) Feature
inputs that:
null
(bien sûr);Feature
.The DiffRequest
data object can be configured in order to include/exclude one ore more Feature section(s), available are:
bundles
configurations
extensions
framework-properties
Users can simply add via the include/exclude methods the section(s) they are interested:
DiffRequest diffRequest = new DiffRequest() .setPrevious(previous) .setCurrent(current) .addIncludeComparator("bundles") .addIncludeComparator("configurations") .setResultId("org.apache.sling:org.apache.sling.diff:1.0.0"); Feature featureDiff = compareFeatures(diffRequest);