and of course i forgot the attachment. here it is. --anthony
On Tue, Sep 21, 2010 at 1:41 PM, anthony taranto <anthony.tara...@gmail.com> wrote: > Hello, > > We're distributing an OS X application using Monobjc's <mkbundle> and > <mkappl> tasks. The <mkbundle> task embeds the .dll files that our app > depends on. We would like to selectively blacklist certain .dlls from > this process due to LGPL/licensing reasons. In other words, I want to > embed one set of dlls, and load another set of dlls at runtime from > standalone .dll files in our app bundle. I'd like to know the best way > to achieve this. > > I've attempted to add a <without-assemblies/> sub task to the > NAnt.Monobjc.dll, which would let me blacklist one or more dlls (patch > attached). This seems to work, but even after copying the non-embedded > dll files into My.App/Contents/MacOS, they still can't be loaded at > runtime. Instead I see the following message: > > ** (MyApp.exe:12143): WARNING **: The following assembly referenced > from My.Embedded.dll could not be loaded: > Assembly: My.NonEmbedded (assemblyref_index=6) > Version: 1.0.0 > Public Key: xxxxxxxxxxxxxxx > The assembly was not found in the Global Assembly Cache, a path > listed in the MONO_PATH environment variable, or in the location of > the executing assembly (//). > > So, what's the correct way to distribute a standalone Mac application > that bundles and references LGPL assemblies? > > --Anthony >
Only in Monobjc-2.0.505.0.orig: dist diff -ur Monobjc-2.0.505.0.orig/src/tools/NAnt.MonobjcTasks/Tasks/MakeBundleTask.Generation.cs Monobjc-2.0.505.0/src/tools/NAnt.MonobjcTasks/Tasks/MakeBundleTask.Generation.cs --- Monobjc-2.0.505.0.orig/src/tools/NAnt.MonobjcTasks/Tasks/MakeBundleTask.Generation.cs 2010-06-07 01:05:38.000000000 -0700 +++ Monobjc-2.0.505.0/src/tools/NAnt.MonobjcTasks/Tasks/MakeBundleTask.Generation.cs 2010-09-21 12:54:12.000000000 -0700 @@ -22,6 +22,7 @@ using System.Xml; using System.Xml.Xsl; using NAnt.Core; +using NAnt.Core.Types; using NAnt.Monobjc.Properties; namespace NAnt.Monobjc.Tasks @@ -56,6 +57,12 @@ List<String> bundleNames = new List<String>(); Dictionary<String, String> configNames = new Dictionary<String, String>(); + Dictionary<String, object> excludedAssemblies = new Dictionary<String, object>(); + + foreach (Argument argument in this.ExcludedAssemblies) + { + excludedAssemblies[argument.File.ToString()] = null; + } using (StreamWriter sourceWriter = new StreamWriter(File.Create(sourceFile))) { @@ -85,6 +92,12 @@ program = absoluteName; } + if (excludedAssemblies.ContainsKey(fileName)) + { + this.Log(Level.Info, "\t\tSkipping Assembly '{0}'", fileName); + continue; + } + if (this.UseCache) { this.Log(Level.Info, "\t\tEmbedding Assembly '{0}'", fileName); @@ -361,4 +374,4 @@ } } } -} \ No newline at end of file +} diff -ur Monobjc-2.0.505.0.orig/src/tools/NAnt.MonobjcTasks/Tasks/MakeBundleTask.cs Monobjc-2.0.505.0/src/tools/NAnt.MonobjcTasks/Tasks/MakeBundleTask.cs --- Monobjc-2.0.505.0.orig/src/tools/NAnt.MonobjcTasks/Tasks/MakeBundleTask.cs 2010-02-15 14:35:44.000000000 -0800 +++ Monobjc-2.0.505.0/src/tools/NAnt.MonobjcTasks/Tasks/MakeBundleTask.cs 2010-09-21 11:34:51.000000000 -0700 @@ -115,6 +115,13 @@ public Argument[] AdditionalAssemblies { get; set; } /// <summary> + /// Gets or sets the assemblies that will not be embedded. + /// </summary> + /// <value>The assemblies that will not be embedded.</value> + [BuildElementArray("without-assembly")] + public Argument[] ExcludedAssemblies { get; set; } + + /// <summary> /// Gets or sets the additional libraries. /// </summary> /// <value>The additional libraries.</value> @@ -146,6 +153,15 @@ } } + // Check excluded assemblies + foreach (Argument arg in this.ExcludedAssemblies) + { + if (arg.File == null) + { + throw new BuildException("Missing 'file' attribute on <without-assembly/> sub-task"); + } + } + // Check additionnal libraries foreach (Argument arg in this.AdditionalLibraries) { @@ -207,4 +223,4 @@ this.executableFile = Path.Combine(this.ToDirectory.ToString(), baseName); } } -} \ No newline at end of file +}