diff --git a/Directory.Packages.props b/Directory.Packages.props index cd66084b..8b0370ed 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -7,8 +7,8 @@ - - + + @@ -20,7 +20,7 @@ - + diff --git a/src/Pixely.SdlangCompiler/SdlangCompileTask.cs b/src/Pixely.SdlangCompiler/SdlangCompileTask.cs index 7f72b68f..ddd602ba 100644 --- a/src/Pixely.SdlangCompiler/SdlangCompileTask.cs +++ b/src/Pixely.SdlangCompiler/SdlangCompileTask.cs @@ -13,9 +13,10 @@ public class SdlangCompileTask : Microsoft.Build.Utilities.Task private static readonly string[] GeneratedShaderExtensions = ["spv", "dxil", "metal"]; /// - /// The input shader file to compile. If empty or null, the task succeeds without compiling. + /// The input shader file to compile. /// - public string? InputFile { get; set; } + [Required] + public string InputFile { get; set; } = ""; /// /// Path to the slangc executable. Slang is build-time tooling, so it is located through this @@ -35,11 +36,6 @@ public override bool Execute() { GeneratedFiles = []; - if (string.IsNullOrEmpty(InputFile)) - { - return true; - } - if (string.IsNullOrEmpty(SlangCompilerPath)) { Log.LogError( diff --git a/src/Pixely.SdlangCompiler/build/Pixely.SdlangCompiler.props b/src/Pixely.SdlangCompiler/build/Pixely.SdlangCompiler.props index e9afaeff..826ec2db 100644 --- a/src/Pixely.SdlangCompiler/build/Pixely.SdlangCompiler.props +++ b/src/Pixely.SdlangCompiler/build/Pixely.SdlangCompiler.props @@ -7,7 +7,7 @@ - 2026.17.0 + 2026.17.1 $(SlangDxcToolchainRoot)$(SlangPlatform)/ slangc slangc.exe diff --git a/tests/Pixely.SdlangCompiler.Tests/SdlangCompileTaskTests.cs b/tests/Pixely.SdlangCompiler.Tests/SdlangCompileTaskTests.cs index 5a0dc0c7..cf3f608e 100644 --- a/tests/Pixely.SdlangCompiler.Tests/SdlangCompileTaskTests.cs +++ b/tests/Pixely.SdlangCompiler.Tests/SdlangCompileTaskTests.cs @@ -24,18 +24,4 @@ public void CompiledShaderOutputExists() Assert.That(File.Exists(metadataPath), Is.True, "Compiled shader output file should exist at: " + metadataPath); } } - - [Test] - public void Execute_WithNullInputFile_ReturnsTrue() - { - SdlangCompileTask task = new SdlangCompileTask { InputFile = null }; - Assert.That(task.Execute(), Is.True); - } - - [Test] - public void Execute_WithEmptyInputFile_ReturnsTrue() - { - SdlangCompileTask task = new SdlangCompileTask { InputFile = "" }; - Assert.That(task.Execute(), Is.True); - } }