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

Upgrade to VS2019 and .NET Core 3.0 #1030

Merged
merged 44 commits into from
Dec 22, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b1c76ce
Move things to the new world
mattleibow Nov 22, 2019
b8dbcb0
Skip native builds for now
mattleibow Nov 22, 2019
6f8bbc7
Make sure the tests are modern too
mattleibow Nov 22, 2019
67894b3
Install the Windows 10.0.10240 SDK
mattleibow Nov 22, 2019
15b57db
Make the script wait for the setup to complete
mattleibow Nov 22, 2019
0b7e8ae
Merge branch 'refs/heads/master' into dev/vs-2019
mattleibow Nov 23, 2019
f4a9f59
Using new project system
mattleibow Nov 23, 2019
b681629
Upgraded a good few things
mattleibow Nov 24, 2019
c65aa2a
Add the targets file to the nuget
mattleibow Nov 24, 2019
db45b16
Let all the tests run before failing the build
mattleibow Nov 24, 2019
a45bb7e
Cleaning up the cake files a bit
mattleibow Nov 25, 2019
43043ea
Pack and validate in one go
mattleibow Nov 25, 2019
8cd9246
Whoops!
mattleibow Nov 25, 2019
941e3e5
The tests also need netstandard?
mattleibow Nov 25, 2019
9d74d5d
Update the samples to use the new projects
mattleibow Nov 25, 2019
23c1a08
Merge branch 'refs/heads/master' into dev/vs-2019
mattleibow Dec 8, 2019
ae93e88
Fixies!
mattleibow Dec 8, 2019
0202b9e
rebuild everything
mattleibow Dec 8, 2019
a56f7ff
Merge branch 'master' into dev/vs-2019
mattleibow Dec 8, 2019
372a265
Update build.cake
mattleibow Dec 8, 2019
10d47a1
Use VS 2017 for native builds
mattleibow Dec 8, 2019
1396e1c
Update azure-pipelines.yml
mattleibow Dec 8, 2019
ca92354
Try a double GC
mattleibow Dec 8, 2019
4cfb85b
no need to rebuild native
mattleibow Dec 8, 2019
2b5f90f
Confidence is UP!
mattleibow Dec 8, 2019
c9dd5e4
Three!
mattleibow Dec 8, 2019
5f925ed
These seem to be tricky
mattleibow Dec 8, 2019
342b646
Getting a bit ahead of myself here
mattleibow Dec 8, 2019
dd0a89a
OK...
mattleibow Dec 8, 2019
ef3f103
no more!
mattleibow Dec 8, 2019
146e8da
Merge branch 'master' into dev/vs-2019
mattleibow Dec 8, 2019
6cdefd4
This,
mattleibow Dec 8, 2019
5568777
Update azure-pipelines.yml
mattleibow Dec 11, 2019
8984f5e
Update azure-templates-bootstrapper.yml
mattleibow Dec 11, 2019
a8e85ac
Update Dockerfile
mattleibow Dec 11, 2019
62e56a2
Change! Changes! Changes!
mattleibow Dec 14, 2019
ed32100
Merge branch 'master' into dev/vs-2019
mattleibow Dec 14, 2019
36693bd
Multitarget Views.Desktop.Common (#1067)
TysonMN Dec 19, 2019
bc3d08f
Multitarget Views.WPF (#1069)
TysonMN Dec 21, 2019
42b9b53
removed references from Views.WPF to OpenTK #1029 (#1078)
TysonMN Dec 21, 2019
f6ecca4
Install the fixer
mattleibow Dec 21, 2019
9466f39
Update depot_tools
mattleibow Dec 21, 2019
84c84e1
This.
mattleibow Dec 22, 2019
151aabd
Don't do any signing for macOS
mattleibow Dec 22, 2019
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
Prev Previous commit
Next Next commit
Merge branch 'master' into dev/vs-2019
  • Loading branch information
mattleibow committed Dec 8, 2019
commit a56f7ff7aba4e9520d72b0c3012d07ab0ac66631
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ Task ("nuget")
ValidPackageNamespace = new [] { "SkiaSharp", "HarfBuzzSharp" },
};

var nupkgFiles = GetFiles ("./output/nugets/*.nupkg");
var nupkgFiles = GetFiles ($"{OUTPUT_NUGETS_PATH}/*.nupkg");

Information ("Found ({0}) Nuget's to validate", nupkgFiles.Count ());

Expand Down
161 changes: 5 additions & 156 deletions cake/UtilsManaged.cake
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@

var MSBuildNS = (XNamespace) "http://schemas.microsoft.com/developer/msbuild/2003";

void PackageNuGet (FilePath nuspecPath, DirectoryPath outputPath)
void PackageNuGet(FilePath nuspecPath, DirectoryPath outputPath)
{
EnsureDirectoryExists(outputPath);
NuGetPack(nuspecPath, new NuGetPackSettings {
Expand Down Expand Up @@ -68,11 +65,11 @@ IEnumerable<(string Name, string Value)> CreateTraitsDictionary(string args)
}
}

void DecompressArchive (FilePath archive, DirectoryPath outputDir)
void DecompressArchive(FilePath archive, DirectoryPath outputDir)
{
using (var stream = System.IO.File.OpenRead (archive.FullPath))
using (var reader = ReaderFactory.Open (stream)) {
while (reader.MoveToNextEntry ()) {
using (var stream = System.IO.File.OpenRead(archive.FullPath))
using (var reader = ReaderFactory.Open(stream)) {
while(reader.MoveToNextEntry()) {
if (!reader.Entry.IsDirectory) {
reader.WriteEntryToDirectory(outputDir.FullPath, new ExtractionOptions {
ExtractFullPath = true,
Expand All @@ -83,154 +80,6 @@ void DecompressArchive (FilePath archive, DirectoryPath outputDir)
}
}

void CreateSamplesDirectory (DirectoryPath samplesDirPath, DirectoryPath outputDirPath, string versionSuffix = "")
{
samplesDirPath = MakeAbsolute (samplesDirPath);
outputDirPath = MakeAbsolute (outputDirPath);

var solutionProjectRegex = new Regex(@",\s*""(.*?\.\w{2}proj)"", ""(\{.*?\})""");

EnsureDirectoryExists (outputDirPath);
CleanDirectory (outputDirPath);

var ignoreBinObj = new GlobberSettings {
Predicate = fileSystemInfo => {
var segments = fileSystemInfo.Path.Segments;
var keep = segments.All (s =>
!s.Equals ("bin", StringComparison.OrdinalIgnoreCase) &&
!s.Equals ("obj", StringComparison.OrdinalIgnoreCase) &&
!s.Equals ("AppPackages", StringComparison.OrdinalIgnoreCase) &&
!s.Equals (".vs", StringComparison.OrdinalIgnoreCase));
return keep;
}
};

var files = GetFiles ($"{samplesDirPath}/**/*", ignoreBinObj);
foreach (var file in files) {
var rel = samplesDirPath.GetRelativePath (file);
var dest = outputDirPath.CombineWithFilePath (rel);
var ext = file.GetExtension () ?? "";

if (ext.Equals (".sln", StringComparison.OrdinalIgnoreCase)) {
var lines = FileReadLines (file.FullPath).ToList ();
var guids = new List<string> ();

// remove projects that aren't samples
for (var i = 0; i < lines.Count; i++) {
var line = lines [i];
var m = solutionProjectRegex.Match (line);
if (!m.Success)
continue;

// get the path of the project relative to the samples directory
var relProjectPath = (FilePath) m.Groups [1].Value;
var absProjectPath = GetFullPath (file, relProjectPath);
var relSamplesPath = samplesDirPath.GetRelativePath (absProjectPath);
if (!relSamplesPath.FullPath.StartsWith (".."))
continue;

Debug ($"Removing the project '{relProjectPath}' for solution '{rel}'.");

// skip the next line as it is the "EndProject" line
guids.Add (m.Groups [2].Value.ToLower ());
lines.RemoveAt (i--);
lines.RemoveAt (i--);
}

// remove all the other references to this guid
if (guids.Count > 0) {
for (var i = 0; i < lines.Count; i++) {
var line = lines [i];
foreach (var guid in guids) {
if (line.ToLower ().Contains (guid)) {
lines.RemoveAt (i--);
}
}
}
}

// save the solution
EnsureDirectoryExists (dest.GetDirectory ());
FileWriteLines (dest, lines.ToArray ());
} else if (ext.Equals (".csproj", StringComparison.OrdinalIgnoreCase)) {
var xdoc = XDocument.Load (file.FullPath);

// process all the files and project references
var projItems = xdoc.Root
.Elements ().Where (e => e.Name.LocalName == "ItemGroup")
.Elements ().Where (e => !string.IsNullOrWhiteSpace (e.Attribute ("Include")?.Value))
.ToArray ();
foreach (var projItem in projItems) {
// get files in the include
var relFilePath = (FilePath) projItem.Attribute ("Include").Value;
var absFilePath = GetFullPath (file, relFilePath);

// ignore files in the samples directory
var relSamplesPath = samplesDirPath.GetRelativePath (absFilePath);
if (!relSamplesPath.FullPath.StartsWith (".."))
continue;

// substitute <ProjectReference> with <PackageReference>
if (projItem.Name.LocalName == "ProjectReference" && FileExists (absFilePath)) {
var xReference = XDocument.Load (absFilePath.FullPath);
var packagingGroup = xReference.Root
.Elements ().Where (e => e.Name.LocalName == "PropertyGroup")
.Elements ().Where (e => e.Name.LocalName == "PackagingGroup")
.FirstOrDefault ()?.Value;
var version = GetVersion (packagingGroup);
if (!string.IsNullOrWhiteSpace (version)) {
Debug ($"Substituting project reference {relFilePath} for project {rel}.");
var name = projItem.Name.Namespace + "PackageReference";
var suffix = string.IsNullOrEmpty (versionSuffix) ? "" : $"-{versionSuffix}";
projItem.AddAfterSelf (new XElement (name, new object[] {
new XAttribute("Include", packagingGroup),
new XAttribute("Version", version + suffix),
}));
} else {
Warning ($"Unable to find version information for package '{packagingGroup}'.");
}
} else {
Debug ($"Removing the file '{relFilePath}' for project '{rel}'.");
}

// remove the element as it will be outside the sample directory
projItem.Remove ();
}

// process all the imports
var imports = xdoc.Root
.Elements ().Where (e =>
e.Name.LocalName == "Import" &&
!string.IsNullOrWhiteSpace (e.Attribute ("Project")?.Value))
.ToArray ();
foreach (var import in imports) {
var project = import.Attribute ("Project").Value;

// skip files inside the samples directory or do not exist
var absProject = GetFullPath (file, project);
var relSamplesPath = samplesDirPath.GetRelativePath (absProject);
if (!relSamplesPath.FullPath.StartsWith (".."))
continue;

Debug ($"Removing import '{project}' for project '{rel}'.");

// not inside the samples directory, so needs to be removed
import.Remove ();
}

// save the project
EnsureDirectoryExists (dest.GetDirectory ());
xdoc.Save (dest.FullPath);
} else {
EnsureDirectoryExists (dest.GetDirectory ());
CopyFile (file, dest);
}
}

DeleteFiles ($"{outputDirPath}/README.md");
MoveFile ($"{outputDirPath}/README.zip.md", $"{outputDirPath}/README.md");
}

IEnumerable<(DirectoryPath path, string platform)> GetPlatformDirectories(DirectoryPath rootDir)
{
var platformDirs = GetDirectories($"{rootDir}/*");
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.