Re: How do I include a URL in a preprocessed Info.plist?

2008-12-29 Thread Isaac Wankerl
On Sat, Dec 27, 2008 at 6:22 AM, Graham Cox graham@bigpond.com wrote:

 I'm preprocessing my info.plist file so I can automatically update it with
 version number, etc.

 I want to include a URL in my plist (to support Sparkle) but Xcode won't
 let me. If I include the URL directly, it causes an error (xml parse error).
 If I define a substitution for it in my plist preprocessing settings, I get
 no error, but only 'http:' is copied, and the rest of the URL is stripped.

 How do I do this?

 thanks, Graham


Here's how I do it...

My build settings have Expand build settings in info.plist file and
Preprocess info.plist file turned on.

Then in my Info.plist file I have

keySUFeedURL/key  stringhttp:#47;/www.kerlmax.com/foo/string

Note that you have to escape one of the slashes in http:// for the parsing
to work.

Isaac
Kerlmax LLC
http://www.kerlmax.com
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How do I include a URL in a preprocessed Info.plist?

2008-12-28 Thread Michael Nickerson


On Dec 27, 2008, at 7:37 PM, Graham Cox wrote:



Anyway, that's useful info, at least it explains what I'm seeing. I  
worked around it in a different way in the end - I added a user- 
defined setting for my URL then just used ${MY_URL} in the plist.  
That worked fine - this is similar to Phillipe's suggestion.




I know you found a way to do this that works for you, but I just  
wanted to point out that you can also just put it into the  
InfoPlist.strings file(s) and it'll work just fine (and, in the case  
of Sparkle, allows you to have different URLs for different  
localizations if you want to do that).


Just so I'm clear here, I mean putting the key into the  
InfoPlist.strings file(s) rather than into the Info.plist file.  This  
will work for almost any key you want to use, as long as you (or the  
underlying API) is using -objectForInfoDictionaryKey to look up the  
keys.


--
Darkshadow
(aka Michael Nickerson)
http://www.nightproductions.net


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How do I include a URL in a preprocessed Info.plist?

2008-12-28 Thread Graham Cox


On 28 Dec 2008, at 11:35 pm, Michael Nickerson wrote:

I know you found a way to do this that works for you, but I just  
wanted to point out that you can also just put it into the  
InfoPlist.strings file(s) and it'll work just fine (and, in the case  
of Sparkle, allows you to have different URLs for different  
localizations if you want to do that).


Just so I'm clear here, I mean putting the key into the  
InfoPlist.strings file(s) rather than into the Info.plist file.   
This will work for almost any key you want to use, as long as you  
(or the underlying API) is using -objectForInfoDictionaryKey to look  
up the keys.



Actually I did try that, and it didn't work for me. It certainly  
sounds like a good idea.


Since the API in question is within Sparkle I don't know what it's  
using. I'll ask the question...


cheers, Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How do I include a URL in a preprocessed Info.plist?

2008-12-27 Thread Graham Cox
I'm preprocessing my info.plist file so I can automatically update it  
with version number, etc.


I want to include a URL in my plist (to support Sparkle) but Xcode  
won't let me. If I include the URL directly, it causes an error (xml  
parse error). If I define a substitution for it in my plist  
preprocessing settings, I get no error, but only 'http:' is copied,  
and the rest of the URL is stripped.


How do I do this?

thanks, Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How do I include a URL in a preprocessed Info.plist?

2008-12-27 Thread Andrew Farmer

On 27 Dec 08, at 04:22, Graham Cox wrote:
I'm preprocessing my info.plist file so I can automatically update  
it with version number, etc.


I want to include a URL in my plist (to support Sparkle) but Xcode  
won't let me. If I include the URL directly, it causes an error (xml  
parse error). If I define a substitution for it in my plist  
preprocessing settings, I get no error, but only 'http:' is copied,  
and the rest of the URL is stripped.


Does your URL have an ampersand () in it? If so, try escaping it as  
amp;.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How do I include a URL in a preprocessed Info.plist?

2008-12-27 Thread Graham Cox


On 27 Dec 2008, at 11:27 pm, Andrew Farmer wrote:

Does your URL have an ampersand () in it? If so, try escaping it as  
amp;.



No it doesn't - it's just a very straightforward URL like 
http://mysite.com/path/to/stuff.xml

(I also tried quoting the string which makes no difference)

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How do I include a URL in a preprocessed Info.plist?

2008-12-27 Thread James W. Walker


On Dec 27, 2008, at 7:22 AM, Graham Cox wrote:

I'm preprocessing my info.plist file so I can automatically update  
it with version number, etc.


I want to include a URL in my plist (to support Sparkle) but Xcode  
won't let me. If I include the URL directly, it causes an error (xml  
parse error).


I don't know why that would be.  Can you show us some of the  
Info.plist containing the URL?


If I define a substitution for it in my plist preprocessing  
settings, I get no error, but only 'http:' is copied, and the rest  
of the URL is stripped.


I suspect you're being affected by the fact that // is a comment  
delimiter in .xcconfig files.  In a similar situation, I had to define  
a build setting SLASH to be a single slash, and then say $SLASH$SLASH  
in the URL.

smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

RE: How do I include a URL in a preprocessed Info.plist?

2008-12-27 Thread Philippe.Casgrain
Sparkle supports quoted urls in the plist file (I wrote the patch exactly for 
the problem you are experiencing).

In my case, I #define MyURL HTTP://www.myurl.com/myupdate.xml in my 
pre-processing source file, then use MyURL in the plist file. Works like a 
charm!

Phil

From: cocoa-dev-bounces+philippe.casgrain=corel@lists.apple.com 
[cocoa-dev-bounces+philippe.casgrain=corel@lists.apple.com] On Behalf Of 
Graham Cox [graham@bigpond.com]
Sent: Saturday, December 27, 2008 7:30 AM
To: Andrew Farmer
Cc: Cocoa-Dev List
Subject: Re: How do I include a URL in a preprocessed Info.plist?

On 27 Dec 2008, at 11:27 pm, Andrew Farmer wrote:

 Does your URL have an ampersand () in it? If so, try escaping it as
 amp;.


No it doesn't - it's just a very straightforward URL like 
http://mysite.com/path/to/stuff.xml

(I also tried quoting the string which makes no difference)

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/philippe.casgrain%40corel.com

This email sent to philippe.casgr...@corel.com
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How do I include a URL in a preprocessed Info.plist?

2008-12-27 Thread Gregory Weston

Graham Cox wrote:


On 27 Dec 2008, at 11:27 pm, Andrew Farmer wrote:


Does your URL have an ampersand () in it? If so, try escaping it as
amp;.


No it doesn't - it's just a very straightforward URL like http:// 
mysite.com/path/to/stuff.xml


(I also tried quoting the string which makes no difference)


In a fit of optimism, entered the terms Info.plist and preprocess in  
Google and found this:


http://developer.apple.com/technotes/tn2007/tn2175.html
To work around this feature of the C preprocessor, we can pass the - 
traditional flag to the Info.plist Other Preprocessor Flags build  
setting in Xcode. This will cause the preprocessor to use the  
traditional ANSI C /* and */ character strings as tokens to recognize  
and discard text as comments.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How do I include a URL in a preprocessed Info.plist?

2008-12-27 Thread Graham Cox


On 28 Dec 2008, at 6:41 am, Gregory Weston wrote:

In a fit of optimism, entered the terms Info.plist and preprocess in  
Google and found this:


http://developer.apple.com/technotes/tn2007/tn2175.html
To work around this feature of the C preprocessor, we can pass the - 
traditional flag to the Info.plist Other Preprocessor Flags build  
setting in Xcode. This will cause the preprocessor to use the  
traditional ANSI C /* and */ character strings as tokens to  
recognize and discard text as comments.



Ah ;-) The lesson here may be to use Google and not waste time on  
Apple's internal search...


Anyway, that's useful info, at least it explains what I'm seeing. I  
worked around it in a different way in the end - I added a user- 
defined setting for my URL then just used ${MY_URL} in the plist. That  
worked fine - this is similar to Phillipe's suggestion.


Thanks to all who helped,


cheers, Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com