Category: Eclipse


Evidently someone forked one of the not-updated in  a while mylyn connectors for Bitbucket and fixed it. Installation Instructions are at here.

Advertisements

Have you seen that dreaded aapt error? if you have an older machine and only 4 gig ram and run Linux you will see this error when Eclipse attempts to fork to do the aapt process. Some solutions have you mess with certain process flags or swap, but my solution is easier and no side-effects.  Just switch from using Chrome to the Mozilla browser.  Several tabs open only takes up 200 megs or less memory and do not add any other 3rd party plug-ins to the install.

I am putting up a BDD example while I finish my customized build scripts. It will be setup so that if you are using eclipse IDE you should be able to fully set it up with the exception of Cucumber without waiting for a build script. The main project(BDDAndroid) will contain an apectj setup and the dependency injection setup. The instrumented test project(BDDAndroidTest) will contain the setup for robotium/android-mock, dependency injection and fest-assertions and hamcest.

I will be adding the LunarLander example to use for testing thus if you follow the commit sequence of both projects you have the general sequence to get fast BDD and prototype iterations. For those new to Eclipse 3.7 and github, you should be creating your projects outside the workspace, ie home/yourname/git/github and than check the store git in project folder so that you do not get an extra project folder when remote pushing to github on a project you have created.  As I progress I will be adding hooks in my customized build script to trigger monkeyrunner to run the tests so as we can get the screenshots and regression testing.

Because I will be committing the customized build script to the same projects from first commit you will be able to see how to customize your own build-script.

Eclipse EGIT/Github Trick

Is not that extra project folder annoying? Yes, they changed egit again as you can no longer store the repo in the eclipse workspace. To get the .git metadata folder in the project folder root like github expects uncheck default location at project setup and add an extra folder above the project name. For example:

home/fredgrott/git/github/projectname

This will than allow you to store the .git metadata folder in the proper place as its not crating the repo in the workspace which is not allowed.

xGherkin-Cucumber plugin

There is a new XGherkin Cucumber Eclipse plugin based on xtext. Update site link is in the readme.

I have figured out howto run cucumber-jvm and robotium, etc the same way as LessPain. I just, now, have to write the android application build.xml to enable it.

It is not the really the speed of the test execution that matters, like robolectric(pivotal) claims. Its can you speed up the test writing by making it easier to write the test code. I think that combination combined with more reliable tests in the realm of BDD instrumented will be enough to always choose robotium over robolectric.

I have updated my proguard.cfg configuration file.  I have added stuff for using roboguice 2.0 and guice. Its not fully tested as of yet so use at your own risk. The general idea was I wanted to get to the point of sometime this next week being fully switched over to always using roboguice/guice and BDD instrumented testing and thus needed certain items configured a certain way to be able to do everything or close to everything form the IDE without a build file as I am still cleaning up the build.xml file that I will be using.

Weird eclipse ANtstuff

many developers when developing ant build scripts do not realize that the Ant standalone and the IDE ant install have different antclassloaders. Thus, when using Eclipse you cannot use the basedir variable as a value for dirname property as in the ant standalone it will work but in the Ant install in the Eclipse IDE it will not as it will default to the workspace while in the ant standalone default to the project folder.

Eclipse Log4j.properties trick

If you are moving towards using agile in developing ant build scripts and need to use Log4j to log build errors(see Log4nt) than you run into the problem of how to enable the eclipse AntClassLoader to pick up the log4j.properties file.  There is a trick to it.

Take and make a global log4j.properties file for all your projects and save it. Now zip that file. Now rename the zipped file to a jar. Now in Eclipse ant preferences run-time add the external jar into the same place as where the ant plugin is showing all the lib entries. Now when you run ant builds that use Log4j.properties and Log4j it will execute correctly and pick up the log4j.properties file to have Eclipse AntClassLoader recognize the log4 appender.

Can I shoot the M’Fers?

Yes, I really am saying that …Can I shoot you M’Fers? Do a search on java techniques and android. For example, search for aspectj and android. Now, notice how many howtos state that in an ant build you run acj or iacj after the android javac compile step. Now pick up the damn gun and shoot your M’fer ass! Why?

Because lack of knowledge of advance java techniques and java tools is a sign that you should not claim that you are a java developer. Okay, for those that do not know you set the iacj to run in the javac task or just use ant4eclipse ant task adapter to make the process easier as there is no need to run two effing compiles on the main project or a test project when using aspectj in an android project!

And really if you are already using an ant build or the IDE builder running an ant build than by god dammit the ecj is an incremental builder which can sped up an android build especially if you are using instrumental testing. Also you can set more verbose feedback options using ecj instead of the javac that comes with the Oracle JDK.

Obviously, the other component of Agile development in systems that have broken or very decoupled anti-patterns such as android is in fact Aspect Oriented Programming due to the fact that you can separate concerns, etc. Specifically TDD and BDD only affect the agility or speed of development in the test process itself not the full development process itself. Dependency Injection also affects agility of the full development process rather than just testing if you apply it to the full project rather than just testing.

Unfortunately, most firms get stuck with java developers who happen to be android developers that replace java expertise and agile expertise with knowing only  the TDD/BDD buzz words.Please can I shoot those MF’ers? Yes, there is even on the market right now one Android Developer Testing Book that makes all these mistakes. Yes, really one publisher got their head up the ass and actually gave someone money to produce such  trash.