protected override BoolResult OnCanRun(RunContext 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?BoolResult.True() : BoolResult.False(nameof(artifact))); }
protected override BoolResult OnCanRun(RunContext context) { #if UNITY_ANDROID var artifact = context.GetBuildArtifact <AndroidArtifact>(); if (artifact == null) { return(BoolResult.False($"Could not retrieve build artifact '{nameof(AndroidArtifact)}'. Are you exporting a gradle project? Running gradleproject is not supported.")); } if (artifact.OutputTargetFile == null) { return(BoolResult.False($"{nameof(AndroidArtifact.OutputTargetFile)} is null.")); } return(BoolResult.True()); #else return(BoolResult.False("Active Editor platform has to be set to Android.")); #endif }
protected override BoolResult OnCanRun(RunContext context) { var artifact = context.GetBuildArtifact <WindowsArtifact>(); if (artifact == null) { return(BoolResult.False($"Could not retrieve build artifact '{nameof(WindowsArtifact)}'.")); } if (artifact.OutputTargetFile == null) { return(BoolResult.False($"{nameof(WindowsArtifact.OutputTargetFile)} is null.")); } if (!File.Exists(artifact.OutputTargetFile.FullName)) { return(BoolResult.False($"Output target file '{artifact.OutputTargetFile.FullName}' not found.")); } return(BoolResult.True()); }
protected override BoolResult OnCanRun(RunContext context) { var artifact = context.GetBuildArtifact <MacOSArtifact>(); if (artifact == null) { return(BoolResult.False($"Could not retrieve build artifact '{nameof(MacOSArtifact)}'.")); } if (artifact.OutputTargetFile == null) { return(BoolResult.False($"{nameof(MacOSArtifact.OutputTargetFile)} is null.")); } // On macOS, the output target is a .app directory structure if (!Directory.Exists(artifact.OutputTargetFile.FullName)) { return(BoolResult.False($"Output target file '{artifact.OutputTargetFile.FullName}' not found.")); } return(BoolResult.True()); }
protected override BoolResult OnCanRun(RunContext context) { if (!Target.CanRun) { return(BoolResult.False("Run is not supported with current build settings")); } var artifact = context.GetBuildArtifact <DotsRuntimeBuildArtifact>(); if (artifact == null) { return(BoolResult.False($"Could not retrieve build artifact '{nameof(DotsRuntimeBuildArtifact)}'.")); } if (artifact.OutputTargetFile == null) { return(BoolResult.False($"{nameof(DotsRuntimeBuildArtifact.OutputTargetFile)} is null.")); } if (!File.Exists(artifact.OutputTargetFile.FullName) && !Directory.Exists(artifact.OutputTargetFile.FullName)) { return(BoolResult.False($"Output target file '{artifact.OutputTargetFile.FullName}' not found.")); } if (!context.TryGetComponent <DotsRuntimeBuildProfile>(out var profile)) { return(BoolResult.False($"Could not retrieve component '{nameof(DotsRuntimeBuildProfile)}'.")); } if (profile.Target == null) { return(BoolResult.False($"{nameof(DotsRuntimeBuildProfile)} target is null.")); } return(BoolResult.True()); }