Skip to content

Commit

Permalink
Merge pull request #460 from seesharper/feature/sourcelink
Browse files Browse the repository at this point in the history
SourceLink and XML comments
  • Loading branch information
seesharper authored Nov 10, 2018
2 parents cd5c1d8 + 3ca046f commit b016775
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 72 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ local.properties
Artifacts
CoverageResult
*.exe
.DS_Store

# External tool builders
.externalToolBuilders/
Expand Down
2 changes: 1 addition & 1 deletion build/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"program": "dotnet",
"args": [
"exec",
"/Users/bernhardrichter/.dotnet/tools/.store/dotnet-script/0.26.1/dotnet-script/0.26.1/tools/netcoreapp2.1/any/dotnet-script.dll"
"/Users/bernhardrichter/.dotnet/tools/.store/dotnet-script/0.27.1/dotnet-script/0.27.1/tools/netcoreapp2.1/any/dotnet-script.dll"
"${file}"
],
"cwd": "${workspaceRoot}",
Expand Down
21 changes: 12 additions & 9 deletions build/BuildContext.csx
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
#load "nuget:Dotnet.Build, 0.3.8"
#load "nuget:Dotnet.Build, 0.3.9"
using static FileUtils;
using System.Xml.Linq;

var owner = "seesharper";
var projectName = "LightInject";
var root = FileUtils.GetScriptFolder();
var solutionFolder = Path.Combine(root,"..","src");

var repoFolder = Path.Combine(root, "..");

var projectFolder = Path.Combine(root, "..", "src", "LightInject");

var testProjectFolder = Path.Combine(root, "..", "src", "LightInject.Tests");

var pathToTestAssembly = Path.Combine(testProjectFolder, "bin","release", "net46", "LightInject.Tests.dll");


var artifactsFolder = CreateDirectory(root, "Artifacts");
var gitHubArtifactsFolder = CreateDirectory(artifactsFolder, "GitHub");
var nuGetArtifactsFolder = CreateDirectory(artifactsFolder, "NuGet");

string[] exceptTheseTypes = new string[] {
"IProxy",
"IInvocationInfo",
"IMethodBuilder",
"IDynamicMethodSkeleton",
"IProxyBuilder",
"IInterceptor",
"IInvocationInfo",
"IMethodBuilder",
"IDynamicMethodSkeleton",
"IProxyBuilder",
"IInterceptor",
"MethodInterceptorFactory",
"TargetMethodInfo",
"OpenGenericTargetMethodInfo",
Expand All @@ -33,8 +36,8 @@ string[] exceptTheseTypes = new string[] {
"InterceptorInvocationInfo",
"CompositeInterceptor",
"InterceptorInfo",
"ProxyDefinition"
};
"ProxyDefinition"
};

var pathToReleaseNotes = Path.Combine(gitHubArtifactsFolder, "ReleaseNotes.md");

Expand Down
20 changes: 10 additions & 10 deletions build/build.csx
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ Test(testProjectFolder);
//AnalyzeCodeCoverage(pathToTestAssembly, $"+[{projectName}]*");
Pack(projectFolder, nuGetArtifactsFolder, Git.Default.GetCurrentShortCommitHash());

using(var sourceBuildFolder = new DisposableFolder())
using(var sourceRepoFolder = new DisposableFolder())
{
string pathToSourceProjectFolder = Path.Combine(sourceBuildFolder.Path,"LightInject");
Copy(solutionFolder, sourceBuildFolder.Path, new [] {".vs", "obj"});
Internalize(pathToSourceProjectFolder, exceptTheseTypes);
DotNet.Build(Path.Combine(sourceBuildFolder.Path,"LightInject"));
string pathToSourceProjectFolder = Path.Combine(sourceRepoFolder.Path,"src","LightInject");
Copy(repoFolder, sourceRepoFolder.Path, new [] {".vs", "obj"});
Internalize(pathToSourceProjectFolder, exceptTheseTypes);
DotNet.Build(Path.Combine(sourceRepoFolder.Path,"src","LightInject"));
using(var nugetPackFolder = new DisposableFolder())
{
var contentFolder = CreateDirectory(nugetPackFolder.Path, "content","net45", "LightInject");
Copy("LightInject.Source.nuspec", nugetPackFolder.Path);
string pathToSourceFileTemplate = Path.Combine(contentFolder, "LightInject.cs.pp");
Copy(Path.Combine(pathToSourceProjectFolder, "LightInject.cs"), pathToSourceFileTemplate);
Copy(Path.Combine(pathToSourceProjectFolder, "LightInject.cs"), pathToSourceFileTemplate);
FileUtils.ReplaceInFile(@"namespace \S*", $"namespace $rootnamespace$.{projectName}", pathToSourceFileTemplate);
NuGet.Pack(nugetPackFolder.Path, nuGetArtifactsFolder, version);
}
Expand All @@ -39,17 +39,17 @@ if (BuildEnvironment.IsSecure)
Git.Default.RequreCleanWorkingTree();
await ReleaseManagerFor(owner, projectName,BuildEnvironment.GitHubAccessToken)
.CreateRelease(Git.Default.GetLatestTag(), pathToReleaseNotes, Array.Empty<ReleaseAsset>());
NuGet.TryPush(nuGetArtifactsFolder);
NuGet.TryPush(nuGetArtifactsFolder);
}
}

private async Task CreateReleaseNotes()
{
Logger.Log("Creating release notes");
Logger.Log("Creating release notes");
var generator = ChangeLogFrom(owner, projectName, BuildEnvironment.GitHubAccessToken).SinceLatestTag();
if (!Git.Default.IsTagCommit())
{
generator = generator.IncludeUnreleased();
generator = generator.IncludeUnreleased();
}
await generator.Generate(pathToReleaseNotes, FormattingOptions.Default.WithPullRequestBody());
}
}
20 changes: 10 additions & 10 deletions src/LightInject.Tests/LightInject.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;netcoreapp1.1;net46;net452</TargetFrameworks>

</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.2.1">
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.3.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</PackageReference>
<PackageReference Include="LightMock" Version="1.0.1" />

<PackageReference Include="System.Reflection.Emit" Version="4.3.0" />

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />

<PackageReference Include="System.Reflection.Emit.ILGeneration" Version="4.3.0" />
<DotNetCliToolReference Include="dotnet-reportgenerator-cli" Version="4.0.0-rc4" />


<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0">
<PrivateAssets>all</PrivateAssets>
Expand Down
Loading

0 comments on commit b016775

Please sign in to comment.