L'application sera distribuée dans un jar.
Ensuite il suffira à l'utilisateur de mettre le jar dans eclipse/dropins/otawa/plugins/ et de relancer Eclipse pour pouvoir utiliser le plugin, en ouvrant la perspective qui va bien via l'interface Eclipse.
Je peux éventuellement décompresser le jar et le mettre dans le même dossier (et là la dll sera dans le dossier eclipse/dropins/otawa/plugins/libotawa/lib/).
Pour l'instant j'ai ça
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
public void start(BundleContext context) throws Exception {
super.start(context);
String path;
// build OJAWA path
String os = java.lang.System.getProperty("os.name");
if(os.equals("Linux")){
path = FileLocator.toFileURL(FileLocator.find(context.getBundle(), new Path("/"), null)).getPath();
path = path + "/libotawa/lib/libojawa.so";
}
else if(os.startsWith("Windows")){
path = FileLocator.toFileURL(FileLocator.find(context.getBundle(), new Path(""), null)).toString();
path = path + "libotawa/lib/libojawa.dll";
} |
qui fonctionne parfaitement sous linux, mais pas sous windows.
Sous windows, la variable String path vaut
/D:/Lecourt/workspace/ADTREE/libotawa/bin/libojawa.dll
Le / avant D est un peu gênant 
Je pourrais l'enlever en manipulant le String, mais je préfèrerais une solution plus propre.
Partager