protected override CleanResult OnClean(CleanContext context) { var result = context.GetBuildResult(); Assert.That(result, Is.Not.Null); Assert.That(result.Succeeded, Is.True); var artifact = context.GetBuildArtifact <TestBuildArtifactA>(); Assert.That(artifact, Is.Not.Null); Assert.Throws <NotSupportedException>(() => context.SetValue <TestBuildArtifactB>()); Assert.Throws <NotSupportedException>(() => context.RemoveValue <TestBuildArtifactB>()); return(result.Succeeded && artifact != null?context.Success() : context.Failure(nameof(artifact))); }
protected override CleanResult OnClean(CleanContext context) { var artifacts = context.GetBuildArtifact <DotsRuntimeBuildArtifact>(); if (artifacts == null) { return(context.Success()); } var buildDirectory = artifacts.OutputTargetFile.Directory; if (buildDirectory.Exists) { buildDirectory.Delete(true); } return(context.Success()); }