Monthly Archives: September 2014

2 posts

IEC 60870 Explorer

Finally we put a few functions and classes together that we already had, and made a simple, easy to use and jet powerful tool which we would liked to have ourselves ;-) Sadly it did not exist when we would have needed it, so we had to make it ourselves.

A simple tool to access data from an IEC 60870-5-104 device. Just browse the values and send some commands.

There are already a few products out there in this area, but either are they expensive and very complex applications that provide a lot more than you actually need. And are nearly unusable if you don’t know what it is all about. Or they are simply crap.

Here is our approach to this problem: The IEC 60870-5-104 Explorer.

Creating a Mac OS App Bundle with Maven Tycho

Using Maven Tycho it is possible to build OSGi applications and therefore Eclipse RCP applications easily with Maven. Creating a ready to run product is already described on the internet a few times.

But what is mostly missing is, how to make an nice Mac OS X application bundle, that looks like a real Mac OS X application and not like a bunch of files extracted from a ZIP/TAR file.

Assuming you already have set up your Maven Tycho RCP build and are building products using the packaging type “eclipse-repository” here is what you need to do in addition.

Extend the configuration in the “eclipse-repository” project by calling (or enhancing the call) to:

[code language=”xml”]<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho-version}</version>
</plugin>[/code]

If you don’t have a “configuration” element for this plugin yet, then add it as a child element and configure the specific product you are building:

[code language=”xml”]
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<formats>
<win32>zip</win32>
<linux>tar.gz</linux>
<macosx>tar.gz</macosx>
</formats>

<products>
<product>
<id><<group.id>>.<<artifact.id>></id>
<rootFolders>
<macosx>My Application.app</macosx>
</rootFolders>
</product>
</products>
</configuration>
</plugin>
[/code]

“group.id” and “artifact.id” make up the id of your application. Which must be consistent with the “id” property in the “.product” file.

The most important thing is is the configuration of the “rootFolder” for the target type Mac OS X here. It would also be possible to use the plain “rootFolder” property, but using “rootFolders” (with the “s”) it is possible to just make an alternate name for Mac OS X.

In addition to that tell the repository bundle (in the same Maven project) to generate for Mac OS X.

[code language=”xml”]
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-repository-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<includeAllDependencies>true</includeAllDependencies>
<profileProperties>
<macosx-bundled>true</macosx-bundled>
</profileProperties>
</configuration>
</plugin>
[/code]

Running “maven package” will now give you a “products” folder under your output folder (normally “target”) which hosts a zipped version of your Mac OS X app bundle, which extracts to “My Application.app” and shows in the finder as “My Application”.