]>
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
72d6ad82d82a389a4d820c9c516d47046c6b288a
2 * Copyright (C) 2007-2012 Mathieu Baudier
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.argeo
.slc
.client
.ui
.dist
.commands
;
19 import java
.io
.IOException
;
20 import java
.util
.jar
.Manifest
;
22 import org
.eclipse
.core
.commands
.AbstractHandler
;
23 import org
.eclipse
.core
.commands
.ExecutionEvent
;
24 import org
.eclipse
.core
.commands
.ExecutionException
;
26 import aQute
.lib
.osgi
.Builder
;
27 import aQute
.lib
.osgi
.Constants
;
28 import aQute
.lib
.osgi
.Jar
;
30 public class BndProcess
extends AbstractHandler
implements Constants
{
32 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
34 Builder b
= new Builder();
35 b
.setProperty(EXPORT_PACKAGE
, "org.osgi.framework");
36 b
.setProperty(PRIVATE_PACKAGE
, "*");
37 b
.addClasspath(new File(
38 "/home/mbaudier/.m2/repository/org/eclipse/osgi/org.eclipse.osgi/3.6.1/org.eclipse.osgi-3.6.1.jar"));
41 Manifest m
= jar
.getManifest();
42 jar
.write(new File(b
.getBsn() + ".jar"));
43 } catch (IOException e
) {
44 // TODO Auto-generated catch block
46 } catch (Exception e
) {
47 // TODO Auto-generated catch block
54 public static void main(String
[] args
) {
56 new BndProcess().execute(null);
57 } catch (ExecutionException e
) {
58 // TODO Auto-generated catch block