public async Task PlatformGeneratesCode(AutoPlatform autoPlatform) { var sourceDirectory = IntegrationTestHelper.GetOutputDirectory(); var referenceAssembliesLocation = ReferenceLocator.GetReferenceLocation(); await ObservablesForEventGenerator.ExtractEventsFromPlatforms(sourceDirectory, string.Empty, ".received.txt", referenceAssembliesLocation, new[] { autoPlatform }, TestUtilities.GetPackageDirectory()).ConfigureAwait(false); }
/// <summary> /// Writes the header for a output. /// </summary> /// <param name="writer">The writer where to output to.</param> /// <param name="autoPlatform">The packages we are writing for..</param> /// <returns>A task to monitor the progress.</returns> public static async Task WriteHeader(TextWriter writer, AutoPlatform autoPlatform) { if (writer == null) { throw new ArgumentNullException(nameof(writer)); } await WriteHeader(writer).ConfigureAwait(false); await writer.WriteLineAsync($"// Platform included: {autoPlatform}").ConfigureAwait(false); await writer.FlushAsync().ConfigureAwait(false); }
/// <summary> /// Installs a nuget package into the specified directory. /// </summary> /// <param name="packageIdentities">The identities of the packages to find.</param> /// <param name="platform">The name of the platform.</param> /// <param name="framework">Optional framework parameter which will force NuGet to evaluate as the specified Framework. If null it will use .NET Standard 2.0.</param> /// <returns>The directory where the NuGet packages are unzipped to.</returns> public static async Task <string> InstallPackages(IEnumerable <PackageIdentity> packageIdentities, AutoPlatform platform, NuGetFramework framework = null) { var packageUnzipPath = Path.Combine(Path.GetTempPath(), "EventBuilder.NuGet", platform.ToString()); if (!Directory.Exists(packageUnzipPath)) { Directory.CreateDirectory(packageUnzipPath); } await Task.WhenAll(packageIdentities.Select(x => InstallPackage(x, packageUnzipPath, framework))).ConfigureAwait(false); return(packageUnzipPath); }