mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-20 20:02:17 +02:00
[onos-6359] Phase-1 - Added changes to onos.jar to support embedded dependencies
[onos-6359] Uploaded patchset 2 addressing review comments Change-Id: I9fb3ab6c144c0e1240a44a0542e79a4641a34e54
This commit is contained in:
parent
042c3a5baf
commit
3568df76f9
@ -31,6 +31,7 @@ import com.facebook.buck.step.ExecutionContext;
|
|||||||
import com.facebook.buck.step.Step;
|
import com.facebook.buck.step.Step;
|
||||||
import com.facebook.buck.step.StepExecutionResult;
|
import com.facebook.buck.step.StepExecutionResult;
|
||||||
import com.google.common.base.MoreObjects;
|
import com.google.common.base.MoreObjects;
|
||||||
|
import com.google.common.base.Strings;
|
||||||
import com.google.common.collect.ImmutableSortedSet;
|
import com.google.common.collect.ImmutableSortedSet;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
@ -76,6 +77,7 @@ public class OSGiWrapper implements Step {
|
|||||||
private String importPackages;
|
private String importPackages;
|
||||||
private String privatePackages;
|
private String privatePackages;
|
||||||
private String dynamicimportPackages;
|
private String dynamicimportPackages;
|
||||||
|
private String embeddedDependencies;
|
||||||
|
|
||||||
private String exportPackages;
|
private String exportPackages;
|
||||||
private String includeResources;
|
private String includeResources;
|
||||||
@ -102,6 +104,7 @@ public class OSGiWrapper implements Step {
|
|||||||
String includeResources,
|
String includeResources,
|
||||||
String webContext,
|
String webContext,
|
||||||
String dynamicimportPackages,
|
String dynamicimportPackages,
|
||||||
|
String embeddedDependencies,
|
||||||
String bundleDescription,
|
String bundleDescription,
|
||||||
String privatePackages) {
|
String privatePackages) {
|
||||||
this.inputJar = inputJar;
|
this.inputJar = inputJar;
|
||||||
@ -125,6 +128,7 @@ public class OSGiWrapper implements Step {
|
|||||||
this.importPackages = importPackages;
|
this.importPackages = importPackages;
|
||||||
this.privatePackages = privatePackages;
|
this.privatePackages = privatePackages;
|
||||||
this.dynamicimportPackages = dynamicimportPackages;
|
this.dynamicimportPackages = dynamicimportPackages;
|
||||||
|
this.embeddedDependencies = embeddedDependencies;
|
||||||
this.exportPackages = exportPackages;
|
this.exportPackages = exportPackages;
|
||||||
this.includeResources = includeResources;
|
this.includeResources = includeResources;
|
||||||
|
|
||||||
@ -166,6 +170,15 @@ public class OSGiWrapper implements Step {
|
|||||||
analyzer.setProperty(Analyzer.INCLUDE_RESOURCE, includeResources);
|
analyzer.setProperty(Analyzer.INCLUDE_RESOURCE, includeResources);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(embeddedDependencies != null) {
|
||||||
|
analyzer.setProperty(Analyzer.BUNDLE_CLASSPATH,
|
||||||
|
embeddedDependencies);
|
||||||
|
String finalIncludes = Strings.isNullOrEmpty(includeResources) ?
|
||||||
|
embeddedDependencies : (includeResources+","+embeddedDependencies);
|
||||||
|
analyzer.setProperty(Analyzer.INCLUDE_RESOURCE,
|
||||||
|
finalIncludes);
|
||||||
|
}
|
||||||
|
|
||||||
if (isWab()) {
|
if (isWab()) {
|
||||||
analyzer.setProperty(Analyzer.WAB, "src/main/webapp/");
|
analyzer.setProperty(Analyzer.WAB, "src/main/webapp/");
|
||||||
analyzer.setProperty("Web-ContextPath", webContext);
|
analyzer.setProperty("Web-ContextPath", webContext);
|
||||||
@ -203,7 +216,7 @@ public class OSGiWrapper implements Step {
|
|||||||
//addLocalPackages(new File(classesDir.toString()), analyzer);
|
//addLocalPackages(new File(classesDir.toString()), analyzer);
|
||||||
|
|
||||||
//add resources.
|
//add resources.
|
||||||
if (includeResources != null) {
|
if (includeResources != null || embeddedDependencies != null) {
|
||||||
doIncludeResources(analyzer);
|
doIncludeResources(analyzer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ public class OnosJarDescription implements Description<OnosJarDescription.Arg>,
|
|||||||
args.groupId, args.bundleName, args.bundleVersion,
|
args.groupId, args.bundleName, args.bundleVersion,
|
||||||
args.bundleLicense, args.bundleDescription, args.importPackages,
|
args.bundleLicense, args.bundleDescription, args.importPackages,
|
||||||
args.exportPackages, includedResourcesString,
|
args.exportPackages, includedResourcesString,
|
||||||
args.dynamicimportPackages, args.privatePackages),
|
args.dynamicimportPackages, args.privatePackages, args.embeddedDependencies),
|
||||||
args.resourcesRoot,
|
args.resourcesRoot,
|
||||||
args.manifestFile,
|
args.manifestFile,
|
||||||
args.mavenCoords,
|
args.mavenCoords,
|
||||||
@ -329,5 +329,6 @@ public class OnosJarDescription implements Description<OnosJarDescription.Arg>,
|
|||||||
public Optional<String> exportPackages;
|
public Optional<String> exportPackages;
|
||||||
public Optional<ImmutableSortedMap<String, SourcePath>> includeResources;
|
public Optional<ImmutableSortedMap<String, SourcePath>> includeResources;
|
||||||
public Optional<String> dynamicimportPackages;
|
public Optional<String> dynamicimportPackages;
|
||||||
|
public Optional<String> embeddedDependencies;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -61,6 +61,7 @@ public class OnosJarStepFactory extends JavacToJarStepFactory {
|
|||||||
private final String exportPackages;
|
private final String exportPackages;
|
||||||
private final String includeResources;
|
private final String includeResources;
|
||||||
private final String dynamicimportPackages;
|
private final String dynamicimportPackages;
|
||||||
|
private final String embeddedDependencies;
|
||||||
|
|
||||||
public OnosJarStepFactory(JavacOptions javacOptions,
|
public OnosJarStepFactory(JavacOptions javacOptions,
|
||||||
JavacOptionsAmender amender,
|
JavacOptionsAmender amender,
|
||||||
@ -79,7 +80,8 @@ public class OnosJarStepFactory extends JavacToJarStepFactory {
|
|||||||
Optional<String> exportPackages,
|
Optional<String> exportPackages,
|
||||||
Optional<String> includeResources,
|
Optional<String> includeResources,
|
||||||
Optional<String> dynamicimportPackages,
|
Optional<String> dynamicimportPackages,
|
||||||
Optional<String> privatePackages) {
|
Optional<String> privatePackages,
|
||||||
|
Optional<String> embeddedDependencies) {
|
||||||
super(javacOptions, amender);
|
super(javacOptions, amender);
|
||||||
this.bundleDescription = processParameter(bundleDescription);
|
this.bundleDescription = processParameter(bundleDescription);
|
||||||
this.importPackages = processParameter(importPackages);
|
this.importPackages = processParameter(importPackages);
|
||||||
@ -97,6 +99,7 @@ public class OnosJarStepFactory extends JavacToJarStepFactory {
|
|||||||
this.apiPackage = processParameter(apiPackage);
|
this.apiPackage = processParameter(apiPackage);
|
||||||
this.apiDescription = processParameter(apiDescription);
|
this.apiDescription = processParameter(apiDescription);
|
||||||
this.resources = resources;
|
this.resources = resources;
|
||||||
|
this.embeddedDependencies = processParameter(embeddedDependencies);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String processParameter(Optional<String> p) {
|
private String processParameter(Optional<String> p) {
|
||||||
@ -197,6 +200,7 @@ public class OnosJarStepFactory extends JavacToJarStepFactory {
|
|||||||
includeResources, // include resources
|
includeResources, // include resources
|
||||||
webContext, // web context
|
webContext, // web context
|
||||||
dynamicimportPackages, // dynamic import packages
|
dynamicimportPackages, // dynamic import packages
|
||||||
|
embeddedDependencies, // embedded dependencies
|
||||||
bundleDescription, // bundle description
|
bundleDescription, // bundle description
|
||||||
privatePackages // private packages
|
privatePackages // private packages
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user