]> git.argeo.org Git - gpl/argeo-slc.git/blob - eclipse/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/BndProcess.java
Remove distribution view
[gpl/argeo-slc.git] / eclipse / plugins / org.argeo.slc.client.ui.dist / src / main / java / org / argeo / slc / client / ui / dist / commands / BndProcess.java
1 package org.argeo.slc.client.ui.dist.commands;
2
3 import java.io.File;
4 import java.io.IOException;
5 import java.util.jar.Manifest;
6
7 import org.eclipse.core.commands.AbstractHandler;
8 import org.eclipse.core.commands.ExecutionEvent;
9 import org.eclipse.core.commands.ExecutionException;
10
11 import aQute.lib.osgi.Builder;
12 import aQute.lib.osgi.Constants;
13 import aQute.lib.osgi.Jar;
14
15 public class BndProcess extends AbstractHandler implements Constants {
16
17 public Object execute(ExecutionEvent event) throws ExecutionException {
18 try {
19 Builder b = new Builder();
20 b.setProperty(EXPORT_PACKAGE, "org.osgi.framework");
21 b.setProperty(PRIVATE_PACKAGE, "*");
22 b.addClasspath(new File(
23 "/home/mbaudier/.m2/repository/org/eclipse/osgi/org.eclipse.osgi/3.6.1/org.eclipse.osgi-3.6.1.jar"));
24
25 Jar jar = b.build();
26 Manifest m = jar.getManifest();
27 jar.write(new File(b.getBsn() + ".jar"));
28 } catch (IOException e) {
29 // TODO Auto-generated catch block
30 e.printStackTrace();
31 } catch (Exception e) {
32 // TODO Auto-generated catch block
33 e.printStackTrace();
34 }
35
36 return null;
37 }
38
39 public static void main(String[] args) {
40 try {
41 new BndProcess().execute(null);
42 } catch (ExecutionException e) {
43 // TODO Auto-generated catch block
44 e.printStackTrace();
45 }
46 }
47
48 }