mirror of https://github.com/dotnet/tye.git
Browse Source
Fixes: #206 This change only applies to the logic that we use to look at solution files. This adds a heuristic that we only include projects with a launchSettings.json for these operations (when considering a solution). This will exclude unit test projects and class libraries. In this case where the user has a `tye.yaml` then whatever's in there will win. Likewise if a user passes a path to a project directly then we'll try to run it without asking questions. I chose `launchSettings.json` for this because it's a decision we can make really quickly without having to run any MSBuild code. When we think about operating on a solution with 50 projects with `tye run` we really really don't want to have to evaluate each project with MSBuild to figure out what kind of project it is (500ms).pull/321/head
13 changed files with 264 additions and 5 deletions
@ -0,0 +1,10 @@ |
|||||
|
# tye application configuration file |
||||
|
# read all about it at https://github.com/dotnet/tye |
||||
|
# |
||||
|
# when you've given us a try, we'd love to know what you think: |
||||
|
# https://aka.ms/AA7q20u |
||||
|
# |
||||
|
name: project-types |
||||
|
services: |
||||
|
- name: app |
||||
|
project: app/app.csproj |
||||
@ -0,0 +1,26 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Hosting; |
||||
|
using Microsoft.Extensions.Configuration; |
||||
|
using Microsoft.Extensions.Hosting; |
||||
|
using Microsoft.Extensions.Logging; |
||||
|
|
||||
|
namespace app |
||||
|
{ |
||||
|
public class Program |
||||
|
{ |
||||
|
public static void Main(string[] args) |
||||
|
{ |
||||
|
CreateHostBuilder(args).Build().Run(); |
||||
|
} |
||||
|
|
||||
|
public static IHostBuilder CreateHostBuilder(string[] args) => |
||||
|
Host.CreateDefaultBuilder(args) |
||||
|
.ConfigureWebHostDefaults(webBuilder => |
||||
|
{ |
||||
|
webBuilder.UseStartup<Startup>(); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
{ |
||||
|
"iisSettings": { |
||||
|
"windowsAuthentication": false, |
||||
|
"anonymousAuthentication": true, |
||||
|
"iisExpress": { |
||||
|
"applicationUrl": "http://localhost:31902", |
||||
|
"sslPort": 44339 |
||||
|
} |
||||
|
}, |
||||
|
"profiles": { |
||||
|
"IIS Express": { |
||||
|
"commandName": "IISExpress", |
||||
|
"launchBrowser": true, |
||||
|
"environmentVariables": { |
||||
|
"ASPNETCORE_ENVIRONMENT": "Development" |
||||
|
} |
||||
|
}, |
||||
|
"app": { |
||||
|
"commandName": "Project", |
||||
|
"launchBrowser": true, |
||||
|
"applicationUrl": "https://localhost:5001;http://localhost:5000", |
||||
|
"environmentVariables": { |
||||
|
"ASPNETCORE_ENVIRONMENT": "Development" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,40 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Builder; |
||||
|
using Microsoft.AspNetCore.Hosting; |
||||
|
using Microsoft.AspNetCore.Http; |
||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
using Microsoft.Extensions.Hosting; |
||||
|
|
||||
|
namespace app |
||||
|
{ |
||||
|
public class Startup |
||||
|
{ |
||||
|
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
|
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
|
||||
|
public void ConfigureServices(IServiceCollection services) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) |
||||
|
{ |
||||
|
if (env.IsDevelopment()) |
||||
|
{ |
||||
|
app.UseDeveloperExceptionPage(); |
||||
|
} |
||||
|
|
||||
|
app.UseRouting(); |
||||
|
|
||||
|
app.UseEndpoints(endpoints => |
||||
|
{ |
||||
|
endpoints.MapGet("/", async context => |
||||
|
{ |
||||
|
await context.Response.WriteAsync("Hello World!"); |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk.Web"> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>netcoreapp3.1</TargetFramework> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
</Project> |
||||
@ -0,0 +1,9 @@ |
|||||
|
{ |
||||
|
"Logging": { |
||||
|
"LogLevel": { |
||||
|
"Default": "Information", |
||||
|
"Microsoft": "Warning", |
||||
|
"Microsoft.Hosting.Lifetime": "Information" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,10 @@ |
|||||
|
{ |
||||
|
"Logging": { |
||||
|
"LogLevel": { |
||||
|
"Default": "Information", |
||||
|
"Microsoft": "Warning", |
||||
|
"Microsoft.Hosting.Lifetime": "Information" |
||||
|
} |
||||
|
}, |
||||
|
"AllowedHosts": "*" |
||||
|
} |
||||
@ -0,0 +1,8 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>netcoreapp3.1</TargetFramework> |
||||
|
<RootNamespace>class_library</RootNamespace> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
</Project> |
||||
@ -0,0 +1,62 @@ |
|||||
|
|
||||
|
Microsoft Visual Studio Solution File, Format Version 12.00 |
||||
|
# Visual Studio 15 |
||||
|
VisualStudioVersion = 15.0.26124.0 |
||||
|
MinimumVisualStudioVersion = 15.0.26124.0 |
||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "app", "app\app.csproj", "{F9D2F74A-9CC5-41E2-AB54-43AB9E4EB32F}" |
||||
|
EndProject |
||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "test-project", "test-project\test-project.csproj", "{EEE93347-434A-4C20-B755-41D83C9B7B07}" |
||||
|
EndProject |
||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "class-library", "class-library\class-library.csproj", "{BEF59C6C-BEC4-4CFF-9602-44B0089478A4}" |
||||
|
EndProject |
||||
|
Global |
||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
||||
|
Debug|Any CPU = Debug|Any CPU |
||||
|
Debug|x64 = Debug|x64 |
||||
|
Debug|x86 = Debug|x86 |
||||
|
Release|Any CPU = Release|Any CPU |
||||
|
Release|x64 = Release|x64 |
||||
|
Release|x86 = Release|x86 |
||||
|
EndGlobalSection |
||||
|
GlobalSection(SolutionProperties) = preSolution |
||||
|
HideSolutionNode = FALSE |
||||
|
EndGlobalSection |
||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
||||
|
{F9D2F74A-9CC5-41E2-AB54-43AB9E4EB32F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
|
{F9D2F74A-9CC5-41E2-AB54-43AB9E4EB32F}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
|
{F9D2F74A-9CC5-41E2-AB54-43AB9E4EB32F}.Debug|x64.ActiveCfg = Debug|Any CPU |
||||
|
{F9D2F74A-9CC5-41E2-AB54-43AB9E4EB32F}.Debug|x64.Build.0 = Debug|Any CPU |
||||
|
{F9D2F74A-9CC5-41E2-AB54-43AB9E4EB32F}.Debug|x86.ActiveCfg = Debug|Any CPU |
||||
|
{F9D2F74A-9CC5-41E2-AB54-43AB9E4EB32F}.Debug|x86.Build.0 = Debug|Any CPU |
||||
|
{F9D2F74A-9CC5-41E2-AB54-43AB9E4EB32F}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
|
{F9D2F74A-9CC5-41E2-AB54-43AB9E4EB32F}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
|
{F9D2F74A-9CC5-41E2-AB54-43AB9E4EB32F}.Release|x64.ActiveCfg = Release|Any CPU |
||||
|
{F9D2F74A-9CC5-41E2-AB54-43AB9E4EB32F}.Release|x64.Build.0 = Release|Any CPU |
||||
|
{F9D2F74A-9CC5-41E2-AB54-43AB9E4EB32F}.Release|x86.ActiveCfg = Release|Any CPU |
||||
|
{F9D2F74A-9CC5-41E2-AB54-43AB9E4EB32F}.Release|x86.Build.0 = Release|Any CPU |
||||
|
{EEE93347-434A-4C20-B755-41D83C9B7B07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
|
{EEE93347-434A-4C20-B755-41D83C9B7B07}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
|
{EEE93347-434A-4C20-B755-41D83C9B7B07}.Debug|x64.ActiveCfg = Debug|Any CPU |
||||
|
{EEE93347-434A-4C20-B755-41D83C9B7B07}.Debug|x64.Build.0 = Debug|Any CPU |
||||
|
{EEE93347-434A-4C20-B755-41D83C9B7B07}.Debug|x86.ActiveCfg = Debug|Any CPU |
||||
|
{EEE93347-434A-4C20-B755-41D83C9B7B07}.Debug|x86.Build.0 = Debug|Any CPU |
||||
|
{EEE93347-434A-4C20-B755-41D83C9B7B07}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
|
{EEE93347-434A-4C20-B755-41D83C9B7B07}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
|
{EEE93347-434A-4C20-B755-41D83C9B7B07}.Release|x64.ActiveCfg = Release|Any CPU |
||||
|
{EEE93347-434A-4C20-B755-41D83C9B7B07}.Release|x64.Build.0 = Release|Any CPU |
||||
|
{EEE93347-434A-4C20-B755-41D83C9B7B07}.Release|x86.ActiveCfg = Release|Any CPU |
||||
|
{EEE93347-434A-4C20-B755-41D83C9B7B07}.Release|x86.Build.0 = Release|Any CPU |
||||
|
{BEF59C6C-BEC4-4CFF-9602-44B0089478A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
|
{BEF59C6C-BEC4-4CFF-9602-44B0089478A4}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
|
{BEF59C6C-BEC4-4CFF-9602-44B0089478A4}.Debug|x64.ActiveCfg = Debug|Any CPU |
||||
|
{BEF59C6C-BEC4-4CFF-9602-44B0089478A4}.Debug|x64.Build.0 = Debug|Any CPU |
||||
|
{BEF59C6C-BEC4-4CFF-9602-44B0089478A4}.Debug|x86.ActiveCfg = Debug|Any CPU |
||||
|
{BEF59C6C-BEC4-4CFF-9602-44B0089478A4}.Debug|x86.Build.0 = Debug|Any CPU |
||||
|
{BEF59C6C-BEC4-4CFF-9602-44B0089478A4}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
|
{BEF59C6C-BEC4-4CFF-9602-44B0089478A4}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
|
{BEF59C6C-BEC4-4CFF-9602-44B0089478A4}.Release|x64.ActiveCfg = Release|Any CPU |
||||
|
{BEF59C6C-BEC4-4CFF-9602-44B0089478A4}.Release|x64.Build.0 = Release|Any CPU |
||||
|
{BEF59C6C-BEC4-4CFF-9602-44B0089478A4}.Release|x86.ActiveCfg = Release|Any CPU |
||||
|
{BEF59C6C-BEC4-4CFF-9602-44B0089478A4}.Release|x86.Build.0 = Release|Any CPU |
||||
|
EndGlobalSection |
||||
|
EndGlobal |
||||
@ -0,0 +1,14 @@ |
|||||
|
using System; |
||||
|
using Xunit; |
||||
|
|
||||
|
namespace test_project |
||||
|
{ |
||||
|
public class UnitTest1 |
||||
|
{ |
||||
|
[Fact] |
||||
|
public void Test1() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,17 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>netcoreapp3.1</TargetFramework> |
||||
|
<RootNamespace>test_project</RootNamespace> |
||||
|
|
||||
|
<IsPackable>false</IsPackable> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" /> |
||||
|
<PackageReference Include="xunit" Version="2.4.0" /> |
||||
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" /> |
||||
|
<PackageReference Include="coverlet.collector" Version="1.0.1" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
||||
Loading…
Reference in new issue