Re: Custom BuildConfig constants

765 views
Skip to first unread message

Jonas de Faria Alves

unread,
Jun 14, 2013, 4:12:53 PM6/14/13
to maven-androi...@googlegroups.com
No interest on such patch?

On Wednesday, May 22, 2013 12:18:21 PM UTC-3, Jonas de Faria Alves wrote:
It seems BuildConfig.java's content is hardcoded at GenerateSourcesMojo.

1. How do/would you add new constants to an app's BuildConfig.java? (eg: production/staging backend host name)

2. Would you accept a patch to add new constants from the plugin configuration? Eg:
<plugin>
    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
    <artifactId>android-maven-plugin</artifactId>
    <configuration>
        <buildConfig>
            <server type="String">production.my-host.com</SERVER>
        </buildConfig>
    </configuration>
</plugin>

which would add to BuildConfig.java:
public static final String SERVER = "production.my-host.com";

Regards,
Jonas

Manfred Moser

unread,
Jun 14, 2013, 5:12:27 PM6/14/13
to maven-androi...@googlegroups.com
Sure..

> No interest on such patch?
>
> On Wednesday, May 22, 2013 12:18:21 PM UTC-3, Jonas de Faria Alves wrote:
>>
>> It seems BuildConfig.java's content is hardcoded at
>> GenerateSourcesMojo<https://github.com/jayway/maven-android-plugin/blob/master/src/main/java/com/jayway/maven/plugins/android/phase01generatesources/GenerateSourcesMojo.java#L693>
>> .
>>
>> 1. How do/would you add new constants to an app's BuildConfig.java? (eg:
>> production/staging backend host name)
>>
>> 2. Would you accept a patch to add new constants from the plugin
>> configuration? Eg:
>> <plugin>
>> <groupId>com.jayway.maven.plugins.android.generation2</groupId>
>> <artifactId>android-maven-plugin</artifactId>
>> <configuration>
>> <buildConfig>
>> <server type="String">production.my-host.com</SERVER>
>> </buildConfig>
>> </configuration>
>> </plugin>
>>
>> which would add to BuildConfig.java:
>> public static final String SERVER = "production.my-host.com";
>>
>> Regards,
>> Jonas
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Maven Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to maven-android-deve...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

Jonas Alves

unread,
Jun 14, 2013, 9:35:19 PM6/14/13
to maven-androi...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages