Skip to content

Commit 78eafa2

Browse files
authored
Merge pull request #225 from qiniu/fix/dotnetcore2_0
Fix/dotnetcore2 0
2 parents 55e6109 + c6398b0 commit 78eafa2

File tree

20 files changed

+156
-404
lines changed

20 files changed

+156
-404
lines changed

.github/workflows/test-ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CSHARP CI
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '**.md'
7+
8+
jobs:
9+
build:
10+
strategy:
11+
fail-fast: false
12+
max-parallel: 1
13+
14+
runs-on: windows-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
19+
- name: Setup
20+
uses: actions/setup-dotnet@v1
21+
with:
22+
dotnet-version: 2.1.502
23+
24+
- name: Build
25+
run: dotnet build src/Qiniu/Qiniu.csproj
26+
27+
- name: Test
28+
run: dotnet test src/QiniuTests/QiniuTests.csproj
29+
30+
env:
31+
QINIU_ACCESS_KEY: ${{ secrets.QINIU_ACCESS_KEY }}
32+
QINIU_SECRET_KEY: ${{ secrets.QINIU_SECRET_KEY }}
33+
QINIU_TEST_BUCKET: ${{ secrets.QINIU_TEST_BUCKET }}
34+
QINIU_TEST_DOMAIN: ${{ secrets.QINIU_TEST_DOMAIN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ _ReSharper*/
3030
/src/packages
3131
/packages
3232
/bin
33+
.vs
34+
/src/QiniuTests/TestEnv.cs
35+
/src/QiniuTests/coverage.json

.travis.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

Makefile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
build-and-test:
2-
mkdir -p bin/
3-
cp tools/net40/Newtonsoft.Json.dll bin/
4-
cp tools/net40/nunit.framework.dll bin/
5-
cp tools/files/* bin/
1+
.PHONY: build-and-test build test publish
62

7-
8-
xbuild src/Qiniu.sln
9-
10-
nunit-console bin/QiniuTests.dll
3+
build-and-test: build test
4+
build:
5+
dotnet build src/Qiniu/Qiniu.csproj
6+
test:
7+
dotnet test src/QiniuTests/QiniuTests.csproj
8+
publish:
9+
dotnet publish src/Qiniu/Qiniu.csproj -c Release -f netstandard2.0

src/Qiniu.sln

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27004.2002
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29102.190
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qiniu", "Qiniu\Qiniu.csproj", "{2F5B0328-DE8B-4B53-A500-3077E340A51B}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Qiniu", "Qiniu\Qiniu.csproj", "{2F5B0328-DE8B-4B53-A500-3077E340A51B}"
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QiniuTests", "QiniuTests\QiniuTests.csproj", "{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}"
99
EndProject
@@ -17,26 +17,28 @@ Global
1717
Release|x86 = Release|x86
1818
EndGlobalSection
1919
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20-
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Debug|Any CPU.ActiveCfg = Debug|x86
21-
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Debug|x64.ActiveCfg = Debug|x64
22-
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Debug|x64.Build.0 = Debug|x64
23-
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Debug|x86.ActiveCfg = Debug|x86
24-
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Debug|x86.Build.0 = Debug|x86
25-
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Release|Any CPU.ActiveCfg = Release|x86
26-
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Release|x64.ActiveCfg = Release|x64
27-
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Release|x64.Build.0 = Release|x64
28-
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Release|x86.ActiveCfg = Release|x86
29-
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Release|x86.Build.0 = Release|x86
20+
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Debug|x64.ActiveCfg = Debug|Any CPU
23+
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Debug|x64.Build.0 = Debug|Any CPU
24+
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Debug|x86.ActiveCfg = Debug|Any CPU
25+
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Debug|x86.Build.0 = Debug|Any CPU
26+
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Release|x64.ActiveCfg = Release|Any CPU
29+
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Release|x64.Build.0 = Release|Any CPU
30+
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Release|x86.ActiveCfg = Release|Any CPU
31+
{2F5B0328-DE8B-4B53-A500-3077E340A51B}.Release|x86.Build.0 = Release|Any CPU
3032
{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3133
{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
32-
{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}.Debug|x64.ActiveCfg = Debug|x64
33-
{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}.Debug|x64.Build.0 = Debug|x64
34+
{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}.Debug|x64.ActiveCfg = Debug|Any CPU
35+
{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}.Debug|x64.Build.0 = Debug|Any CPU
3436
{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}.Debug|x86.ActiveCfg = Debug|Any CPU
3537
{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}.Debug|x86.Build.0 = Debug|Any CPU
3638
{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
3739
{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}.Release|Any CPU.Build.0 = Release|Any CPU
38-
{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}.Release|x64.ActiveCfg = Release|x64
39-
{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}.Release|x64.Build.0 = Release|x64
40+
{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}.Release|x64.ActiveCfg = Release|Any CPU
41+
{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}.Release|x64.Build.0 = Release|Any CPU
4042
{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}.Release|x86.ActiveCfg = Release|Any CPU
4143
{E8CB1665-53F7-46A5-9AFD-B85AD08262D0}.Release|x86.Build.0 = Release|Any CPU
4244
EndGlobalSection

src/Qiniu/CDN/BandwidthResult.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public BandwidthInfo Result
1919
BandwidthInfo info = null;
2020
if ((Code == (int)HttpCode.OK) && (!string.IsNullOrEmpty(Text)))
2121
{
22-
info=JsonConvert.DeserializeObject<BandwidthInfo>(Text);
22+
info = JsonConvert.DeserializeObject<BandwidthInfo>(Text);
2323
}
2424
return info;
2525
}
@@ -63,7 +63,7 @@ public override string ToString()
6363
sb.AppendFormat("{0}:\nChina: {1}, Oversea={2}\n", kvp.Key, kvp.Value.China, kvp.Value.Oversea);
6464
}
6565
sb.AppendLine();
66-
}
66+
}
6767
}
6868
else
6969
{

src/Qiniu/Http/HttpHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static string getUserAgent()
9595
public static string createFormDataBoundary()
9696
{
9797
string now = DateTime.UtcNow.Ticks.ToString();
98-
return string.Format("-------{0}Boundary{1}", QiniuCSharpSDK.ALIAS, StringHelper.calcMD5(now));
98+
return string.Format("-------{0}Boundary{1}", QiniuCSharpSDK.ALIAS, Hashing.CalcMD5(now));
9999
}
100100
}
101101
}

src/Qiniu/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 80 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
https://go.microsoft.com/fwlink/?LinkID=208121.
4+
-->
5+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
6+
<PropertyGroup>
7+
<PublishProtocol>FileSystem</PublishProtocol>
8+
<Configuration>Release</Configuration>
9+
<Platform>Any CPU</Platform>
10+
<TargetFramework>netstandard2.0</TargetFramework>
11+
<PublishDir>C:\Users\zhour\source\repos\csharp-sdk\bin\netstandard2.0</PublishDir>
12+
</PropertyGroup>
13+
</Project>

0 commit comments

Comments
 (0)