senojsitruc / wsdl2objc

Automatically exported from code.google.com/p/wsdl2objc
MIT License
0 stars 0 forks source link

wsdl2objc command line doesn't work "in-place" #133

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. compile wsdl2objc target from xcodeproject
2. launch wsdl2objc from the build dir specifying the existing Templates 
directory

What is the expected output?
all templates should be expanded an copied to <outPath>

What do you see instead?
templates within subdirectories of Templates/ (e.g. Templates/NSDate_ISO8601/*) 
are not expanded nor copied

What version of the product are you using? On what operating system?
r186

Please provide any additional information below.
moving the templates out of the subdirectory (like USGlobals_H.template) fixes 
the issue

Original issue reported on code.google.com by stephan.diederich@gmail.com on 1 Mar 2011 at 5:15

GoogleCodeExporter commented 9 years ago
I confirm. The code in NSBundle+USAdditions.m essentially says the following:
- if the template directory is specified, assume it's correct (non recursive)
- if not specified, then find the file anywhere in the app support directories 
(recursive)

That's why when you specify the templates dir, the app doesn't look recursively 
in it.

Original comment by hasse...@gmail.com on 1 Mar 2011 at 9:13

GoogleCodeExporter commented 9 years ago
okey, that makes sense. Probably I should present a use case ;)

I've included wsdl2objc in my Xcode project/workspace and want to run in during 
the build/test-phase. 
The idea is to fetch the wsdl, generate the classes and finally run the 
unit-tests. 
Installing wsdl2objc to some dir, or installing the templates somewhere isn't 
that appealing. 

Any ideas on this?

Thanks for sharing wsdl2objc,
stephan

p.s.: just checked - (NSString *)pathForTemplateNamed:(NSString *)templateName 
and it looks to me this doesn't work recursive, but just checks in all the 
app-support directories. 
Besides that, the app bundle seems to have all the templates in a flat 
directory, too.

Original comment by stephan.diederich@gmail.com on 1 Mar 2011 at 9:25

GoogleCodeExporter commented 9 years ago
I'm not saying I agree with the way it's done, as I'm neither the original 
developer of the wsdl2objc code, nor am I the developer of the templating 
system that whose code we're talking about (it's a company called LightSPEED 
Technologies, Inc, from the headers).

I stand corrected regarding pathForTemplateNamed:.  As I said, it first checks 
all the app-support dirs, but then if it doesn't find the template, it looks 
NON-recursively in the app bundle to find the template (pathForResource:ofType: 
doesn't recurse). So in all cases there is no recursion.

So if we were to want to recursively look in all cases, it'd be a real bitch. 
What we could instead do is specifically allow recursion when a template dir is 
specified, hoping the user doesn't set templateDirectory="/" or something 
idiotic like that.

Original comment by hasse...@gmail.com on 2 Mar 2011 at 8:13

GoogleCodeExporter commented 9 years ago
Thanks for clarifying!

Do you have an idea if moving the templates from the subdirectories in 
Templates(/*/) to Templates/ is a bad idea? Seems to work for me...

Original comment by stephan.diederich@gmail.com on 2 Mar 2011 at 3:03

GoogleCodeExporter commented 9 years ago
I don't think it matters.

Original comment by hasse...@gmail.com on 2 Mar 2011 at 4:16