Comments (8)
@markwilkie Any idea what the status of this is?
from arcade.
cc @ryanbrandenburg - this is relevant to the .Sources stuff in aspnet/Extensions.
from arcade.
Yeah, I brought it up :)
from arcade.
The status is that this was not a priority - until this thread of course.... The first thing is to come up with what we think should happen. Then we can go about finding out the best way to fund it....
from arcade.
I'm not sure what the actual issue is. As @jaredpar pointed out we use shared projects in Roslyn and we have seen no issues.
from arcade.
The problem is basically that you can't use .shproj to represent a package of shared source. ASP.NET and others, like the System.Text.Json team, want to produce 'shared source' NuGet packages which only contain C# in contentFiles/cs/any/
.
The reason you can't do this boils down to 2 limitations in MSBuild.
- Solution files don't actually build .shproj files. Here's an example .sln file that only has a .shproj in it. As you'll see, this project does not appear in the section
GlobalSection(ProjectConfigurationPlatforms)
which defines the list of projects that actually compile.
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SharedProject1", "SharedProject1\SharedProject1.shproj", "{048A3DB6-363C-4CCA-A4B5-CDF3DDDD896C}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
SharedProject1\SharedProject1.projitems*{048a3db6-363c-4cca-a4b5-cdf3dddd896c}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {83C46E69-85C3-4C0A-91D1-ECF6191F9673}
EndGlobalSection
EndGlobal
dotnet msbuild MyProj.shproj
doesn't work.
PS > dotnet msbuild .\SharedProject1\SharedProject1.shproj
Microsoft (R) Build Engine version 15.9.19+g938f3292a0 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
C:\tmp\shpr\SharedProject1\SharedProject1.shproj(8,3): error MSB4019: The imported project "C:\Users\namc\.dotnet\x64\sdk\3.0.100-preview-009750\Microsoft\VisualStudio\v15.0\CodeSharing\Microsoft.CodeSharing.Common.Default.props" was not found. Confirm that the path in the <Import> declaration
is correct, and that the file exists on disk.
from arcade.
Two ideas for working around this:
- Create a dummy ‘.csproj’ file for each shared sources package. This dummy project needs to strip out the C# compiler targets since it shouldn't make an assembly. This is basically what we did in KoreBuild. AFAIK it’s the only way to get Visual Studio, dotnet.exe, and NuGet's packing targets to play nice. Projects in the same repo then need to add
<Compile>
item groups to point to the folders of code they need as<ProjectReference>
won't work. - Change aspnet/Extensions to build a list of projects, not a .sln file, and implement some targets for
.shproj
files which don't require full MSBuild. This one is probably the more expensive option, but I think would lead to a nice project convention for shared sources.
from arcade.
We did [1], but we keep the assembly building.
See e.g.: https://github.com/dotnet/roslyn/tree/master/src/Dependencies/PooledObjects
The reason why you might want to build the assembly is to validate that the source files can be built against given TFM. For example, we want the source files to be buildable in projects that target netstandard1.3
.
This is a targets file that these packages include:
https://github.com/dotnet/roslyn/blob/master/eng/targets/SourcePackage.targets
Other than setting some properties to tweak the build, we also generate Source Link information that is included in the NuGet package, so that the sources can be debugged. I want to move this logic to Source Link package at some point. Haven't had time to do so yet.
from arcade.
Related Issues (20)
- Publish Build Assets checkouts the repo with all branches which can take several minutes HOT 13
- Upgrade to .NET 9 SDK HOT 1
- Update to October 2023 XBox GDK on build images
- Include @dotnet/source-build-internal as code owners for SB files HOT 1
- Feature request: Add support for translating VS Extensibility resources HOT 4
- Remove .NET 8 feeds
- Arcade scripting ignores DOTNET_INSTALL_DIR if additional runtimes are specified HOT 3
- SDL - "Trim the version from the nuget packages" step creates a cyclic dependency in Arcade HOT 4
- Figure out how to deal with filtered builds and CMake SDK native project references HOT 5
- Remove hardcoded DotNetCli version in arcade-validation
- bring Microsoft.DotNet.AsmDiff to nuget.org HOT 4
- Upgrade WIX toolchain from 3.14 to v4 HOT 3
- Arcade should opt into `BuildWithNetFrameworkHostedCompiler` by default HOT 10
- Introduce msbuild/toolset selection log switch for arcade HOT 2
- Arcade powered source build is missing validation in arcade or arcade-validation
- Move to latest xUnit versions HOT 2
- Move Microsoft.DotNet.XUnitConsoleRunner off of Delegating*Sink
- SymbolUploader builds with old dependencies HOT 1
- How to mirror packages to dotnet-public from other package feeds than nuget.org? HOT 7
- Update the subdirectory of tools directory of all build task projects to net/netframework
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arcade.