Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,11 @@ selecting the desired file from the Start button dropdown.
When running from the command-line, you can select the file to run by passing it as an argument to `dotnet run`:

```bash
dotnet run -p:ActiveFile program1.cs
dotnet run -p:start=program1.cs
```

You can also use the shortcut `-p:s=[FILE]`.

## How It Works

This nuget package leverages in concert the following standalone and otherwise
Expand Down
2 changes: 1 addition & 1 deletion src/SmallSharp/SmallSharp.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- Capture project-level properties before they are defaulted by Microsoft.Common.targets -->
<CustomBeforeMicrosoftCSharpTargets>$(MSBuildThisFileDirectory)\SmallSharp.Before.props</CustomBeforeMicrosoftCSharpTargets>

<UsingSmallSharpSDK Condition="'$(UsingSmallSharpSDK)' == ''">false</UsingSmallSharpSDK>
<UsingSmallSharpSDK Condition="'$(UsingSmallSharpSDK)' == ''">false</UsingSmallSharpSDK>
</PropertyGroup>

<Import Project="SmallSharp.Version.props"/>
Expand Down
2 changes: 2 additions & 0 deletions src/SmallSharp/SmallSharp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<!-- Backs compat -->
<ActiveFile Condition="'$(ActiveCompile)' != ''">$(ActiveCompile)</ActiveFile>
<StartupFile>$(ActiveFile)</StartupFile>
<StartupFile Condition="'$(StartupFile)' == ''">$(Start)</StartupFile>
<StartupFile Condition="'$(StartupFile)' == ''">$(S)</StartupFile>
<StartupFile Condition="'$(StartupFile)' == ''">$(ActiveDebugProfile)</StartupFile>
<FindStartupFile Condition="'$(StartupFile)' == '' or !Exists('$(StartupFile)')">true</FindStartupFile>
<StartupFileDependsOn>EnsureProperties;CollectStartupFile;SelectStartupFile;SelectTopLevelCompile;UpdateLaunchSettings;EmitTargets</StartupFileDependsOn>
Expand Down
2 changes: 1 addition & 1 deletion src/demo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jq --arg version "$version" '.["msbuild-sdks"].SmallSharp = $version' global.jso
# build with each top-level file as the active one
foreach ($file in gci *.cs) {
# rm -r -fo obj -ea 0
dotnet build Demo.csproj -p:ActiveFile=$($file.Name) -bl:"$($file.BaseName).binlog"
dotnet build Demo.csproj -p:start=$($file.Name) -bl:"$($file.BaseName).binlog"
if ($LASTEXITCODE -ne 0) {
Write-Error "Build failed for $($file.Name)"
popd; popd;
Expand Down