Skip to content
This repository was archived by the owner on Jul 3, 2020. It is now read-only.

Commit 1054272

Browse files
committed
general: add lock file and cache nuget packages on circle ci
Signed-off-by: Luís Ferreira <[email protected]>
1 parent 9ad6613 commit 1054272

File tree

6 files changed

+996
-0
lines changed

6 files changed

+996
-0
lines changed

.circleci/config.yml

+16
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@ jobs:
1212
- checkout
1313
- attach_workspace:
1414
at: ~/
15+
- run:
16+
name: Generate cache key
17+
command: |
18+
shasum src/packages.lock.json \
19+
test/CSharpCoverage.Tests/packages.lock.json > /tmp/dependencies.cache.tmp
20+
- restore_cache:
21+
keys:
22+
- nuget-v1-{{ checksum "/tmp/dependencies.cache.tmp" }}
23+
- nuget-v1-
24+
- run:
25+
name: Restore
26+
command: dotnet restore
27+
- save_cache:
28+
key: nuget-v1-{{ checksum "/tmp/dependencies.cache.tmp" }}
29+
paths:
30+
- "packages"
1531
- run:
1632
name: Compile
1733
command: dotnet build -c Debug

nuget.config

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<configuration>
2+
<config>
3+
<add key="globalPackagesFolder" value="packages" />
4+
</config>
5+
</configuration>

src/Codacy.CSharpCoverage.csproj

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<RootNamespace>Codacy.CSharpCoverage</RootNamespace>
5+
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
56
<DebugType Condition=" '$(Configuration)' == 'Release' ">None</DebugType>
67
<TargetFramework Condition=" '$(UsePreviewVersion)' == true ">netcoreapp3.0</TargetFramework>
78
<TargetFramework Condition=" '$(UsePreviewVersion)' != true ">netcoreapp2.2</TargetFramework>
@@ -10,4 +11,13 @@
1011
<PackageReference Include="CommandLineParser" Version="2.5.0" />
1112
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
1213
</ItemGroup>
14+
<ItemGroup>
15+
<Compile Remove="packages\**" />
16+
</ItemGroup>
17+
<ItemGroup>
18+
<EmbeddedResource Remove="packages\**" />
19+
</ItemGroup>
20+
<ItemGroup>
21+
<None Remove="packages\**" />
22+
</ItemGroup>
1323
</Project>

src/packages.lock.json

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"version": 1,
3+
"dependencies": {
4+
".NETCoreApp,Version=v2.2": {
5+
"CommandLineParser": {
6+
"type": "Direct",
7+
"requested": "[2.5.0, )",
8+
"resolved": "2.5.0",
9+
"contentHash": "ukoCfILrFB5+Trg0a8LHpNMyNyLicXG08SvWAl0BAwDATS7bzNbdSxemHM8waj7ZMOfXJ5s4exHW6Jp1XEC5DA=="
10+
},
11+
"Microsoft.NETCore.App": {
12+
"type": "Direct",
13+
"requested": "[2.2.0, )",
14+
"resolved": "2.2.0",
15+
"contentHash": "7z5l8Jp324S8bU8+yyWeYHXUFYvKyiI5lqS1dXgTzOx1H69Qbf6df12kCKlNX45LpMfCMd4U3M6p7Rl5Zk7SLA==",
16+
"dependencies": {
17+
"Microsoft.NETCore.DotNetHostPolicy": "2.2.0",
18+
"Microsoft.NETCore.Platforms": "2.2.0",
19+
"Microsoft.NETCore.Targets": "2.0.0",
20+
"NETStandard.Library": "2.0.3"
21+
}
22+
},
23+
"Newtonsoft.Json": {
24+
"type": "Direct",
25+
"requested": "[12.0.2, )",
26+
"resolved": "12.0.2",
27+
"contentHash": "rTK0s2EKlfHsQsH6Yx2smvcTCeyoDNgCW7FEYyV01drPlh2T243PR2DiDXqtC5N4GDm4Ma/lkxfW5a/4793vbA=="
28+
},
29+
"Microsoft.NETCore.DotNetAppHost": {
30+
"type": "Transitive",
31+
"resolved": "2.2.0",
32+
"contentHash": "DrhaKInRKKvN6Ns2VNIlC7ZffLOp9THf8cO6X4fytPRJovJUbF49/zzx4WfgX9E44FMsw9hT8hrKiIqDSHvGvA=="
33+
},
34+
"Microsoft.NETCore.DotNetHostPolicy": {
35+
"type": "Transitive",
36+
"resolved": "2.2.0",
37+
"contentHash": "FJie7IoPZFaPgNDxhZGmDBQP/Bs5vPdfca/G2Wf9gd6LIvMYkZcibtmJwB4tcf4KXkaOYfIOo4Cl9sEPMsSzkw==",
38+
"dependencies": {
39+
"Microsoft.NETCore.DotNetHostResolver": "2.2.0"
40+
}
41+
},
42+
"Microsoft.NETCore.DotNetHostResolver": {
43+
"type": "Transitive",
44+
"resolved": "2.2.0",
45+
"contentHash": "spDm3AJYmebthDNhzY17YLPtvbc+Y1lCLVeiIH1uLJ/hZaM+40pBiPefFR8J1u66Ndkqi8ipR2tEbqPnYnjRhw==",
46+
"dependencies": {
47+
"Microsoft.NETCore.DotNetAppHost": "2.2.0"
48+
}
49+
},
50+
"Microsoft.NETCore.Platforms": {
51+
"type": "Transitive",
52+
"resolved": "2.2.0",
53+
"contentHash": "T/J+XZo+YheFTJh8/4uoeJDdz5qOmOMkjg6/VL8mHJ9AnP8+fmV/kcbxeXsob0irRNiChf+V0ig1MCRLp/+Kog=="
54+
},
55+
"Microsoft.NETCore.Targets": {
56+
"type": "Transitive",
57+
"resolved": "2.0.0",
58+
"contentHash": "odP/tJj1z6GylFpNo7pMtbd/xQgTC3Ex2If63dRTL38bBNMwsBnJ+RceUIyHdRBC0oik/3NehYT+oECwBhIM3Q=="
59+
},
60+
"NETStandard.Library": {
61+
"type": "Transitive",
62+
"resolved": "2.0.3",
63+
"contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
64+
"dependencies": {
65+
"Microsoft.NETCore.Platforms": "1.1.0"
66+
}
67+
}
68+
}
69+
}
70+
}

test/CSharpCoverage.Tests/CSharpCoverage.Tests.csproj

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<IsPackable>false</IsPackable>
44
<IsTestProject>true</IsTestProject>
55
<RootNamespace>Codacy.CSharpCoverage.Tests</RootNamespace>
6+
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
67
<TargetFramework Condition=" '$(UsePreviewVersion)' == true ">netcoreapp3.0</TargetFramework>
78
<TargetFramework Condition=" '$(UsePreviewVersion)' != true ">netcoreapp2.2</TargetFramework>
89
</PropertyGroup>
@@ -19,5 +20,12 @@
1920
<Content Include="Resources\**\*.xml">
2021
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2122
</Content>
23+
<Compile Remove="packages\**" />
24+
</ItemGroup>
25+
<ItemGroup>
26+
<EmbeddedResource Remove="packages\**" />
27+
</ItemGroup>
28+
<ItemGroup>
29+
<None Remove="packages\**" />
2230
</ItemGroup>
2331
</Project>

0 commit comments

Comments
 (0)