Building WordPress for Android
WordPress clients are available for many devices, but since I’m an Android fan I get to use WordPress for Android.
Yesterday, I came across a bug report outside of the developer ecosystem, managed to reproduce the bug using the release version, and, decided to write and submit a patch to fix the bug.
The main WordPress for Android repository is over at GitHub. But as it turns out…
…one does not simply build WordPress for Android.
A very low number of contributors, the low amount of open pull requests and the staggering amount of issues shows that few have been able to actually contribute code.
There’s no room for IDEs, fancy build- and dependency- management systems in my workflow; I don’t have Eclipse, Android Studio or any other monster. I use the standard command line tools that come with the Android SDK. For building, the default and standard –
ant. And while the readme does actually say that building using
ant is possible, it actually isn’t at all straighforward.
Gradle? That didn’t work either, actually. One of the several dozen build tasks failed and since I don’t know
gradle at all I decided to create a simple bash script to get a semi-decent build that works together.
The script may or may not work for you, and depends on how bad you want to build WordPress for Android. I’m assuming a working tree close to 6a2f7dd1b3c44aac7b3efa170506b7e2e835702b, and if you’re reading this later, the developer leads may actually have gotten a decent build process together and actually allow mere mortals to compile the app (let’s hope).
Here’s a complete Bash script to get a build going without any fancy-pants build systems or IDEs (at least for me):
The build file above is riddled with things that need to be done before a sort-of build can be made. Why so hard and complicated? It just isn’t meant to be built, it seems.
WordPress-Android lead developers: fix your build scripts so more people can contribute!