Posts

Choosing JS build tool

Lately I was tasked to setup a JS based project together with full build and testing automation. Today I'd like to share the build and testing part, as it turned out to be quite interesting problem. In short, we have a little JavaScript library that is designed for browsers. During build it should be packaged from source (e.g. multiple extensively documented files) to several different versions (e.g. bundled with other files, minified, etc.); ran against unit tests and validated with JSLint. Assuming that someone would like to try this library, they might be willing to build and test it as well, so a JS-friendly technology would be a perfect hit, won't it? Ok, so it was time for a little research on what do others use for building their JS libs. Half of the internet seems to be using Makefiles, while the other half is deep in love with Ant. To be specific, jQuery, Bootstrap, Code9 IDE were using make, while for example Dojo and Firebug were on Ant! It's actually quite relie...

Google Summer of Code + Eclipse PHP Tools !?

Image
It's that time of year again when students join open source projects, disrupt the old traditions and bring new ideas into life as part of Google Summer of Code! Last year I was mentoring a great project led by Karol Gusak , which was crossing the edge of Web and desktop developer tools. Karol built Eclipse PDT into Orion web tools , bringing core PHP coding support to cloud. Click to see the video Do you hate how Eclipse PDT works, absolutely can't stand what great feature it's missing, or wondering why it still doesn't integrate with that other awesome technology in your mind? Start thinking and chime in with your ideas on Eclipse PDT email list , post it on ideas wiki or contact me ! I'd be happy to mentor this year again, and I'm on look out for anything cloud mobile revolutionary lego embedded wordpress css javascript php zendframework symfony automotive node mongo and smart tv too.

No error dialogs in eclipse headless test

Here's a small funny thing I learned a while ago while running GUI tests of Eclipse application and now stumbled upon it again. When running Eclipse tests headlessly, certain dialogs don't show up as they would normally (e.g. when writing/recording the test). This is because of flags: org.eclipse.jface.dialogsErrorDialog.AUTOMATED_MODE = false; org.eclipse.jface.util.SafeRunnable.setIgnoreErrors(true); So if you for example have a test scenario that DOES expect an error dialog to show up, make sure you have above flags set correctly, or find out a different assertion than waiting for an error dialog.

Orion PHP Support demo

Image
If you're following Eclipse planet , you couldn't have missed Karol Gusak's weekly status reports about PHP support that's being built for Orion. If you still haven't tried PHP in Orion yourself, here's a little demo now on YouTube that nicely shows syntax highlighting, content-assist as well as overall PHP experience in Orion. Click below to check it now.

Making extensible GUI with org.eclipse.ui.menus

Image
It's actually first time I had to make a custom part of GUI extensible. In an Eclipse forms editor like following, we wanted custom actions to come from various plugins: Since eclipse APIs provides this sort of extensibility with their org.eclipse.ui.menus extension point, I looked at how to reuse that mechanism. It turns simple. All you need to do is, while creating the editable area, add: final Composite parent = ... // that's the area we want to make extensible ContributionManager contributionManager = new ContributionManager() { public void update(boolean force) { for (IContributionItem item : items) { item.fill(parent); } } }; IMenuService service = (IMenuService) getSite().getService(IMenuService.class); contributionManager.add(new GroupMarker("testing")); service.populateContributionManager(contributionManager, "toolbar:org.zend.editor1?after=testing"); contributionManager.update(false); Now to contribute something to that area, you ...

Starting and immediately using OSGi bundle: possible?

Lately I had this little thing to do: an OSGi bundle (SuperTool) comes with some other OSGi bundle (GreatSdk) included. SuperTool depends on logic in GreatSdk so the first thing it needs to do during activation is to install GreatSdk and immediately after that start loading classes from GreatSdk. At first thought it seems logical to make SuperTool-GreatSdk dependency optional, to let SuperTool install and start safely without GreatSdk. Once installed, during startup SuperTool should install GreatSdk and start using it, for example: BundleActivator.start(BundleContext context) { greatSdk = context.installBundle("file:///path/to/great.sdk_1.0.0.jar"); greatSdk.start(); GreatSdkStarter gss = new GreatSdkStarter(); // separate class in SuperTool that references some classes from GreatSdk gss.start(); // creates some GreatSdk classes } Unfortunately this fails in gss.start() with ClassNotFoundException: java.lang.ClassNotFoundException: greatSdk.Sdk at org.eclipse.osgi.internal.lo...

Installing V8Cgi on Mac

V8CGI is a very thin Apache module encapsulating V8 - Google's JavaScript engine that's used e.g. in Google Chrome. Those concerned with NodeJS stability may consider V8CGI a better choice, thanks to stability provided by Apache base. A short while ago, on DevMeetings.pl DevCamp we've been playing with V8CGI, RingoJS and Node. Thanks to good performance , intuitive and high quality APIs , V8CGI turned out to be the black horse of the whole event, although installing it on Macs was little tricky. Readers with Windows and Linux should follow to V8CGI home page , where they can get precompiled Windows binary and learn how to install binary on Ubuntu . Mac users, let's open terminal and try to build the V8 apache module ourselves. Getting V8CGI to work is four steps: 1. Getting the source code 2. Building it 3. Configuration 4. Test drive 1. Getting the source code When checking out sources from SVN, we actually need two packages V8 and V8CGI: a) svn checkout http://v8cgi...