[MonoTouch] Please advise wrt two apps with same source files
Guido Van Hoecke
guivho at gmail.com
Mon Oct 24 14:14:39 EDT 2011
Robert,
This sounds very good.
I'm going to try this setup and I'll report back.
Guido
On Mon, Oct 24, 2011 at 19:01, Robert Jordan <robertj at gmx.net> wrote:
> Hi,
>
> Starting with MD 2.8, the application ID and other iOS application
> settings are only stored in Info.plist.
>
> Changing the application ID (and maybe the app name at
> your choice) in this file is enough to create a lite (or pro)
> version of your app, because your app can query the application
> ID[1] and branch accordingly at run-time.
>
> When I'm about to build the lite version, I'm temporarily
> overwriting Info.plist with InfoLite.plist and I'm done.
> (It's actually scripted, but it really doesn't matter).
>
>
> With MD 2.4/MT 3, I had this layout:
>
> Project/
> Project/AppName.sln
> Project/AppNameLite.sln
> Project/AppName/AppName.csproj
> Project/AppName/AppNameLite.csproj
>
> AppNameLite.sln was a copy of AppName.sln in which the
> string AppName.csproj was replaced with AppNameLite.csproj.
>
> AppNameLite.csproj was a copy AppName.csproj with
> a different <BundleIdentifier> element.
>
> Whenever AppName.csproj has been changed, I've merged the
> changes into AppNameLite.csproj using the merge facility of
> my version control system.
>
> Robert
>
> [1]
> string appId = (string) NSBundle.MainBundle.
> InfoDictionary[new NSString("CFBundleIdentifier")];
>
>
> On 24.10.2011 18:09, Guido Van Hoecke wrote:
>> Hi Michael,
>>
>> I did not try it for the data files, but my experience with hard links for the
>> shared sources wasn't that good. Whenever a source get's rewritten, a new file
>> is created, breaking the hardlink and ending up with two separate non-linked and
>> out-of-sync files.
>>
>> Guido.
>>
>> On Mon, Oct 24, 2011 at 17:15, Michael S. Muegel<mike at muegel.org> wrote:
>>> iOS is not my day job so I won't be able to look @ this until later in the
>>> evening. You mentioned linking directories. Did you try a "hard link"
>>> between directories? "ln source alias" I can't see how MonoDevelop would
>>> know that these are different. Not sure how this would impact source code
>>> management, however.
>>>
>>> -Mike
>>>
>>> On Mon, Oct 24, 2011 at 9:44 AM, Guido Van Hoecke<guivho at gmail.com> wrote:
>>>> The symlink approach does not work. Monodevelop does not allow to assign
>>>> icons
>>>> if they are included in the project as symlinks. So I duplicated the image
>>>> and
>>>> data dirs in the two app project dirs. However the apps still don't build.
>>>>
>>>> Anyone?
>>>>
>>>> TIA, Guido
>>>>
>>>> On Mon, Oct 24, 2011 at 14:15, Guido Van Hoecke<guivho at gmail.com> wrote:
>>>>> Gents,
>>>>>
>>>>> (Same message, minor corrections)
>>>>>
>>>>> Using your fine ideas (thanx) I now
>>>>> - created a Library project within the Solution,
>>>>> - referenced it from both apps
>>>>> - moved all common sources to the Library project
>>>>> - moved common images and app data directories to the Library project
>>>>> - symlinked to these directories from the app project directories
>>>>> - included these (symlink) data and image directories and files in the
>>>>> projects
>>>>> - set the build action for these image and data files to nothing in
>>>>> the Library project
>>>>> - set it to content in the app projects
>>>>>
>>>>> Ready to build:
>>>>>
>>>>> - library project compiles without probs
>>>>> - the app projects main compilation: build complete: -- 0 errors, 0
>>>>> warnings
>>>>> - compiling to native code fails for both apps with:
>>>>> - "Error: root assembly does not exist
>>>>> /Users/guivho/solution/App1/bin/$(Target)/$(Configuration)/App1.exe"
>>>>> or
>>>>> /Users/guivho/solution/App2/bin/$(Target)/$(Configuration)/App2.exe"
>>>>>
>>>>> Any idea why mtouch fails? This is the build output (using -v -v -v)
>>>>> (target iPhone/release, App1):
>>>>>
>>>>> /Developer/MonoTouch/usr/bin/mtouch -v --nomanifest --nosign
>>>>> -dev "/Users/guivho/Mono/Solution/App1/bin/$(Target)/Release/App1.app"
>>>>> -r "/Users/guivho/Mono/Solution/Library/bin/Release/Library.dll"
>>>>> -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll"
>>>>> -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll"
>>>>> -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll"
>>>>> -r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll"
>>>>> -linksdkonly
>>>>> -sdk "4.3"
>>>>> -targetver "3.0"
>>>>> -v -v -v -gcc_flags "-framework MediaPlayer -framework AudioToolbox
>>>>> -framework CoreGraphics
>>>>> -framework QuartzCore -framework MessageUI -framework SystemConfiguration
>>>>> -L/Users/guivho/Mono/Solution/App1
>>>>> -lGoogleAdMobAds
>>>>> -force_load /Users/guivho/Mono/Solution/App1/libGoogleAdMobAds.a"
>>>>> "/Users/guivho/Mono/Solution/App1/bin/$(Target)/Release/App1.exe"
>>>>>
>>>>> Framework is:
>>>>> /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk
>>>>>
>>>>> Error: root assembly does not exist
>>>>> /Users/guivho/Mono/solution/App1/bin/iPhone/Release/App1.exe
>>>>>
>>>>> mtouch exited with code 1
>>>>>
>>>>> I get the same error for both the iPhone and iPhoneSimulator target and
>>>>> Debug,
>>>>> Release, Distribution configurations.
>>>>>
>>>>> Any ideas or suggestions? I'd like to stick to this setup, but it's
>>>>> got to work off course...
>>>>>
>>>>> TIA, Guido.
>>>>>
>>>>> On Mon, Oct 24, 2011 at 09:40, David Black<David.Black at casewise.com>
>>>>> wrote:
>>>>>>
>>>>>> Hi Michael
>>>>>>
>>>>>> It's also worth noting that the required bootstrap files include
>>>>>> Appstore images (logo_XX, Default-XXX.png etc)
>>>>>> Localization files (en.lproj, fr.lproj etc)
>>>>>> Any images / content files that you load that are loaded from
>>>>>> file not from resource
>>>>>>
>>>>>> D
>>>>>>
>>>>>> I raised an enhancment request a while ago to ask that content files in
>>>>>> assemblies marked as copy alwas be added to the output bundle. This would
>>>>>> help..
>>>>>>
>>>>>>
>>>>>> David Black
>>>>>> Technical Manager (Web projects)
>>>>>> Casewise Systems Ltd | www.casewise.com
>>>>>> +44 1923 830300 office
>>>>>> +44 1923 830270 direct
>>>>>> 64 Clarendon Road, Watford WD17 1DA
>>>>>>
>>>>>> "When You Can See More, You Can Do More!"
>>>>>>
>>>>>>
>>>>>>
>>>>>> -----Original Message-----
>>>>>> From: monotouch-bounces at lists.ximian.com
>>>>>> [mailto:monotouch-bounces at lists.ximian.com] On Behalf Of Guido Van Hoecke
>>>>>> Sent: 24 October 2011 08:07
>>>>>> To: Michael Muegel
>>>>>> Cc: monotouch at lists.ximian.com
>>>>>> Subject: Re: [MonoTouch] Please advise wrt two apps with same source
>>>>>> files
>>>>>>
>>>>>> Hi Michael,
>>>>>>
>>>>>> On Sun, Oct 23, 2011 at 23:14, Michael Muegel<mike.muegel at gmail.com>
>>>>>> wrote:
>>>>>>> In situations like this for Windows development I have created an
>>>>>>> application library. You would have two MonoTouch app projects that
>>>>>>> reference this library, which in turn reference all your other support
>>>>>>> libraries. Each app project just has a few files to bootstrap things
>>>>>>> and
>>>>>>> invoke the common app library with a flag for the mode/etc.
>>>>>>
>>>>>> That seems a very interesting approach!
>>>>>>
>>>>>> Currently I have two separate projects within one solution, and both
>>>>>> projects
>>>>>> have a 'Common' subdirectory with all common sources. I use a little
>>>>>> perl script
>>>>>> to synchronize the sources. But I'll now move these common sources to a
>>>>>> new
>>>>>> library project within this solution and go for your approach.
>>>>>> Definitely
>>>>>> cleaner!
>>>>>>
>>>>>> Thanx for the idea.
>>>>>>
>>>>>>
>>>>>> Guido
>>>>>>
>>>>>> --
>>>>>> When does summertime come to Minnesota, you ask?
>>>>>> Well, last year, I think it was a Tuesday.
>>>>>> _______________________________________________
>>>>>> MonoTouch mailing list
>>>>>> MonoTouch at lists.ximian.com
>>>>>> http://lists.ximian.com/mailman/listinfo/monotouch
>>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Michael S. Muegel
>>> 972-413-6378
>>>
>>>
>> _______________________________________________
>> MonoTouch mailing list
>> MonoTouch at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/monotouch
>>
>
> _______________________________________________
> MonoTouch mailing list
> MonoTouch at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>
More information about the MonoTouch
mailing list