[Mono-bugs] [Bug 665840] New: Need a macro to replace tokens in attribute string constants (eg: __PackageName__ )

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jan 20 08:59:02 EST 2011



           Summary: Need a macro to replace tokens in attribute string
                    constants (eg: __PackageName__ )
    Classification: Mono
           Product: MonoDroid
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: P5 - None
         Component: Class Libraries
        AssignedTo: mkestner at novell.com
        ReportedBy: jondick at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.237 Safari/534.10

Here's the scenario.  For C2DM, I need to generate a manifest like this:
<!-- Only C2DM servers can send messages for the app. If permission is not set
- any other app can generate it -->
        <receiver android:name="{YOUR.PACKAGE}.C2dmBroadcastReceiver"
            <!-- Receive the actual message -->
                <action android:name="com.google.android.c2dm.intent.RECEIVE"
                <category android:name="{YOUR.PACKAGE}" />
            <!-- Receive the registration id -->
android:name="com.google.android.c2dm.intent.REGISTRATION" />
                <category android:name="{YOUR.PACKAGE}" />

So, in the code I can use attributes to do most of this:
[IntentFilter(new string[] { "com.google.android.c2dm.permission.RECEIVE",
"com.google.android.c2dm.intent.REGISTRATION" }, 
    Categories=new string[]{ "__PackageName__" })]
public class C2dmBroadcastReceiver : BroadcastReceiver

However note that i put __PackageName__ as the category.  I need to somehow
have this automatically replaced with the real package name.  I realize I could
type in the string manually, however I'm using this for my C2DM-Sharp library,
and I won't know the package name at this point (this is a MonoDroid Library,
so ideally the __PackageName__ gets replaced with the package name of the app
which is referencing this library).

Reproducible: Always

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list