transfuse
transfuse copied to clipboard
manifest package name rewriting
do you think there is an easy win to facilitate changing namespace based on build variant package names like in the manifest snippet below where com.namespace.local
could be com.namespace.test
or com.namespace.prod
depending on the build variant... currently gradle takes care of replacing namespace in the <manifest packag="com.namespace"
with whatever the variant specifies. but the rest needs to either be done through some custom groovy or via manifest merging, neither option is particularly appealing.
<uses-permission android:name="com.namespace.local.permission.C2D_MESSAGE" t:tag="+,n"/>
...
<permission android:name="com.namespace.local.permission.C2D_MESSAGE" android:protectionLevel="signature" t:tag="+,n,p"/>
...
<receiver android:name=".gcm.PushReceiverBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" t:tag="+,n,p">
<intent-filter t:tag="+">
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<category android:name="com.namespace.local" t:tag="+,n"/>
</intent-filter>
</receiver>
Hmm, we could introduce a build parameter... can you describe the use case further? I'm not sure I understand.
Basically, you need certain permissions and categories to match the package name of the app. but the package name is determined at build time and the permissions and categories are hard coded in the source.