mail-archives/mono-osx/2006-October/000632.html

160 строки
7.7 KiB
HTML
Исходник Постоянная ссылка Ответственный История

Этот файл содержит невидимые символы Юникода!

Этот файл содержит невидимые символы Юникода, которые могут быть отображены не так, как показано ниже. Если это намеренно, можете спокойно проигнорировать это предупреждение. Используйте кнопку Экранировать, чтобы показать скрытые символы.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-osx] Xcode Plug-in
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-osx%40lists.ximian.com?Subject=%5BMono-osx%5D%20Xcode%20Plug-in&In-Reply-To=1C863C6E-5E77-4A25-995E-FB559E388B00%40macunlimited.net">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="000631.html">
<LINK REL="Next" HREF="000633.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-osx] Xcode Plug-in</H1>
<B>Andreas F&#228;rber</B>
<A HREF="mailto:mono-osx%40lists.ximian.com?Subject=%5BMono-osx%5D%20Xcode%20Plug-in&In-Reply-To=1C863C6E-5E77-4A25-995E-FB559E388B00%40macunlimited.net"
TITLE="[Mono-osx] Xcode Plug-in">andreas.faerber at web.de
</A><BR>
<I>Sun Oct 15 15:34:18 EDT 2006</I>
<P><UL>
<LI>Previous message: <A HREF="000631.html">[Mono-osx] My Project Files Moved &amp; Susan's Xcode Plug-in
</A></li>
<LI>Next message: <A HREF="000633.html">[Mono-osx] Building mono-1.1.18 20061018
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#632">[ date ]</a>
<a href="thread.html#632">[ thread ]</a>
<a href="subject.html#632">[ subject ]</a>
<a href="author.html#632">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Hi,
&gt;<i> I've also been playing with Susan's wonderful Xcode plug-in. Ken
</I>&gt;<i> didn't seem to have much luck with it on his G4 iMac, but I've only
</I>&gt;<i> run in to a few problems on my 12&quot; PB (1GHz G4, 10.4.8, Mono 1.1.18,
</I>&gt;<i> Xcode 2.4).
</I>&gt;<i>
</I>&gt;<i> 1. Compiling the default Hello-World! app results in the following
</I>&gt;<i> error:
</I>&gt;<i> &quot;[Session started at 2006-10-15 16:51:51 +0100.]
</I>&gt;<i>
</I>&gt;<i> Unhandled Exception: System.TypeInitializationException: An exception
</I>&gt;<i> was thrown by the type initializer for System.Console ---&gt;
</I>&gt;<i> System.NullReferenceException: Object reference not set to an
</I>&gt;<i> instance of an object
</I>&gt;<i> at System.TermInfoDriver.Init () [0x00000]
</I>&gt;<i> at System.ConsoleDriver.Init () [0x00000]
</I>&gt;<i> at System.Console..cctor () [0x00000] --- End of inner exception
</I>&gt;<i> stack trace ---
</I>&gt;<i>
</I>&gt;<i> at &lt;0x00000&gt; &lt;unknown method&gt;
</I>&gt;<i> at InstallTest.InstallTest.Main () [0x00000]
</I>&gt;<i> at InstallTest.InstallTest.Main () [0x00000]
</I>&gt;<i> 
</I>&gt;<i> InstallTest has exited with status 1.&quot;
</I>&gt;<i>
</I>&gt;<i> By setting the .NET version flag to V1 in the Build tab of the Target
</I>&gt;<i> Info inspector window I got the expected output:
</I>&gt;<i> &quot;[Session started at 2006-10-15 16:54:05 +0100.]
</I>&gt;<i> Goodbye, Forever!
</I>&gt;<i>
</I>&gt;<i> InstallTest has exited with status 0.&quot;
</I>&gt;<i>
</I>&gt;<i> What is interesting though is that if you run the V2 compiled program
</I>&gt;<i> from Terminal (or WidgetTerm) it works perfectly. After some poking
</I>&gt;<i> around in the project file, plug-in code and various templates I
</I>&gt;<i> can't see what's going wrong. Could it be a bug in GMCS/Mono on PPC
</I>&gt;<i> or in Xcode on PPC with regards to Xcode's Pseudo Terminal?
</I>
The release notes of Mono 1.1.18 mention some bugs related to Console
2.0 redirection were fixed. Maybe you tested this on an earlier
release or there are some more left - could be something else though...
&gt;<i> Frankly I'm really impressed with the work Susan has put into this
</I>&gt;<i> plug-in as it does seem to work reasonably well most of the time.
</I>&gt;<i> When I get my new Macbook Pro (sometime in the next week) I'll try
</I>&gt;<i> comparing Intel/PPC in the (probably vain) hope that it might
</I>&gt;<i> illuminate some of the odd behaviour on PPC. I spent most of the
</I>&gt;<i> summer working in Objective-C and Cocoa, though I would not claim to
</I>&gt;<i> be any kind of expert, so I should be able to track down at least
</I>&gt;<i> some of the bugs. Of course my doing this shouldn't stop the more
</I>&gt;<i> experienced programmers out there from having a go.
</I>
I've been working towards the same goal of an Xcode plug-in, but
using a different approach:
I've found out that you can specify an Objective-C class derived from
PBXLSPlugin as NSPrincipalClass (where LS might or might not stand
for launch system) and override its &quot;+(void)pluginDidLoad:(NSBundle*)
bundle&quot; class method (there are no public header files for this
class, so I've simply declared the interface with only the relevant
method in my code before I use it). In the pluginDidLoad: method one
can embed the Mono runtime and load or execute an assembly included
in the bundle before all the .*spec files are read. Then in the
managed code (e.g. Main method for executable) one can register the
classes specified in the .*spec files, with the code being in C# (or
whatever you prefer).
I'm happily using my managed plugin on PowerPC, and we're in the
process of resolving the remaining obstacles for embedding to work on
Intel as well (Robert just published a patch on Mono-list). That way
development is not limited to those too knowledgeable about Objective-
C and Cocoa libraries and the complete Mono library can be used, for
example System.Text.RegularExpressions for output parsing.
I haven't tested Susan's plug-in yet, but mine is based around the
core arguments of [g]mcs that I needed the most, allowing executable
and library assemblies as product, multiple source files as compiler
input and referenced libraries as linker input. I'd like to support
multiple programming languages, so I'll be looking into using al as
alternative linker to [g]mcs - someone on Mono-list once mentioned
Visual Studio compiling that way - but I haven't tested what happens
to assembly-level attributes using that approach.
Me, too, I've been unable to make executing Executables work in
Xcode, which probably is related to all examples and unofficial docs
being targetted at native-compiling languages - Java appears to be
implemented using some differing way, possibly hardcoded into Xcode
itself: The &quot;built-in&quot; .*spec files, that I have otherwise found very
helpful, have not specified javac, jar etc. and for Java applications
there's a key IsJava=YES, which is not too helpful for Mono... ;-)
As a side note for anyone interested, an alternative way for
embedding Mono within a loadable bundle is to write a native library
and within the library's initialization routine spawn a pthread that
does the embedding as soon as the initialization is finished. Only
the timing can be problematic as the regular bundle processing by its
host's thread will continue in parallel (in the case of Xcode: .*spec
file reading and checking for existence of the specified classes),
but it's a nice way to look around what &quot;secret&quot; Objective-C classes
and methods are around!
Andreas
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="000631.html">[Mono-osx] My Project Files Moved &amp; Susan's Xcode Plug-in
</A></li>
<LI>Next message: <A HREF="000633.html">[Mono-osx] Building mono-1.1.18 20061018
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#632">[ date ]</a>
<a href="thread.html#632">[ thread ]</a>
<a href="subject.html#632">[ subject ]</a>
<a href="author.html#632">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-osx">More information about the Mono-osx
mailing list</a><br>
</body></html>