packages.cake 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. public class Packages
  2. {
  3. public List<NuGetPackSettings> NuspecNuGetSettings { get; private set; }
  4. public FilePath[] NugetPackages { get; private set; }
  5. public FilePath[] BinFiles { get; private set; }
  6. public Packages(ICakeContext context, Parameters parameters)
  7. {
  8. // NUGET NUSPECS
  9. context.Information("Getting git modules:");
  10. var ignoredSubModulesPaths = System.IO.File.ReadAllLines(".git/config").Where(m=>m.StartsWith("[submodule ")).Select(m =>
  11. {
  12. var path = m.Split(' ')[1].Trim("\"[] \t".ToArray());
  13. context.Information(path);
  14. return ((DirectoryPath)context.Directory(path)).FullPath;
  15. }).ToList();
  16. var normalizePath = new Func<string, string>(
  17. path => path.Replace(System.IO.Path.DirectorySeparatorChar, System.IO.Path.AltDirectorySeparatorChar).ToUpperInvariant());
  18. // Key: Package Id
  19. // Value is Tuple where Item1: Package Version, Item2: The packages.config file path.
  20. var packageVersions = new Dictionary<string, IList<Tuple<string,string>>>();
  21. System.IO.Directory.EnumerateFiles(((DirectoryPath)context.Directory("./src")).FullPath, "packages.config", SearchOption.AllDirectories).ToList().ForEach(fileName =>
  22. {
  23. if (!ignoredSubModulesPaths.Any(i => normalizePath(fileName).Contains(normalizePath(i))))
  24. {
  25. var file = new PackageReferenceFile(fileName);
  26. foreach (PackageReference packageReference in file.GetPackageReferences())
  27. {
  28. IList<Tuple<string, string>> versions;
  29. packageVersions.TryGetValue(packageReference.Id, out versions);
  30. if (versions == null)
  31. {
  32. versions = new List<Tuple<string, string>>();
  33. packageVersions[packageReference.Id] = versions;
  34. }
  35. versions.Add(Tuple.Create(packageReference.Version.ToString(), fileName));
  36. }
  37. }
  38. });
  39. context.Information("Checking installed NuGet package dependencies versions:");
  40. packageVersions.ToList().ForEach(package =>
  41. {
  42. var packageVersion = package.Value.First().Item1;
  43. bool isValidVersion = package.Value.All(x => x.Item1 == packageVersion);
  44. if (!isValidVersion)
  45. {
  46. context.Information("Error: package {0} has multiple versions installed:", package.Key);
  47. foreach (var v in package.Value)
  48. {
  49. context.Information("{0}, file: {1}", v.Item1, v.Item2);
  50. }
  51. throw new Exception("Detected multiple NuGet package version installed for different projects.");
  52. }
  53. });
  54. context.Information("Setting NuGet package dependencies versions:");
  55. var SerilogVersion = packageVersions["Serilog"].FirstOrDefault().Item1;
  56. var SplatVersion = packageVersions["Splat"].FirstOrDefault().Item1;
  57. var SpracheVersion = packageVersions["Sprache"].FirstOrDefault().Item1;
  58. var SystemReactiveVersion = packageVersions["System.Reactive"].FirstOrDefault().Item1;
  59. var SkiaSharpVersion = packageVersions["SkiaSharp"].FirstOrDefault().Item1;
  60. var SharpDXVersion = packageVersions["SharpDX"].FirstOrDefault().Item1;
  61. var SharpDXDirect2D1Version = packageVersions["SharpDX.Direct2D1"].FirstOrDefault().Item1;
  62. var SharpDXDirect3D11Version = packageVersions["SharpDX.Direct3D11"].FirstOrDefault().Item1;
  63. var SharpDXDXGIVersion = packageVersions["SharpDX.DXGI"].FirstOrDefault().Item1;
  64. context.Information("Package: Serilog, version: {0}", SerilogVersion);
  65. context.Information("Package: Splat, version: {0}", SplatVersion);
  66. context.Information("Package: Sprache, version: {0}", SpracheVersion);
  67. context.Information("Package: System.Reactive, version: {0}", SystemReactiveVersion);
  68. context.Information("Package: SkiaSharp, version: {0}", SkiaSharpVersion);
  69. context.Information("Package: SharpDX, version: {0}", SharpDXVersion);
  70. context.Information("Package: SharpDX.Direct2D1, version: {0}", SharpDXDirect2D1Version);
  71. context.Information("Package: SharpDX.Direct3D11, version: {0}", SharpDXDirect3D11Version);
  72. context.Information("Package: SharpDX.DXGI, version: {0}", SharpDXDXGIVersion);
  73. var SetNuGetNuspecCommonProperties = new Action<NuGetPackSettings> ((nuspec) => {
  74. nuspec.Version = parameters.Version;
  75. nuspec.Authors = new [] { "Avalonia Team" };
  76. nuspec.Owners = new [] { "stevenk" };
  77. nuspec.LicenseUrl = new Uri("http://opensource.org/licenses/MIT");
  78. nuspec.ProjectUrl = new Uri("https://github.com/AvaloniaUI/Avalonia/");
  79. nuspec.RequireLicenseAcceptance = false;
  80. nuspec.Symbols = false;
  81. nuspec.NoPackageAnalysis = true;
  82. nuspec.Description = "The Avalonia UI framework";
  83. nuspec.Copyright = "Copyright 2015";
  84. nuspec.Tags = new [] { "Avalonia" };
  85. });
  86. var coreLibraries = new string[][]
  87. {
  88. new [] { "./src/", "Avalonia.Animation", ".dll" },
  89. new [] { "./src/", "Avalonia.Animation", ".xml" },
  90. new [] { "./src/", "Avalonia.Base", ".dll" },
  91. new [] { "./src/", "Avalonia.Base", ".xml" },
  92. new [] { "./src/", "Avalonia.Controls", ".dll" },
  93. new [] { "./src/", "Avalonia.Controls", ".xml" },
  94. new [] { "./src/", "Avalonia.DesignerSupport", ".dll" },
  95. new [] { "./src/", "Avalonia.DesignerSupport", ".xml" },
  96. new [] { "./src/", "Avalonia.Diagnostics", ".dll" },
  97. new [] { "./src/", "Avalonia.Diagnostics", ".xml" },
  98. new [] { "./src/", "Avalonia.Input", ".dll" },
  99. new [] { "./src/", "Avalonia.Input", ".xml" },
  100. new [] { "./src/", "Avalonia.Interactivity", ".dll" },
  101. new [] { "./src/", "Avalonia.Interactivity", ".xml" },
  102. new [] { "./src/", "Avalonia.Layout", ".dll" },
  103. new [] { "./src/", "Avalonia.Layout", ".xml" },
  104. new [] { "./src/", "Avalonia.Logging.Serilog", ".dll" },
  105. new [] { "./src/", "Avalonia.Logging.Serilog", ".xml" },
  106. new [] { "./src/", "Avalonia.Visuals", ".dll" },
  107. new [] { "./src/", "Avalonia.Visuals", ".xml" },
  108. new [] { "./src/", "Avalonia.Styling", ".dll" },
  109. new [] { "./src/", "Avalonia.Styling", ".xml" },
  110. new [] { "./src/", "Avalonia.ReactiveUI", ".dll" },
  111. new [] { "./src/", "Avalonia.Themes.Default", ".dll" },
  112. new [] { "./src/", "Avalonia.Themes.Default", ".xml" },
  113. new [] { "./src/Markup/", "Avalonia.Markup", ".dll" },
  114. new [] { "./src/Markup/", "Avalonia.Markup", ".xml" },
  115. new [] { "./src/Markup/", "Avalonia.Markup.Xaml", ".dll" },
  116. new [] { "./src/Markup/", "Avalonia.Markup.Xaml", ".xml" }
  117. };
  118. var coreLibrariesFiles = coreLibraries.Select((lib) => {
  119. return (FilePath)context.File(lib[0] + lib[1] + "/bin/" + parameters.DirSuffix + "/" + lib[1] + lib[2]);
  120. }).ToList();
  121. var coreLibrariesNuSpecContent = coreLibrariesFiles.Select((file) => {
  122. return new NuSpecContent {
  123. Source = file.FullPath, Target = "lib/portable-windows8+net45"
  124. };
  125. });
  126. var win32CoreLibrariesNuSpecContent = coreLibrariesFiles.Select((file) => {
  127. return new NuSpecContent {
  128. Source = file.FullPath, Target = "lib/net45"
  129. };
  130. });
  131. var netcoreappCoreLibrariesNuSpecContent = coreLibrariesFiles.Select((file) => {
  132. return new NuSpecContent {
  133. Source = file.FullPath, Target = "lib/netcoreapp1.0"
  134. };
  135. });
  136. var net45RuntimePlatformExtensions = new [] {".xml", ".dll"};
  137. var net45RuntimePlatform = net45RuntimePlatformExtensions.Select(libSuffix => {
  138. return new NuSpecContent {
  139. Source = ((FilePath)context.File("./src/Avalonia.DotNetFrameworkRuntime/bin/" + parameters.DirSuffix + "/Avalonia.DotNetFrameworkRuntime" + libSuffix)).FullPath,
  140. Target = "lib/net45"
  141. };
  142. });
  143. var netCoreRuntimePlatformExtensions = new [] {".xml", ".dll"};
  144. var netCoreRuntimePlatform = netCoreRuntimePlatformExtensions.Select(libSuffix => {
  145. return new NuSpecContent {
  146. Source = ((FilePath)context.File("./src/Avalonia.DotNetCoreRuntime/bin/" + parameters.DirSuffix + "/Avalonia.DotNetCoreRuntime" + libSuffix)).FullPath,
  147. Target = "lib/netcoreapp1.0"
  148. };
  149. });
  150. var nuspecNuGetSettingsCore = new []
  151. {
  152. ///////////////////////////////////////////////////////////////////////////////
  153. // Avalonia
  154. ///////////////////////////////////////////////////////////////////////////////
  155. new NuGetPackSettings()
  156. {
  157. Id = "Avalonia",
  158. Dependencies = new []
  159. {
  160. new NuSpecDependency() { Id = "Serilog", Version = SerilogVersion },
  161. new NuSpecDependency() { Id = "Splat", Version = SplatVersion },
  162. new NuSpecDependency() { Id = "Sprache", Version = SpracheVersion },
  163. new NuSpecDependency() { Id = "System.Reactive", Version = SystemReactiveVersion },
  164. new NuSpecDependency() { Id = "System.Threading.ThreadPool", TargetFramework = "netcoreapp1.0", Version = "4.3.0" },
  165. //.NET Core
  166. new NuSpecDependency() { Id = "NETStandard.Library", TargetFramework = "netcoreapp1.0", Version = "1.6.0" },
  167. new NuSpecDependency() { Id = "Microsoft.NETCore.Portable.Compatibility", TargetFramework = "netcoreapp1.0", Version = "1.0.1" },
  168. new NuSpecDependency() { Id = "Splat", TargetFramework = "netcoreapp1.0", Version = "2.0.0" },
  169. new NuSpecDependency() { Id = "Serilog", TargetFramework = "netcoreapp1.0", Version = "2.3.0" },
  170. new NuSpecDependency() { Id = "Sprache", TargetFramework = "netcoreapp1.0", Version = SpracheVersion },
  171. new NuSpecDependency() { Id = "System.Reactive", TargetFramework = "netcoreapp1.0", Version = SystemReactiveVersion }
  172. },
  173. Files = coreLibrariesNuSpecContent
  174. .Concat(win32CoreLibrariesNuSpecContent).Concat(net45RuntimePlatform)
  175. .Concat(netcoreappCoreLibrariesNuSpecContent).Concat(netCoreRuntimePlatform)
  176. .ToList(),
  177. BasePath = context.Directory("./"),
  178. OutputDirectory = parameters.NugetRoot
  179. },
  180. ///////////////////////////////////////////////////////////////////////////////
  181. // Avalonia.HtmlRenderer
  182. ///////////////////////////////////////////////////////////////////////////////
  183. new NuGetPackSettings()
  184. {
  185. Id = "Avalonia.HtmlRenderer",
  186. Dependencies = new []
  187. {
  188. new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version }
  189. },
  190. Files = new []
  191. {
  192. new NuSpecContent { Source = "Avalonia.HtmlRenderer.dll", Target = "lib/portable-windows8+net45" }
  193. },
  194. BasePath = context.Directory("./src/Avalonia.HtmlRenderer/bin/" + parameters.DirSuffix),
  195. OutputDirectory = parameters.NugetRoot
  196. }
  197. };
  198. var nuspecNuGetSettingsMobile = new []
  199. {
  200. ///////////////////////////////////////////////////////////////////////////////
  201. // Avalonia.Android
  202. ///////////////////////////////////////////////////////////////////////////////
  203. new NuGetPackSettings()
  204. {
  205. Id = "Avalonia.Android",
  206. Dependencies = new []
  207. {
  208. new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version },
  209. new NuSpecDependency() { Id = "Avalonia.Skia.Android", Version = parameters.Version }
  210. },
  211. Files = new []
  212. {
  213. new NuSpecContent { Source = "Avalonia.Android.dll", Target = "lib/MonoAndroid10" }
  214. },
  215. BasePath = context.Directory("./src/Android/Avalonia.Android/bin/" + parameters.DirSuffix),
  216. OutputDirectory = parameters.NugetRoot
  217. },
  218. ///////////////////////////////////////////////////////////////////////////////
  219. // Avalonia.Skia.Android
  220. ///////////////////////////////////////////////////////////////////////////////
  221. new NuGetPackSettings()
  222. {
  223. Id = "Avalonia.Skia.Android",
  224. Dependencies = new []
  225. {
  226. new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version },
  227. new NuSpecDependency() { Id = "SkiaSharp", Version = SkiaSharpVersion }
  228. },
  229. Files = new []
  230. {
  231. new NuSpecContent { Source = "Avalonia.Skia.Android.dll", Target = "lib/MonoAndroid10" }
  232. },
  233. BasePath = context.Directory("./src/Skia/Avalonia.Skia.Android/bin/" + parameters.DirSuffix),
  234. OutputDirectory = parameters.NugetRoot
  235. },
  236. ///////////////////////////////////////////////////////////////////////////////
  237. // Avalonia.iOS
  238. ///////////////////////////////////////////////////////////////////////////////
  239. new NuGetPackSettings()
  240. {
  241. Id = "Avalonia.iOS",
  242. Dependencies = new []
  243. {
  244. new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version },
  245. new NuSpecDependency() { Id = "Avalonia.Skia.iOS", Version = parameters.Version }
  246. },
  247. Files = new []
  248. {
  249. new NuSpecContent { Source = "Avalonia.iOS.dll", Target = "lib/Xamarin.iOS10" }
  250. },
  251. BasePath = context.Directory("./src/iOS/Avalonia.iOS/bin/" + parameters.DirSuffixIOS),
  252. OutputDirectory = parameters.NugetRoot
  253. },
  254. ///////////////////////////////////////////////////////////////////////////////
  255. // Avalonia.Skia.iOS
  256. ///////////////////////////////////////////////////////////////////////////////
  257. new NuGetPackSettings()
  258. {
  259. Id = "Avalonia.Skia.iOS",
  260. Dependencies = new []
  261. {
  262. new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version },
  263. new NuSpecDependency() { Id = "SkiaSharp", Version = SkiaSharpVersion }
  264. },
  265. Files = new []
  266. {
  267. new NuSpecContent { Source = "Avalonia.Skia.iOS.dll", Target = "lib/Xamarin.iOS10" }
  268. },
  269. BasePath = context.Directory("./src/Skia/Avalonia.Skia.iOS/bin/" + parameters.DirSuffixIOS),
  270. OutputDirectory = parameters.NugetRoot
  271. },
  272. ///////////////////////////////////////////////////////////////////////////////
  273. // Avalonia.Mobile
  274. ///////////////////////////////////////////////////////////////////////////////
  275. new NuGetPackSettings()
  276. {
  277. Id = "Avalonia.Mobile",
  278. Dependencies = new []
  279. {
  280. new NuSpecDependency() { Id = "Avalonia.Android", Version = parameters.Version },
  281. new NuSpecDependency() { Id = "Avalonia.iOS", Version = parameters.Version }
  282. },
  283. Files = new NuSpecContent[]
  284. {
  285. new NuSpecContent { Source = "licence.md", Target = "" }
  286. },
  287. BasePath = context.Directory("./"),
  288. OutputDirectory = parameters.NugetRoot
  289. }
  290. };
  291. var nuspecNuGetSettingsDesktop = new []
  292. {
  293. ///////////////////////////////////////////////////////////////////////////////
  294. // Avalonia.Win32
  295. ///////////////////////////////////////////////////////////////////////////////
  296. new NuGetPackSettings()
  297. {
  298. Id = "Avalonia.Win32",
  299. Dependencies = new []
  300. {
  301. new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version }
  302. },
  303. Files = new []
  304. {
  305. new NuSpecContent { Source = "Avalonia.Win32/bin/" + parameters.DirSuffix + "/Avalonia.Win32.dll", Target = "lib/net45" },
  306. new NuSpecContent { Source = "Avalonia.Win32.NetStandard/bin/" + parameters.DirSuffix + "/Avalonia.Win32.dll", Target = "lib/netstandard1.1" }
  307. },
  308. BasePath = context.Directory("./src/Windows"),
  309. OutputDirectory = parameters.NugetRoot
  310. },
  311. ///////////////////////////////////////////////////////////////////////////////
  312. // Avalonia.Direct2D1
  313. ///////////////////////////////////////////////////////////////////////////////
  314. new NuGetPackSettings()
  315. {
  316. Id = "Avalonia.Direct2D1",
  317. Dependencies = new []
  318. {
  319. new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version },
  320. new NuSpecDependency() { Id = "SharpDX", Version = SharpDXVersion },
  321. new NuSpecDependency() { Id = "SharpDX.Direct2D1", Version = SharpDXDirect2D1Version },
  322. new NuSpecDependency() { Id = "SharpDX.Direct3D11", Version = SharpDXDirect3D11Version },
  323. new NuSpecDependency() { Id = "SharpDX.DXGI", Version = SharpDXDXGIVersion }
  324. },
  325. Files = new []
  326. {
  327. new NuSpecContent { Source = "Avalonia.Direct2D1.dll", Target = "lib/net45" }
  328. },
  329. BasePath = context.Directory("./src/Windows/Avalonia.Direct2D1/bin/" + parameters.DirSuffix),
  330. OutputDirectory = parameters.NugetRoot
  331. },
  332. ///////////////////////////////////////////////////////////////////////////////
  333. // Avalonia.Gtk
  334. ///////////////////////////////////////////////////////////////////////////////
  335. new NuGetPackSettings()
  336. {
  337. Id = "Avalonia.Gtk",
  338. Dependencies = new []
  339. {
  340. new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version }
  341. },
  342. Files = new []
  343. {
  344. new NuSpecContent { Source = "Avalonia.Gtk.dll", Target = "lib/net45" }
  345. },
  346. BasePath = context.Directory("./src/Gtk/Avalonia.Gtk/bin/" + parameters.DirSuffix),
  347. OutputDirectory = parameters.NugetRoot
  348. },
  349. ///////////////////////////////////////////////////////////////////////////////
  350. // Avalonia.Gtk3
  351. ///////////////////////////////////////////////////////////////////////////////
  352. new NuGetPackSettings()
  353. {
  354. Id = "Avalonia.Gtk3",
  355. Dependencies = new []
  356. {
  357. new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version }
  358. },
  359. Files = new []
  360. {
  361. new NuSpecContent { Source = "Avalonia.Gtk3.dll", Target = "lib/netstandard1.1" }
  362. },
  363. BasePath = context.Directory("./src/Gtk/Avalonia.Gtk3/bin/" + parameters.DirSuffix),
  364. OutputDirectory = parameters.NugetRoot
  365. },
  366. ///////////////////////////////////////////////////////////////////////////////
  367. // Avalonia.Cairo
  368. ///////////////////////////////////////////////////////////////////////////////
  369. new NuGetPackSettings()
  370. {
  371. Id = "Avalonia.Cairo",
  372. Dependencies = new []
  373. {
  374. new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version }
  375. },
  376. Files = new []
  377. {
  378. new NuSpecContent { Source = "Avalonia.Cairo.dll", Target = "lib/net45" }
  379. },
  380. BasePath = context.Directory("./src/Gtk/Avalonia.Cairo/bin/" + parameters.DirSuffix),
  381. OutputDirectory = parameters.NugetRoot
  382. },
  383. ///////////////////////////////////////////////////////////////////////////////
  384. // Avalonia.Skia.Desktop
  385. ///////////////////////////////////////////////////////////////////////////////
  386. new NuGetPackSettings()
  387. {
  388. Id = "Avalonia.Skia.Desktop",
  389. Dependencies = new []
  390. {
  391. new NuSpecDependency() { Id = "Avalonia", Version = parameters.Version },
  392. new NuSpecDependency() { Id = "SkiaSharp", Version = SkiaSharpVersion },
  393. //.NET Core
  394. new NuSpecDependency() { Id = "Avalonia", TargetFramework = "netcoreapp1.0", Version = parameters.Version },
  395. new NuSpecDependency() { Id = "SkiaSharp", TargetFramework = "netcoreapp1.0", Version = SkiaSharpVersion },
  396. new NuSpecDependency() { Id = "NETStandard.Library", TargetFramework = "netcoreapp1.0", Version = "1.6.0" },
  397. new NuSpecDependency() { Id = "Microsoft.NETCore.Portable.Compatibility", TargetFramework = "netcoreapp1.0", Version = "1.0.1" }
  398. },
  399. Files = new []
  400. {
  401. new NuSpecContent { Source = "Avalonia.Skia.Desktop/bin/" + parameters.DirSuffixSkia + "/Avalonia.Skia.Desktop.dll", Target = "lib/net45" },
  402. new NuSpecContent { Source = "Avalonia.Skia.Desktop.NetStandard/bin/" + parameters.DirSuffix + "/Avalonia.Skia.Desktop.dll", Target = "lib/netcoreapp1.0" }
  403. },
  404. BasePath = context.Directory("./src/Skia/"),
  405. OutputDirectory = parameters.NugetRoot
  406. },
  407. ///////////////////////////////////////////////////////////////////////////////
  408. // Avalonia.Desktop
  409. ///////////////////////////////////////////////////////////////////////////////
  410. new NuGetPackSettings()
  411. {
  412. Id = "Avalonia.Desktop",
  413. Dependencies = new []
  414. {
  415. new NuSpecDependency() { Id = "Avalonia.Win32", Version = parameters.Version },
  416. new NuSpecDependency() { Id = "Avalonia.Direct2D1", Version = parameters.Version },
  417. new NuSpecDependency() { Id = "Avalonia.Gtk", Version = parameters.Version },
  418. new NuSpecDependency() { Id = "Avalonia.Cairo", Version = parameters.Version },
  419. new NuSpecDependency() { Id = "Avalonia.Skia.Desktop", Version = parameters.Version }
  420. },
  421. Files = new NuSpecContent[]
  422. {
  423. new NuSpecContent { Source = "licence.md", Target = "" }
  424. },
  425. BasePath = context.Directory("./"),
  426. OutputDirectory = parameters.NugetRoot
  427. }
  428. };
  429. NuspecNuGetSettings = new List<NuGetPackSettings>();
  430. NuspecNuGetSettings.AddRange(nuspecNuGetSettingsCore);
  431. NuspecNuGetSettings.AddRange(nuspecNuGetSettingsDesktop);
  432. NuspecNuGetSettings.AddRange(nuspecNuGetSettingsMobile);
  433. NuspecNuGetSettings.ForEach((nuspec) => SetNuGetNuspecCommonProperties(nuspec));
  434. NugetPackages = NuspecNuGetSettings.Select(nuspec => {
  435. return nuspec.OutputDirectory.CombineWithFilePath(string.Concat(nuspec.Id, ".", nuspec.Version, ".nupkg"));
  436. }).ToArray();
  437. BinFiles = NuspecNuGetSettings.SelectMany(nuspec => {
  438. return nuspec.Files.Select(file => {
  439. return ((DirectoryPath)nuspec.BasePath).CombineWithFilePath(file.Source);
  440. });
  441. }).GroupBy(f => f.FullPath).Select(g => g.First()).ToArray();
  442. }
  443. }