Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add current source-build prebuilts to support offline builds #14261

Merged
merged 4 commits into from
Aug 5, 2022
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
2 changes: 1 addition & 1 deletion eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
</Dependency>
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="7.0.0-alpha.1.22402.1">
<Uri>https://github.com/dotnet/source-build-externals</Uri>
<Sha>26a8684b136d79c3d35b4c5c512858f932c57705</Sha>
<Sha>85d7e996e497861648ffbfd0e929b2b627ce7f46</Sha>
<SourceBuild RepoName="source-build-externals" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.SourceBuild.Intermediate.symreader" Version="1.4.0-beta2-21475-02">
Expand Down
1 change: 1 addition & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
necessary, and this property is removed from the file.
-->
<PrivateSourceBuiltArtifactsPackageVersion>0.1.0-7.0.100-bootstrap.7</PrivateSourceBuiltArtifactsPackageVersion>
<PrivateSourceBuiltPrebuiltsPackageVersion>0.1.0-7.0.100-2</PrivateSourceBuiltPrebuiltsPackageVersion>
</PropertyGroup>
<!-- Workload manifest package versions -->
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public class DotNetWatchTests : SmokeTests
{
public DotNetWatchTests(ITestOutputHelper outputHelper) : base(outputHelper) { }

[Fact]
// TODO: Re-enable https://github.com/dotnet/source-build/issues/2961
// [Fact]
public void WatchTests()
{
string projectDirectory = DotNetHelper.ExecuteNew(DotNetTemplate.Console.GetName(), nameof(DotNetWatchTests));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ public override bool Execute()
}

// Union all package sources to get the distinct list. These will get added to the source-build sources.
IEnumerable<string> packagePatterns = pkgSrcMappingElement.Descendants()
string[] packagePatterns = pkgSrcMappingElement.Descendants()
.Where(e => e.Name == "packageSource")
.SelectMany(e => e.Descendants().Where(e => e.Name == "package"))
.Select(e => e.Attribute("pattern").Value)
.Distinct();
.Distinct()
.ToArray();

if (!BuildWithOnlineSources)
{
Expand All @@ -60,6 +61,11 @@ public override bool Execute()
}

XElement pkgSrcMappingClearElement = pkgSrcMappingElement.Descendants().FirstOrDefault(e => e.Name == "clear");
if (pkgSrcMappingClearElement == null)
{
pkgSrcMappingClearElement = new XElement("clear");
pkgSrcMappingElement.AddFirst(pkgSrcMappingClearElement);
}

foreach (string packageSource in SourceBuildSources)
{
Expand All @@ -69,15 +75,7 @@ public override bool Execute()
pkgSrc.Add(new XElement("package", new XAttribute("pattern", packagePattern)));
}

if (pkgSrcMappingClearElement != null)
{
pkgSrcMappingClearElement.AddAfterSelf(pkgSrc);
}
else
{
pkgSrcMappingElement.AddFirst(pkgSrc);
pkgSrcMappingElement.AddFirst(new XElement("clear"));
}
pkgSrcMappingClearElement.AddAfterSelf(pkgSrc);
}

using (var writer = XmlWriter.Create(NuGetConfigFile, new XmlWriterSettings { NewLineChars = newLineChars, Indent = true }))
Expand Down