Tag Archive: ant

Android build.xml drinking game

Found some more errors in build.xml supplied by adt16 in the android sdk. What it boils down to is you need to move two xpath property declarations back to the ant root node so that they are initialized right, see the gist. So what is the drinking game for each sdk android tools release for every error in  the build file take drink of wine and eat some cheese. please Google/OHA start offering some credit/debit card cash bounties to this shit as I am getting tired of seeing them every time you change the build process. Or maybe field test the changes before releasing a new sdk version?

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.

Android build.xml corrections

With every android build.xml comes a little pain. It still seems that they do not test the android application build.xml over at Google given the errors I am finding. Your first correction will be to change the path jar.libs.ref to what is in this gist. It prevents the path from bombing out due to the project.libraries not existing if you do not have project.libraries, just imagine that concept!