Skip to content
This repository was archived by the owner on Mar 1, 2021. It is now read-only.

Commit c4fc05c

Browse files
committed
(#1) Basic Implementation
- In general, things are working - When using --tool-path, something isn't quite working right
1 parent f510127 commit c4fc05c

21 files changed

+1493
-0
lines changed

.gitignore

Lines changed: 282 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
##
4+
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5+
6+
# User-specific files
7+
*.suo
8+
*.user
9+
*.userosscache
10+
*.sln.docstates
11+
12+
# User-specific files (MonoDevelop/Xamarin Studio)
13+
*.userprefs
14+
15+
# Build results
16+
[Dd]ebug/
17+
[Dd]ebugPublic/
18+
[Rr]elease/
19+
[Rr]eleases/
20+
x64/
21+
x86/
22+
bld/
23+
[Bb]in/
24+
[Oo]bj/
25+
[Ll]og/
26+
27+
# Visual Studio 2015 cache/options directory
28+
.vs/
29+
# Uncomment if you have tasks that create the project's static files in wwwroot
30+
#wwwroot/
31+
32+
# MSTest test Results
33+
[Tt]est[Rr]esult*/
34+
[Bb]uild[Ll]og.*
35+
36+
# NUNIT
37+
*.VisualState.xml
38+
TestResult.xml
39+
40+
# Build Results of an ATL Project
41+
[Dd]ebugPS/
42+
[Rr]eleasePS/
43+
dlldata.c
44+
45+
# .NET Core
46+
project.lock.json
47+
project.fragment.lock.json
48+
artifacts/
49+
**/Properties/launchSettings.json
50+
51+
*_i.c
52+
*_p.c
53+
*_i.h
54+
*.ilk
55+
*.meta
56+
*.obj
57+
*.pch
58+
*.pdb
59+
*.pgc
60+
*.pgd
61+
*.rsp
62+
*.sbr
63+
*.tlb
64+
*.tli
65+
*.tlh
66+
*.tmp
67+
*.tmp_proj
68+
*.log
69+
*.vspscc
70+
*.vssscc
71+
.builds
72+
*.pidb
73+
*.svclog
74+
*.scc
75+
76+
# Chutzpah Test files
77+
_Chutzpah*
78+
79+
# Visual C++ cache files
80+
ipch/
81+
*.aps
82+
*.ncb
83+
*.opendb
84+
*.opensdf
85+
*.sdf
86+
*.cachefile
87+
*.VC.db
88+
*.VC.VC.opendb
89+
90+
# Visual Studio profiler
91+
*.psess
92+
*.vsp
93+
*.vspx
94+
*.sap
95+
96+
# TFS 2012 Local Workspace
97+
$tf/
98+
99+
# Guidance Automation Toolkit
100+
*.gpState
101+
102+
# ReSharper is a .NET coding add-in
103+
_ReSharper*/
104+
*.[Rr]e[Ss]harper
105+
*.DotSettings.user
106+
107+
# JustCode is a .NET coding add-in
108+
.JustCode
109+
110+
# TeamCity is a build add-in
111+
_TeamCity*
112+
113+
# DotCover is a Code Coverage Tool
114+
*.dotCover
115+
116+
# Visual Studio code coverage results
117+
*.coverage
118+
*.coveragexml
119+
120+
# NCrunch
121+
_NCrunch_*
122+
.*crunch*.local.xml
123+
nCrunchTemp_*
124+
125+
# MightyMoose
126+
*.mm.*
127+
AutoTest.Net/
128+
129+
# Web workbench (sass)
130+
.sass-cache/
131+
132+
# Installshield output folder
133+
[Ee]xpress/
134+
135+
# DocProject is a documentation generator add-in
136+
DocProject/buildhelp/
137+
DocProject/Help/*.HxT
138+
DocProject/Help/*.HxC
139+
DocProject/Help/*.hhc
140+
DocProject/Help/*.hhk
141+
DocProject/Help/*.hhp
142+
DocProject/Help/Html2
143+
DocProject/Help/html
144+
145+
# Click-Once directory
146+
publish/
147+
148+
# Publish Web Output
149+
*.[Pp]ublish.xml
150+
*.azurePubxml
151+
# TODO: Comment the next line if you want to checkin your web deploy settings
152+
# but database connection strings (with potential passwords) will be unencrypted
153+
*.pubxml
154+
*.publishproj
155+
156+
# Microsoft Azure Web App publish settings. Comment the next line if you want to
157+
# checkin your Azure Web App publish settings, but sensitive information contained
158+
# in these scripts will be unencrypted
159+
PublishScripts/
160+
161+
# NuGet Packages
162+
*.nupkg
163+
# The packages folder can be ignored because of Package Restore
164+
**/packages/*
165+
# except build/, which is used as an MSBuild target.
166+
!**/packages/build/
167+
# Uncomment if necessary however generally it will be regenerated when needed
168+
#!**/packages/repositories.config
169+
# NuGet v3's project.json files produces more ignoreable files
170+
*.nuget.props
171+
*.nuget.targets
172+
173+
# Microsoft Azure Build Output
174+
csx/
175+
*.build.csdef
176+
177+
# Microsoft Azure Emulator
178+
ecf/
179+
rcf/
180+
181+
# Windows Store app package directories and files
182+
AppPackages/
183+
BundleArtifacts/
184+
Package.StoreAssociation.xml
185+
_pkginfo.txt
186+
187+
# Visual Studio cache files
188+
# files ending in .cache can be ignored
189+
*.[Cc]ache
190+
# but keep track of directories ending in .cache
191+
!*.[Cc]ache/
192+
193+
# Others
194+
ClientBin/
195+
~$*
196+
*~
197+
*.dbmdl
198+
*.dbproj.schemaview
199+
*.jfm
200+
*.pfx
201+
*.publishsettings
202+
node_modules/
203+
orleans.codegen.cs
204+
205+
# Since there are multiple workflows, uncomment next line to ignore bower_components
206+
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
207+
#bower_components/
208+
209+
# RIA/Silverlight projects
210+
Generated_Code/
211+
212+
# Backup & report files from converting an old project file
213+
# to a newer Visual Studio version. Backup files are not needed,
214+
# because we have git ;-)
215+
_UpgradeReport_Files/
216+
Backup*/
217+
UpgradeLog*.XML
218+
UpgradeLog*.htm
219+
220+
# SQL Server files
221+
*.mdf
222+
*.ldf
223+
224+
# Business Intelligence projects
225+
*.rdl.data
226+
*.bim.layout
227+
*.bim_*.settings
228+
229+
# Microsoft Fakes
230+
FakesAssemblies/
231+
232+
# GhostDoc plugin setting file
233+
*.GhostDoc.xml
234+
235+
# Node.js Tools for Visual Studio
236+
.ntvs_analysis.dat
237+
238+
# Visual Studio 6 build log
239+
*.plg
240+
241+
# Visual Studio 6 workspace options file
242+
*.opt
243+
244+
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
245+
*.vbw
246+
247+
# Visual Studio LightSwitch build output
248+
**/*.HTMLClient/GeneratedArtifacts
249+
**/*.DesktopClient/GeneratedArtifacts
250+
**/*.DesktopClient/ModelManifest.xml
251+
**/*.Server/GeneratedArtifacts
252+
**/*.Server/ModelManifest.xml
253+
_Pvt_Extensions
254+
255+
# Paket dependency manager
256+
.paket/paket.exe
257+
paket-files/
258+
259+
# FAKE - F# Make
260+
.fake/
261+
262+
# JetBrains Rider
263+
.idea/
264+
*.sln.iml
265+
266+
# CodeRush
267+
.cr/
268+
269+
# Python Tools for Visual Studio (PTVS)
270+
__pycache__/
271+
*.pyc
272+
273+
# Cake - Uncomment if you are using it
274+
tools/**
275+
!tools/packages.config
276+
BuildArtifacts/
277+
278+
# Mac Development
279+
.DS_Store
280+
281+
# Testing
282+
test/tools/Modules/*.dll

GitReleaseManager.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
issue-labels-include:
2+
- Breaking change
3+
- Feature
4+
- Bug
5+
- Improvement
6+
- Documentation
7+
issue-labels-exclude:
8+
- Build
9+
issue-labels-alias:
10+
- name: Documentation
11+
header: Documentation
12+
plural: Documentation
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp2.0</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="Cake.Core" Version="0.28.0">
9+
<PrivateAssets>all</PrivateAssets>
10+
</PackageReference>
11+
<PackageReference Include="Cake.Testing" Version="0.28.0">
12+
<PrivateAssets>all</PrivateAssets>
13+
</PackageReference>
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.0" />
15+
<PackageReference Include="xunit" Version="2.3.1" />
16+
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
17+
<PackageReference Include="NSubstitute" Version="3.1.0" />
18+
</ItemGroup>
19+
20+
<ItemGroup>
21+
<ProjectReference Include="..\Cake.DotNet.Module\Cake.DotNet.Module.csproj" />
22+
</ItemGroup>
23+
24+
</Project>
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
using Cake.Core;
2+
using Cake.Core.Configuration;
3+
using Cake.Core.Diagnostics;
4+
using Cake.Core.IO;
5+
using Cake.Core.Packaging;
6+
using Cake.Testing;
7+
using NSubstitute;
8+
using System.Collections.Generic;
9+
10+
namespace Cake.DotNet.Module.Tests
11+
{
12+
/// <summary>
13+
/// Fixture used for testing DotNetPackageInstaller
14+
/// </summary>
15+
internal sealed class DotNetPackageInstallerFixture
16+
{
17+
public ICakeEnvironment Environment { get; set; }
18+
public IFileSystem FileSystem { get; set; }
19+
public IProcessRunner ProcessRunner { get; set; }
20+
public IDotNetContentResolver ContentResolver { get; set; }
21+
public ICakeLog Log { get; set; }
22+
23+
public PackageReference Package { get; set; }
24+
public PackageType PackageType { get; set; }
25+
public DirectoryPath InstallPath { get; set; }
26+
27+
public ICakeConfiguration Config { get; set; }
28+
29+
/// <summary>
30+
/// Initializes a new instance of the <see cref="DotNetPackageInstallerFixture"/> class.
31+
/// </summary>
32+
internal DotNetPackageInstallerFixture()
33+
{
34+
Environment = FakeEnvironment.CreateUnixEnvironment();
35+
FileSystem = new FakeFileSystem(Environment);
36+
ProcessRunner = Substitute.For<IProcessRunner>();
37+
ContentResolver = Substitute.For<IDotNetContentResolver>();
38+
Log = new FakeLog();
39+
Config = Substitute.For<ICakeConfiguration>();
40+
Package = new PackageReference("dotnet:?package=windirstat");
41+
PackageType = PackageType.Addin;
42+
InstallPath = new DirectoryPath("./dotnet");
43+
}
44+
45+
/// <summary>
46+
/// Create the installer.
47+
/// </summary>
48+
/// <returns>The DotNet package installer.</returns>
49+
internal DotNetPackageInstaller CreateInstaller()
50+
{
51+
return new DotNetPackageInstaller(Environment, ProcessRunner, Log, ContentResolver, Config, FileSystem);
52+
}
53+
54+
/// <summary>DotNetPackageInstallerFixture
55+
/// Installs the specified resource at the given location.
56+
/// </summary>
57+
/// <returns>The installed files.</returns>
58+
internal IReadOnlyCollection<IFile> Install()
59+
{
60+
var installer = CreateInstaller();
61+
return installer.Install(Package, PackageType, InstallPath);
62+
}
63+
64+
/// <summary>
65+
/// Determines whether this instance can install the specified resource.
66+
/// </summary>
67+
/// <returns><c>true</c> if this installer can install the specified resource; otherwise <c>false</c>.</returns>
68+
internal bool CanInstall()
69+
{
70+
var installer = CreateInstaller();
71+
return installer.CanInstall(Package, PackageType);
72+
}
73+
}
74+
}

0 commit comments

Comments
 (0)