BuildConfig.java?

1,412 views
Skip to first unread message

Fernando Padilla

unread,
May 29, 2012, 5:22:48 PM5/29/12
to maven-androi...@googlegroups.com
Hi. I'm trying to see if I can convert our existing apk/apklib projects to use maven, but I just ran into an issue and I can't find any mention of it.  I need the BuildConfig.java built for our project to work, but it's not being generated.  Any ideas?  I am using 3.2.0 of the maven plugin.

Fernando Padilla

unread,
May 30, 2012, 8:32:49 PM5/30/12
to maven-androi...@googlegroups.com
no one has any suggestions?
> --
> You received this message because you are subscribed to the Google
> Groups "Maven Android Developers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/maven-android-developers/-/40aS08RoJEMJ.
> To post to this group, send email to
> maven-androi...@googlegroups.com.
> To unsubscribe from this group, send email to
> maven-android-deve...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/maven-android-developers?hl=en.

Youtao Liu

unread,
May 30, 2012, 10:19:13 PM5/30/12
to Maven Android Developers
I met same problem, may the Maven does not support Android 4.0.3 (Do
you use it?) currently.
I copy a BuildConfig.java which is generated in Eclipse to the source
folder and build then.

Mykola Nikishov

unread,
May 31, 2012, 4:12:02 AM5/31/12
to maven-androi...@googlegroups.com
On 05/31/2012 03:32 AM, Fernando Padilla wrote:

> no one has any suggestions?

You could invoke BuildConfigTask Ant task [1], [2] from Maven via antrun
plugin [3]. See [4] for what configuration is required for BuildConfigTask.

[1] ${ANDROID_SRC}/sdk/anttasks/src/com/android/ant/BuildConfigTask.java
[2] ${ANDROID_SDK}/tools/lib/anttasks.jar
[3] http://maven.apache.org/plugins/maven-antrun-plugin/
[4] ${ANDROID_SDK}/tools/ant/build.xml

> On 5/29/12 2:22 PM, Fernando Padilla wrote:
>> Hi. I'm trying to see if I can convert our existing apk/apklib
>> projects to use maven, but I just ran into an issue and I can't find
>> any mention of it. I need the BuildConfig.java built for our project
>> to work, but it's not being generated. Any ideas? I am using 3.2.0
>> of the maven plugin.

--
Mykola

http://ua.linkedin.com/in/manandbytes
https://github.com/manandbytes/

Manfred Moser

unread,
May 31, 2012, 9:10:52 AM5/31/12
to maven-androi...@googlegroups.com
That is a good idea and should be possible to figure out. In the long run
we definitely need to come up with proper support for this.

Can you please file an issue with the details in our issue tracker, Fernando?

Hopefully I find the time to rebuild the r20 sdk from source and build all
the artifacts like I did for r17 including the anttasks jar and push them
into the Central Repository.

Then we can easily invoke them from the plugin codebase..

manfred
> --
> You received this message because you are subscribed to the Google Groups
> "Maven Android Developers" group.

Fernando Padilla

unread,
May 31, 2012, 12:32:08 PM5/31/12
to maven-androi...@googlegroups.com
There was a bug already there:
http://code.google.com/p/maven-android-plugin/issues/detail?id=275

And according to the issue reporter, it sounds like BuildConfig was
introduced at ADT-17, so it might be available to you right now.

Manfred Moser

unread,
May 31, 2012, 6:16:20 PM5/31/12
to maven-androi...@googlegroups.com
When I build the artifacts I deployed to central I did not figure out all
the dependencies for the Ant Task and therefore not deploy to central.

Feel free to work on that as part of the Android4Maven project. I would
love to work on it butit being only volunteer work it has to take the
backseat atm.

manfred

Manfred Moser

unread,
Aug 15, 2012, 5:36:41 PM8/15/12
to maven-androi...@googlegroups.com

This is now merged into master..

 

 

On Thursday August 9 2012 14:26:02 Dave wrote:

Jake Wharton has a fork of maven-android-plugin that fixes this problem. Clone https://github.com/JakeWharton/maven-android-plugin and merge in the  jw/buildconfig branch, and build it after you change the POM to version 3.3.1-SNAPSHOT to avoid collisions. This will deploy it to the local repo, use THIS VERSION in your project POM and that might hold you till it gets pulled into the main project.


Seems to work. 



On Tuesday, May 29, 2012 4:22:48 PM UTC-5, Fernando Padilla wrote:

Reply all
Reply to author
Forward
0 new messages