Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ennerperez committed Mar 15, 2020
2 parents bc36d30 + de9539a commit b039c28
Show file tree
Hide file tree
Showing 52 changed files with 2,414 additions and 251 deletions.
423 changes: 400 additions & 23 deletions .gitignore

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [1.1.26] - [2020-03-14]
### Changed
- NuGet Packages Definition
- Missing Files

## [1.1.25] - [2018-06-06]
### Fixed
- Critical missing targets files

## [1.1.24] - [2017-07-02]
### Fixed
- Critical missing targets files
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 Enner Pérez
Copyright (c) Enner Pérez

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
39 changes: 0 additions & 39 deletions Microsoft.Bcl.Build.Symbols.sln

This file was deleted.

This file was deleted.

7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![logo](http://go.microsoft.com/fwlink/?LinkID=288859)
![logo](src/.editoricon.png)

# Microsoft.Bcl.Build.Symbols

Expand All @@ -18,7 +18,10 @@ See the [changelog](CHANGELOG.md) for changes.

## Roadmap

- [x] .NET Framework 4.7
- [ ] .NET Core 1.0-3.1
- [ ] .NET Standards 1.0-2.1
- [x] .NET Framework 4.8
- [x] .NET Framework 4.7.1-2
- [x] .NET Framework 4.6.1-2
- [x] .NET Framework 2.0 to 4.5.2
- [x] .NET Portable
Expand Down
127 changes: 75 additions & 52 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#tool nuget:?package=NUnit.ConsoleRunner&version=3.4.0
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
Expand All @@ -9,20 +10,20 @@ var configuration = Argument("configuration", "Release");
// PREPARATION
//////////////////////////////////////////////////////////////////////

// Define solution.
var solution = "./Microsoft.Bcl.Build.Symbols.sln";
// Define directories.
var buildDir = Directory("./build") + Directory(configuration);

// Define solutions.
var solutions = new Dictionary<string, string> {
{ "./src/Microsoft.Bcl.Build.Symbols.sln", "Any" },
};

// Define AssemblyInfo source.
var assemblyInfoVersion = ParseAssemblyInfo("./Microsoft.Bcl.Build.Symbols/Properties/AssemblyInfo.cs");
var assemblyInfoVersion = ParseAssemblyInfo("./src/Microsoft.Bcl.Build.Symbols/Properties/AssemblyInfo.cs");

// Define version.
var elapsedSpan = new TimeSpan(DateTime.Now.Ticks - new DateTime(2001, 1, 1).Ticks);
var assemblyVersion = assemblyInfoVersion.AssemblyVersion.Replace("*", elapsedSpan.Ticks.ToString().Substring(4, 4));
var version = EnvironmentVariable ("APPVEYOR_BUILD_VERSION") ?? Argument("version", assemblyVersion);

// Define directories.
var outputDirectory = "Build/" + configuration;
var buildDir = Directory("../" + outputDirectory);
var assemblyVersion = assemblyInfoVersion.AssemblyVersion.Replace(".*", "");
var version = EnvironmentVariable("APPVEYOR_BUILD_VERSION") ?? Argument("version", assemblyVersion);

//////////////////////////////////////////////////////////////////////
// TASKS
Expand All @@ -32,74 +33,96 @@ Task("Clean")
.Does(() =>
{
CleanDirectory(buildDir);
CleanDirectories("./**/bin");
CleanDirectories("./**/obj");
CleanDirectories("./**/samples/packages");
});

Task("Restore-NuGet-Packages")
.IsDependentOn("Clean")
.Does(() =>
{
NuGetRestore(solution);
foreach (var solution in solutions)
{
NuGetRestore(solution.Key);
}
});

Task("Build")
.IsDependentOn("Restore-NuGet-Packages")
.Does(() =>
{

if(IsRunningOnWindows())
foreach (var file in solutions)
{
var settings = new MSBuildSettings()
.WithProperty("OutputPath", buildDir)
.WithProperty("PackageVersion", version)
.WithProperty("BuildSymbolsPackage", "false");
settings.SetConfiguration(configuration);
// Use MSBuild
MSBuild(solution, settings);
}
else
{
var settings = new XBuildSettings()
.WithProperty("OutputPath", buildDir)
.WithProperty("PackageVersion", version)
.WithProperty("BuildSymbolsPackage", "false");
settings.SetConfiguration(configuration);
// Use XBuild
XBuild(solution, settings);
if (IsRunningOnWindows())
{
var settings = new MSBuildSettings()
.WithProperty("PackageVersion", version)
.WithProperty("BuildSymbolsPackage", "false")
.WithProperty("ToolVersion","MSBuildToolVersion.VS2019");
settings.SetConfiguration(configuration);
// Use MSBuild
MSBuild(file.Key, settings);
}
else
{
var settings = new XBuildSettings()
.WithProperty("PackageVersion", version)
.WithProperty("BuildSymbolsPackage", "false");
settings.SetConfiguration(configuration);
// Use XBuild
XBuild(file.Key, settings);
}
}

});

Task("Build-NuGet-Packages")
.IsDependentOn("Build")
.Does(() =>
{
foreach (var folder in new System.IO.FileInfo(solution).Directory.GetDirectories())
foreach (var file in folder.GetFiles("*.nuspec"))
{
var assemblyInfo = ParseAssemblyInfo(folder + "/Properties/AssemblyInfo.cs");
var nuGetPackSettings = new NuGetPackSettings()
{
OutputDirectory = outputDirectory,
IncludeReferencedProjects = true,
Id = assemblyInfo.Title.Replace(" ", "."),
Title = assemblyInfo.Title,
Version = version,
Authors = new [] {assemblyInfo.Company},
Summary = assemblyInfo.Description,
Copyright = assemblyInfo.Copyright,
Properties = new Dictionary<string, string>()
{
{ "Configuration", configuration }
}
};
NuGetPack(file.FullName, nuGetPackSettings);
}
});
foreach (var solution in solutions)
{
foreach (var folder in new System.IO.FileInfo(solution.Key).Directory.GetDirectories())
{
foreach (var file in folder.GetFiles("*.nuspec"))
{
var path = file.Directory;
var assemblyInfo = ParseAssemblyInfo(path + "/Properties/AssemblyInfo.cs");
var nuGetPackSettings = new NuGetPackSettings()
{
OutputDirectory = buildDir,
IncludeReferencedProjects = false,
Id = assemblyInfo.Title.Replace(" ", "."),
Title = assemblyInfo.Title,
Version = version,
Authors = new[] { assemblyInfoVersion.Company },
Summary = assemblyInfo.Description,
Copyright = assemblyInfoVersion.Copyright,
Properties = new Dictionary<string, string>()
{{ "Configuration", configuration }}
};
NuGetPack(file.FullName, nuGetPackSettings);
}
}
}
});

Task("Run-Unit-Tests")
.IsDependentOn("Build")
.Does(() =>
{
NUnit3("./src/**/bin/" + configuration + "/*.Tests.dll", new NUnit3Settings {
NoResults = true
});
});

//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////

Task("Default")
.IsDependentOn("Run-Unit-Tests")
.IsDependentOn("Build-NuGet-Packages");

//////////////////////////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit b039c28

Please sign in to comment.