Pergunta

I'd like to know what the complete set of steps is to build a MonoTouch C# app consisting of the main application assembly containing xib files and a set of library assemblies that also possibly contain xib files.

We're trying to automate these steps via a proper MSBuild script (which MonoTouch has yet to support) for various reasons which I won't go into, to focus on the question here.

So far, here's what I've come up with:

1) Compile each assembly using smcs, e.g.

/Developer/MonoTouch/usr/bin/smcs /noconfig 
"/out:/Users/bright/src/MonoTouchAppWithLib/AppLib/bin/Debug/AppLib.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"
/nologo /warn:4 /debug:+ /debug:full /optimize- /codepage:utf8 
"/define:DEBUG"
/t:library "/Users/bright/src/MonoTouchAppWithLib/AppLib/Class1.cs"

2) Compile interface definitions: run ibtool on each xib file in each assembly, e.g

/Developer/usr/bin/ibtool 
--errors --warnings --notices --output-format human-readable-text    
"/Users/bright/src/App/App/ViewController_iPhone.xib" 
--compile "/Users/bright/src/App/App/bin/Debug/App.app/ViewController_iPhone.nib"
--sdk "/Developer/Platforms/iPhoneSimulator.platform/Developer/
SDKs/iPhoneSimulator4.3.sdk"

3) Compile to native code:

/Developer/MonoTouch/usr/bin/mtouch 
-sdkroot "/Applications/Xcode.app/Contents/Developer" 
-v --nomanifest --nosign -sim
"/Users/bright/src/App/App/bin/iPhoneSimulator/Debug/App.app" 
-r "/Users/bright/src/App/AppLib/bin/Debug/AppLib.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" 
-debug -profiling -nolink -sdk "5.0"
"/Users/bright/src/App/App/bin/iPhoneSimulator/Debug/App.exe"

However, it isn't clear how to do the following (taken from MonoDevelop's build output window), and in what order:

1) Extract embedded content. MonoDevelop just outputs this:

Extracted HelloWorldScreen_iPhone.nib from MtLib.dll
Extracted HelloWorldScreen_iPad.nib from MtLib.dll

2) Update application manifest: There's no command line given in the MonoDevelop build output window.

3) Update debug configuration file: There's no command line given in the MonoDevelop build output window.

4) Update debug settings file: There's no command line given in the MonoDevelop build output window.

And other steps I haven't gotten do yet like app signing and resources.

Hopefully we can get enough information here to make a go of it.

Foi útil?

Solução

You can run, from a terminal window or from within an MSBuild task, the /Applications/MonoDevelop.app/Contents/MacOS/mdtool tool that is supplied with MonoDevelop. E.g.

/Applications/MonoDevelop.app/Contents/MacOS/mdtool -v build -t:Build "-c:Debug|iPhoneSimulator" /path/to/your/app.csproj

That will build the MonoTouch application, including all your steps above and any future feature that will be added.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top