Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 8b9fd5290ff96303528b7f34b72a0ee9fa21c71a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<%@ jet package="org.eclipse.gmf.graphdef.codegen.standalone.templates" class="ManifestMFGenerator"
	imports="java.util.* org.eclipse.gmf.graphdef.codegen.*"%>
<%
final Object[] passedArgs = (Object[]) argument;
final StandaloneGenerator.Config config = (StandaloneGenerator.Config) passedArgs[0];
final String[] requiredBundles = (String[]) passedArgs[1];


class ListComposer {
	public String composeList(Collection strings){
		StringBuffer result = new StringBuffer();
		for (Iterator it = strings.iterator(); it.hasNext();){
			result.append(" "); //do not miss required space here
			result.append(it.next());
			if (it.hasNext()){
				result.append(", " + NL);
			}
		}
		return result.toString();
	}
}

final ListComposer listComposer = new ListComposer();
%>
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: <%=config.getPluginID()%>; singleton:=true
Bundle-Version: 1.0.0
Bundle-Vendor: %providerName
Bundle-Activator: <%=config.getPluginActivatorPackageName()%>.<%=config.getPluginActivatorClassName()%>
Bundle-Localization: plugin
<%
	HashSet exportedPackages = new HashSet();
	if (config.getMainPackageName() != null && config.getMainPackageName().trim().length() > 0) {
	exportedPackages.add(config.getMainPackageName());
	}
	exportedPackages.add(config.getPluginActivatorPackageName());
%>
Export-Package: <%=listComposer.composeList(exportedPackages)%>
<%
final Set allRequiredBundles = new LinkedHashSet();
allRequiredBundles.add("org.eclipse.gef");
allRequiredBundles.add("org.eclipse.draw2d");
allRequiredBundles.add("org.eclipse.osgi");
allRequiredBundles.add("org.eclipse.core.runtime");
allRequiredBundles.addAll(java.util.Arrays.asList(requiredBundles));
if (config.needsMapMode()) {
	allRequiredBundles.add("org.eclipse.gmf.runtime.draw2d.ui");
}
%>
Require-Bundle: <%=listComposer.composeList(allRequiredBundles)%>
Eclipse-LazyStart: true

Back to the top