Android folks have selected ant as their choice. In the sdk you can find ant examples (platforms/android-8/ant) and by using android create project command you can get a skeleton of android project that is built by ant.
Android maven plugin is the answer they look for. To get started there are few ways to do it
- Use samples and modify http://code.google.com/p/maven-android-plugin/wiki/Samples
- Using archetype(s) https://github.com/akquinet/android-archetypes/wiki
mvn archetype:generate \
-DarchetypeArtifactId=android-quickstart \
-DarchetypeGroupId=de.akquinet.android.archetypes \
-DarchetypeVersion=1.0.5 \
-DgroupId=your.company \
-DartifactId=my-android-application - Mavenize existing android project
When you go to a builders configuration page (Projects -> Properties -> Builders) you should see 4 builders, 2 from adt (android resource builder and precompiler) and java and maven builder. I don't think that the 2 former are really necessary for the project. At least disabling them does not cause anything noticeably bad.
Most important goals are
- android:apk - to create android pakcage
- android:deploy - to deploy on emulator/device
- android:emulator-start
My own opinion
I must admit I was never a fan of maven. Mainly because mobile projects I was involved in where rather small, having no dependencies and mostly ant based. When I tried learn on my own I was put off by the conventions imposed by maven. My prejudice towards maven would last probably longer hadn't been I forced to use maven. Then I gradually discovered the power of auto dependency management and the benefits of conventions.
As android is concerned I still find some clashes but the maven plugin is strongly developed. Mailing list is active, development is active and new features arrive at good pace (recently apklib).
Still have not dwelt very deeply in android maven development so I cannot say is industry ready yet or not but the future looks promising.
How can I add pom.xml file in my already formed android application file ? What do I need to add into it ?
OdpowiedzUsuńOnce I convert the android application into a Maven project, then how to launch the emulator?
OdpowiedzUsuń