static void SetupMono(DriverOptions options, Target target) { string targetPath; switch (target.Platform) { case TargetPlatform.Android: targetPath = Path.Combine(MonodroidDir, "builds"); break; case TargetPlatform.WatchOS: case TargetPlatform.iOS: targetPath = Path.Combine(MaccoreDir, "builds"); break; default: throw new ArgumentOutOfRangeException(); } if (!Directory.Exists(MonoDir)) { MonoDir = Path.GetFullPath(Path.Combine(targetPath, "../../mono")); } var targetBuild = Path.Combine(targetPath, target.Build); if (!Directory.Exists(targetBuild)) { throw new Exception(string.Format("Could not find the target build directory: {0}", targetBuild)); } var includeDirs = new[] { targetBuild, Path.Combine(targetBuild, "eglib", "src"), MonoDir, Path.Combine(MonoDir, "mono"), Path.Combine(MonoDir, "mono", "mini"), Path.Combine(MonoDir, "eglib", "src") }; foreach (var inc in includeDirs) { options.addIncludeDirs(inc); } var filesToParse = new[] { Path.Combine(MonoDir, "mono", "metadata", "metadata-cross-helpers.c"), Path.Combine(MonoDir, "mono", "mini", "mini-cross-helpers.c"), }; foreach (var file in filesToParse) { options.Headers.Add(file); } }
static void ValidateOptions(DriverOptions options) { if (string.IsNullOrWhiteSpace(options.LibraryName)) throw new InvalidOptionException(); if (options.NoGenIncludeDirs != null) foreach (var incDir in options.NoGenIncludeDirs) options.addIncludeDirs(incDir); if (string.IsNullOrWhiteSpace(options.OutputNamespace)) options.OutputNamespace = options.LibraryName; }
static void ValidateOptions(DriverOptions options) { foreach (var module in options.Modules) { if (string.IsNullOrWhiteSpace(module.LibraryName)) throw new InvalidOptionException("One of your modules has no library name."); if (module.OutputNamespace == null) module.OutputNamespace = module.LibraryName; } if (options.NoGenIncludeDirs != null) foreach (var incDir in options.NoGenIncludeDirs) options.addIncludeDirs(incDir); }
static void ValidateOptions(DriverOptions options) { if (string.IsNullOrWhiteSpace(options.LibraryName)) { throw new InvalidOptionException(); } #if OLD_PARSER for (var i = 0; i < options.IncludeDirs.Count; i++) { options.IncludeDirs[i] = Path.GetFullPath(options.IncludeDirs[i]); } for (var i = 0; i < options.LibraryDirs.Count; i++) { options.LibraryDirs[i] = Path.GetFullPath(options.LibraryDirs[i]); } if (options.NoGenIncludeDirs != null) { for (var i = 0; i < options.NoGenIncludeDirs.Count; i++) { options.NoGenIncludeDirs[i] = Path.GetFullPath(options.NoGenIncludeDirs[i]); } } #endif if (options.NoGenIncludeDirs != null) { foreach (var incDir in options.NoGenIncludeDirs) #if OLD_PARSER { options.IncludeDirs.Add(incDir); } } #else { options.addIncludeDirs(incDir); } #endif if (string.IsNullOrWhiteSpace(options.OutputNamespace)) { options.OutputNamespace = options.LibraryName; } }
static void ValidateOptions(DriverOptions options) { if (string.IsNullOrWhiteSpace(options.LibraryName)) { throw new InvalidOptionException(); } if (options.NoGenIncludeDirs != null) { foreach (var incDir in options.NoGenIncludeDirs) { options.addIncludeDirs(incDir); } } if (string.IsNullOrWhiteSpace(options.OutputNamespace)) { options.OutputNamespace = options.LibraryName; } }
static void SetupMono(DriverOptions options, Target target) { string targetPath; switch (target.Platform) { case TargetPlatform.Android: targetPath = Path.Combine (MonodroidDir, XamarinAndroid ? "build-tools/mono-runtimes/obj/Debug" : "builds"); break; case TargetPlatform.WatchOS: case TargetPlatform.iOS: targetPath = Path.Combine (MaccoreDir, "builds"); break; default: throw new ArgumentOutOfRangeException (); } if (!Directory.Exists (MonoDir)) { MonoDir = Path.GetFullPath (Path.Combine (targetPath, "../../mono")); } var targetBuild = Path.Combine(targetPath, target.Build); if (!Directory.Exists(targetBuild)) throw new Exception(string.Format("Could not find the target build directory: {0}", targetBuild)); var includeDirs = new[] { targetBuild, Path.Combine(targetBuild, "eglib", "src"), MonoDir, Path.Combine(MonoDir, "mono"), Path.Combine(MonoDir, "mono", "mini"), Path.Combine(MonoDir, "eglib", "src") }; foreach (var inc in includeDirs) options.addIncludeDirs(inc); var filesToParse = new[] { Path.Combine(MonoDir, "mono", "metadata", "metadata-cross-helpers.c"), Path.Combine(MonoDir, "mono", "mini", "mini-cross-helpers.c"), }; foreach (var file in filesToParse) options.Headers.Add(file); }
static void ValidateOptions(DriverOptions options) { if (string.IsNullOrWhiteSpace(options.LibraryName)) throw new InvalidOptionException(); #if OLD_PARSER for (var i = 0; i < options.IncludeDirs.Count; i++) options.IncludeDirs[i] = Path.GetFullPath(options.IncludeDirs[i]); for (var i = 0; i < options.LibraryDirs.Count; i++) options.LibraryDirs[i] = Path.GetFullPath(options.LibraryDirs[i]); if (options.NoGenIncludeDirs != null) for (var i = 0; i < options.NoGenIncludeDirs.Count; i++) options.NoGenIncludeDirs[i] = Path.GetFullPath(options.NoGenIncludeDirs[i]); #endif if (options.NoGenIncludeDirs != null) foreach (var incDir in options.NoGenIncludeDirs) #if OLD_PARSER options.IncludeDirs.Add(incDir); #else options.addIncludeDirs(incDir); #endif if (string.IsNullOrWhiteSpace(options.OutputNamespace)) options.OutputNamespace = options.LibraryName; }