commit | 7c9d61c921f782d74685283cfdc525a84e29ea06 | [log] [tgz] |
---|---|---|
author | Brian O'Connor <bocon@onlab.us> | Fri Apr 28 16:13:40 2017 -0700 |
committer | Brian O'Connor <bocon@onlab.us> | Tue May 09 21:38:11 2017 +0000 |
tree | 78f9d40d837de91debf55581d07f2e4c2cf6f01c | |
parent | b3c01e72582298cc12760776b22dfdf976e7a0cf [diff] |
Check resolve for YangLibrary before constructing new one Change-Id: I7c9e92c22e6d3fe0d782336394a23db1fd19884f
diff --git a/compiler/plugin/buck/src/main/java/org/onosproject/yang/compiler/plugin/buck/YangLibraryDescription.java b/compiler/plugin/buck/src/main/java/org/onosproject/yang/compiler/plugin/buck/YangLibraryDescription.java index 3388820..1a65719 100644 --- a/compiler/plugin/buck/src/main/java/org/onosproject/yang/compiler/plugin/buck/YangLibraryDescription.java +++ b/compiler/plugin/buck/src/main/java/org/onosproject/yang/compiler/plugin/buck/YangLibraryDescription.java
@@ -97,7 +97,9 @@ BuildRuleParams yangParams = params.copyWithBuildTarget( BuildTargets.createFlavoredBuildTarget( unflavoredBuildTarget, SOURCES)); - BuildRule yangLib = resolver.addToIndex(new YangLibrary(yangParams, pathResolver, args.srcs)); + + BuildRule yangLib = resolver.getRuleOptional(yangParams.getBuildTarget()) + .or(resolver.addToIndex(new YangLibrary(yangParams, pathResolver, args.srcs))); if (params.getBuildTarget().getFlavors().contains(SOURCES)) { return yangLib;