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

Commit d72bb78

Browse files
Release 2.10.2
1 parent ad80c3f commit d72bb78

15 files changed

+257
-260
lines changed

.gitignore

+189
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@
99

1010
# Build results
1111

12+
[Dd]ebug/
13+
[Rr]elease/# Ref: https://gist.github.com/kmorcinek/2710267
14+
# Download this file using PowerShell v3 under Windows with the following comand
15+
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore
16+
17+
# User-specific files
18+
*.suo
19+
*.user
20+
*.sln.docstates
21+
22+
# Build results
23+
1224
[Dd]ebug/
1325
[Rr]elease/
1426
x64/
@@ -156,6 +168,183 @@ UpgradeLog*.htm
156168
**/App_Data/*.sdf
157169

158170

171+
#LightSwitch generated files
172+
GeneratedArtifacts/
173+
_Pvt_Extensions/
174+
ModelManifest.xml
175+
176+
# =========================
177+
# Windows detritus
178+
# =========================
179+
180+
# Windows image file caches
181+
Thumbs.db
182+
ehthumbs.db
183+
184+
# Folder config file
185+
Desktop.ini
186+
187+
# Recycle Bin used on file shares
188+
$RECYCLE.BIN/
189+
190+
# Mac desktop service store files
191+
.DS_Store
192+
193+
# SASS Compiler cache
194+
.sass-cache
195+
196+
# Visual Studio 2014 CTP
197+
**/*.sln.ide
198+
199+
travis-ci/accounts.json
200+
.vs/Square.Connect/xs/UserPrefs.xml
201+
.vs/Square.Connect/xs/sqlite3/db.lock
202+
203+
x64/
204+
build/
205+
[Bb]in/
206+
[Oo]bj/
207+
208+
# NuGet Packages
209+
*.nupkg
210+
# The packages folder can be ignored because of Package Restore
211+
**/packages/*
212+
# except build/, which is used as an MSBuild target.
213+
!**/packages/build/
214+
# Uncomment if necessary however generally it will be regenerated when needed
215+
#!**/packages/repositories.config
216+
217+
# MSTest test Results
218+
[Tt]est[Rr]esult*/
219+
[Bb]uild[Ll]og.*
220+
221+
*_i.c
222+
*_p.c
223+
*.ilk
224+
*.meta
225+
*.obj
226+
*.pch
227+
*.pdb
228+
*.pgc
229+
*.pgd
230+
*.rsp
231+
*.sbr
232+
*.tlb
233+
*.tli
234+
*.tlh
235+
*.tmp
236+
*.tmp_proj
237+
*.log
238+
*.vspscc
239+
*.vssscc
240+
.builds
241+
*.pidb
242+
*.log
243+
*.scc
244+
245+
# OS generated files #
246+
.DS_Store*
247+
ehthumbs.db
248+
Icon?
249+
Thumbs.db
250+
251+
# Visual C++ cache files
252+
ipch/
253+
*.aps
254+
*.ncb
255+
*.opensdf
256+
*.sdf
257+
*.cachefile
258+
259+
# Visual Studio profiler
260+
*.psess
261+
*.vsp
262+
*.vspx
263+
264+
# Guidance Automation Toolkit
265+
*.gpState
266+
267+
# ReSharper is a .NET coding add-in
268+
_ReSharper*/
269+
*.[Rr]e[Ss]harper
270+
271+
# TeamCity is a build add-in
272+
_TeamCity*
273+
274+
# DotCover is a Code Coverage Tool
275+
*.dotCover
276+
277+
# NCrunch
278+
*.ncrunch*
279+
.*crunch*.local.xml
280+
281+
# Installshield output folder
282+
[Ee]xpress/
283+
284+
# DocProject is a documentation generator add-in
285+
DocProject/buildhelp/
286+
DocProject/Help/*.HxT
287+
DocProject/Help/*.HxC
288+
DocProject/Help/*.hhc
289+
DocProject/Help/*.hhk
290+
DocProject/Help/*.hhp
291+
DocProject/Help/Html2
292+
DocProject/Help/html
293+
294+
# Click-Once directory
295+
publish/
296+
297+
# Publish Web Output
298+
*.Publish.xml
299+
300+
# Windows Azure Build Output
301+
csx
302+
*.build.csdef
303+
304+
# Windows Store app package directory
305+
AppPackages/
306+
307+
# Others
308+
sql/
309+
*.Cache
310+
ClientBin/
311+
[Ss]tyle[Cc]op.*
312+
~$*
313+
*~
314+
*.dbmdl
315+
*.[Pp]ublish.xml
316+
*.pfx
317+
*.publishsettings
318+
modulesbin/
319+
tempbin/
320+
321+
# EPiServer Site file (VPP)
322+
AppData/
323+
324+
# RIA/Silverlight projects
325+
Generated_Code/
326+
327+
# Backup & report files from converting an old project file to a newer
328+
# Visual Studio version. Backup files are not needed, because we have git ;-)
329+
_UpgradeReport_Files/
330+
Backup*/
331+
UpgradeLog*.XML
332+
UpgradeLog*.htm
333+
334+
# vim
335+
*.txt~
336+
*.swp
337+
*.swo
338+
339+
# svn
340+
.svn
341+
342+
# SQL Server files
343+
**/App_Data/*.mdf
344+
**/App_Data/*.ldf
345+
**/App_Data/*.sdf
346+
347+
159348
#LightSwitch generated files
160349
GeneratedArtifacts/
161350
_Pvt_Extensions/

.travis.yml

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
#
2-
# Generated by: https://github.com/swagger-api/swagger-codegen.git
3-
#
41
language: csharp
5-
mono:
6-
- latest
7-
solution: Square.Connect.sln
2+
dist: trusty
3+
mono: none
4+
dotnet: 2.0.0
85

96
install:
107
- wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe;
118
- openssl aes-256-cbc -K $encrypted_1ab91df4dffb_key -iv $encrypted_1ab91df4dffb_iv -in ./travis-ci/accounts.enc -out ./travis-ci/accounts.json -d
129

1310
script:
14-
- export frameworkVersion=net45
15-
- export releaseVersion="2.10.1"
16-
- /bin/sh ./mono_nunit_test.sh
11+
- export frameworkVersion=netstandard2.0
12+
- export releaseVersion="2.10.2"
13+
- /bin/sh ./nunit_test.sh
1714

1815
after_success:
1916
- /bin/bash ./travis-ci/build_and_publish.sh

CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## Version 2.10.2 (2018-08-21)
4+
5+
Updated the SDK target to be .net standard 2.0.
6+
37
## Version 2.10.1 (2018-08-02)
48

59
We have added MobileAuthorization API.

README.md

+3-11
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ specification repository](https://github.com/square/connect-api-specification)
88
for the specification and template files we used to generate this.
99

1010
## Frameworks supported
11-
- .NET 4.5 or later
11+
- .NET Standard
1212

1313
## Usage
1414
### **Obtain from [NuGet package manager](https://www.nuget.org/packages/Square.Connect/) (Recommended)**
@@ -19,14 +19,8 @@ PM> Install-Package Square.Connect
1919
### **Generating DLLs from source**
2020

2121
#### Dependencies
22-
- [RestSharp] (https://www.nuget.org/packages/RestSharp) - 106.2.2 or later
23-
- [Json.NET] (https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later
24-
25-
The DLLs included in the package may not be the latest version. We recommned using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
26-
```
27-
PM> Install-Package RestSharp
28-
PM> Install-Package Newtonsoft.Json
29-
```
22+
- [RestSharp] (https://www.nuget.org/packages/RestSharp) - 106.3.1 or later
23+
- [Json.NET] (https://www.nuget.org/packages/Newtonsoft.Json/) - 10.0.0 or later
3024

3125
Option 1: Run the following command to generate the DLL
3226

@@ -37,8 +31,6 @@ Option 2: Import the `Square.Connect/Square.Connect.csproj` to your solution and
3731

3832
Then include the DLLs (under the `bin` folder) in the C# project,
3933

40-
- RestSharp.dll
41-
- Newtonsoft.Json.dll
4234
- Square.Connect.dll
4335

4436
## Getting Started

build.bat

+1-15
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,2 @@
1-
:: Generated by: https://github.com/swagger-api/swagger-codegen.git
2-
::
3-
41
@echo off
5-
6-
SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319
7-
8-
if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', '.\nuget.exe')"
9-
.\nuget.exe install src\Square.Connect\packages.config -o packages
10-
11-
if not exist ".\bin" mkdir bin
12-
13-
copy packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
14-
copy packages\RestSharp.106.2.2\lib\net452\RestSharp.dll bin\RestSharp.dll
15-
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll;System.Web.dll /target:library /out:bin\IO.Swagger.dll /recurse:src\IO.Swagger\*.cs /doc:bin\IO.Swagger.xml
16-
2+
dotnet build

build.sh

+5-44
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,12 @@
11
#!/usr/bin/env bash
2-
#
3-
# Generated by: https://github.com/swagger-api/swagger-codegen.git
4-
5-
frameworkVersion=net45
6-
netfx=${frameworkVersion#net}
72

3+
frameworkVersion=netstandard2.0
84
echo "[INFO] Target framework: ${frameworkVersion}"
95

10-
echo "[INFO] Download nuget and packages"
11-
if ! which wget
12-
then
13-
echo "wget is either not installed on thie system or is"\
14-
"unavailable through the \$PATH."
15-
while true; do
16-
printf "Install it by [ curl -sSL https://dist.nuget.org/win-x86-commandline/latest/nuget.exe ]? [y/N] "
17-
read -r yn
18-
case "$yn" in
19-
[Yy]* ) break;;
20-
[Nn]* ) exit;;
21-
'' ) exit;;
22-
esac
23-
done
24-
curl -sSL https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -o nuget.exe;
25-
else
26-
wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe;
27-
fi
28-
29-
mozroots --import --sync
30-
mono nuget.exe install src/Square.Connect/packages.config -o packages;
31-
32-
echo "[INFO] Copy DLLs to the 'bin' folder"
33-
mkdir -p bin;
34-
cp packages/Newtonsoft.Json.8.0.3/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
35-
cp packages/RestSharp.106.2.2/lib/net452/RestSharp.dll bin/RestSharp.dll;
36-
37-
echo "[INFO] Run 'mcs' to build bin/Square.Connect.dll"
38-
39-
mcs -sdk:${netfx} -r:bin/Newtonsoft.Json.dll,\
40-
bin/RestSharp.dll,\
41-
System.ComponentModel.DataAnnotations.dll,\
42-
System.Runtime.Serialization.dll,\
43-
System.Web.dll \
44-
-target:library \
45-
-out:bin/Square.Connect.dll \
46-
-recurse:"src/Square.Connect/*.cs" \
47-
-doc:bin/Square.Connect.xml \
48-
-platform:anycpu
6+
echo "[INFO] Run 'dotnet' to build bin/Square.Connect.dll"
7+
dotnet build src/Square.Connect/Square.Connect.csproj \
8+
-o ../../bin \
9+
-f $frameworkVersion
4910

5011
if [ $? -ne 0 ]
5112
then

nunit_test.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
echo "[INFO] Build the solution and run the unit test"
4+
dotnet test src/Square.Connect.Test/Square.Connect.Test.csproj -v n

src/Square.Connect.Test/Api/CatalogApiTests.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,8 @@ public void TestRetrieveItemCatalogObject()
405405
Assert.IsNotNull(resp);
406406
Assert.AreEqual(coffee.Type, resp._Object.Type);
407407
Assert.AreEqual(idMap[COFFEE_ID], resp._Object.Id);
408-
Assert.IsNotNullOrEmpty(resp._Object.UpdatedAt);
408+
Assert.IsNotNull(resp._Object.UpdatedAt);
409+
Assert.IsNotEmpty(resp._Object.UpdatedAt);
409410
Assert.AreNotEqual(0, resp._Object.Version);
410411
Assert.IsFalse(resp._Object.IsDeleted.Value);
411412
Assert.AreEqual(coffee.ItemData.Name, resp._Object.ItemData.Name);
@@ -426,7 +427,8 @@ public void TestRetrieveTaxCatalogObject()
426427
Assert.IsNotNull(resp);
427428
Assert.AreEqual(salesTax.Type, resp._Object.Type);
428429
Assert.AreEqual(idMap[SALES_TAX_ID], resp._Object.Id);
429-
Assert.IsNotNullOrEmpty(resp._Object.UpdatedAt);
430+
Assert.IsNotNull(resp._Object.UpdatedAt);
431+
Assert.IsNotEmpty(resp._Object.UpdatedAt);
430432
Assert.AreNotEqual(0, resp._Object.Version);
431433
Assert.IsFalse(resp._Object.IsDeleted.Value);
432434
Assert.AreEqual(salesTax.TaxData.Name, resp._Object.TaxData.Name);

src/Square.Connect.Test/Configuration/TestAccounts.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Square.Connect.Test
88
{
99
public class TestAccounts
1010
{
11-
private static readonly string jsonFilePath = @"../../../../travis-ci/accounts.json";
11+
private static readonly string jsonFilePath = @"../../../../../travis-ci/accounts.json";
1212
private static Dictionary<String, AccountInfo> accounts;
1313

1414
public AccountInfo this[String name]

0 commit comments

Comments
 (0)