Hi,

> > I've made a port of log4net to MonoDroid (Mono for Android).
> 
> This really looks interesting.  Can you tell us a little bit about it - I 
> must admit I'm a total ignorant when it comes to MonoDroid.
> 
> Have you faced any major problems you had to work around?  I see you made 
> ndoc work, that's more than I manage ATM.

There are no special work arounds in src.
The most challenging was to port unit tests.  Main work arounds in tests/src 
are:
 * to mimic NUnit interface using NUnit (see tests/srsc/Assert.cs);
 * RollingFileAppenderTest heavily depends on reading/writing files in working 
folder (=installation folder) which is not writable under Android.  I set/reset 
working folder in SetUp/TearDown methods.

> >  * open solution in Visual Studio (note: NAnt doesn't support Mono for  
> > Android framework)
> 
> So we cannot build the distribution using the official build system.  Do you 
> (or anybody on the list, I look at you Ryan ;-) have any suggestions?

It is possible to build with 'msbuild' tool.  I didn't check if nant has 
dedicated task but I think nant has a task to run any shell command.  This way 
it should be possible to build log4net for MonoDroid together with other 
distributions.
However, unit tests need device or emulator so I doubt if they can be run 
unattended by CI system.  I haven't tried to do it this way so I could be wrong.

> > I donate this patch to public.
> 
> This is great.  If we want to include it in log4net we'll need a version of 
> your patch with the "grant license to ASF" checkbox set.

As I remember I checked it out.  Could You verify this?

> How can we avoid breaking MonoDroid compatibility with future changes?
> These don't happen too frequently but they do.  Is it good enough to compile 
> using VS (which I can't, right now) and running the tests?
> Would this pick up all problems that you found and fixed with the original 
> codebase?

If You mean breaking API changes then it should be enough to build it.  I even 
tried to build it using MonoDevelop.  Just open log4net.monodroid.vs2010.sln in 
it and it works.
MonoDevelop and plugin for Android is included in installer from Xamarin.

I encountered at least one problem that MonoDroid throws 
NotImplementedException (method exists, see SystemInfo.cs).  Mayby there are 
more such places.  It seems quite likely when You analyze build warnings.
It would be much easier to find all such places if log4net was covered even 
more by unit tests.

Of course I didn't try all possible configurations (appenders, etc.) but the 
port worked well in my application.

Greetings
WD

Reply via email to