Skip to content

Commit efdb2ad

Browse files
authored
Merge pull request #48 from CallFire/develop
upgraded dependencies and build plugins
2 parents 0f2a511 + c45a4db commit efdb2ad

File tree

14 files changed

+137
-105
lines changed

14 files changed

+137
-105
lines changed

CallfireApiClient.nuspec

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?><package>
22
<metadata>
33
<id>CallfireApiClient</id>
4-
<version>1.1.17</version>
4+
<version>1.1.18</version>
55
<title>CallFire API v2 client</title>
66
<authors>
77
Vladimir Mikhailov
@@ -15,6 +15,9 @@
1515
<description>C# client library for integration with Callfire REST API v2 services</description>
1616
<releaseNotes>Callfire API client Changelog
1717
=============================
18+
Version 1.1.18 - May 29 2017
19+
- upgraded dependencies
20+
1821
Version 1.1.17 - May 4 2017
1922
- removed subscriptions api (not supported from v2 api client)
2023
- fixed findWebhooks api to use enums instead strings
@@ -107,7 +110,6 @@ Version 1.0.0 - Dec 29 2015
107110
<file src="src/CallfireApiClient/bin/Debug/callfire-api-client.dll" target="lib"/>
108111
<file src="src/CallfireApiClient/bin/Release/callfire-api-client.dll.config" target="lib"/>
109112
<file src="src/CallfireApiClient/bin/Release/callfire-api-client.xml" target="lib"/>
110-
<file src="src/CallfireApiClient/bin/Debug/callfire-api-client.pdb" target="lib"/>
111113
<file src="src/CallfireApiClient/bin/Debug/callfire-api-client.dll.mdb" target="lib"/>
112114
</files>
113115
</package>

Changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Callfire API client Changelog
22
=============================
3+
Version 1.1.18 - May 29 2017
4+
- upgraded dependencies
5+
36
Version 1.1.17 - May 4 2017
47
- removed subscriptions api (not supported from v2 api client)
58
- fixed findWebhooks api to use enums instead strings

build.gradle

Lines changed: 91 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import groovy.xml.XmlUtil
55
import groovy.xml.StreamingMarkupBuilder
66

77
plugins {
8-
id 'com.ullink.msbuild' version '2.14'
9-
id 'com.ullink.nuget' version '2.12'
10-
id 'com.ullink.nunit' version '1.4'
11-
id 'com.ullink.opencover' version '1.2'
12-
id 'net.researchgate.release' version '2.3.4'
13-
id 'com.github.jlouns.cpe' version '0.4.1'
8+
id 'com.ullink.msbuild' version '2.16'
9+
id 'com.ullink.nuget' version '2.15'
10+
id 'com.ullink.nunit' version '1.10'
11+
id 'com.ullink.opencover' version '1.7'
12+
id 'net.researchgate.release' version '2.6.0'
13+
id 'com.github.jlouns.cpe' version '0.5.0'
1414
id "co.riiid.gradle" version "0.4.2"
1515
}
1616

@@ -50,41 +50,43 @@ nunit {
5050
}
5151
nunit.dependsOn msbuild
5252

53-
task updateNuspecFile << {
54-
def specFile = file('CallfireApiClient.nuspec')
55-
def spec = new XmlSlurper().parse(specFile)
56-
57-
project.version = patchVersion(spec.metadata.version.text)
58-
spec.metadata.version = project.version
59-
spec.metadata.releaseNotes = file('Changelog.txt').text
60-
// cleanup previous lib/ and src/ files since they depend on build configuration
61-
spec.files.file.findAll { it.@target == 'lib' || it.@target == 'src' }.each { it.replaceNode {} }
62-
63-
def isWindowsOs = Os.isFamily(Os.FAMILY_WINDOWS)
64-
def monoInstallation = "$System.env.MONO_HOME"
65-
def pdbToMdbConverter
66-
if (isWindowsOs) {
67-
if (monoInstallation != 'null') {
68-
pdbToMdbConverter = "$System.env.MONO_HOME" + "\\bin\\pdb2mdb.bat"
69-
exec { commandLine = [pdbToMdbConverter, "$assemblyBinDebugDir/${archivesBaseName}.dll"] }
70-
}
71-
}
53+
task updateNuspecFile {
54+
doLast {
55+
def specFile = file('CallfireApiClient.nuspec')
56+
def spec = new XmlSlurper().parse(specFile)
7257

73-
spec.files.appendNode {
74-
file(src: "src/**/*.cs", target: 'src') {}
75-
file(src: "$assemblyBinDebugDir/${archivesBaseName}.dll", target: 'lib') {}
76-
file(src: "$assemblyBinReleaseDir/${archivesBaseName}.dll.config", target: 'lib') {}
77-
file(src: "$assemblyBinReleaseDir/${archivesBaseName}.xml", target: 'lib') {}
58+
project.version = patchVersion(spec.metadata.version.text)
59+
spec.metadata.version = project.version
60+
spec.metadata.releaseNotes = file('Changelog.txt').text
61+
// cleanup previous lib/ and src/ files since they depend on build configuration
62+
spec.files.file.findAll { it.@target == 'lib' || it.@target == 'src' }.each { it.replaceNode {} }
63+
64+
def isWindowsOs = Os.isFamily(Os.FAMILY_WINDOWS)
65+
def monoInstallation = "$System.env.MONO_HOME"
66+
def pdbToMdbConverter
7867
if (isWindowsOs) {
79-
file(src: "$assemblyBinDebugDir/${archivesBaseName}.pdb", target: 'lib') {}
68+
if (monoInstallation != 'null') {
69+
pdbToMdbConverter = "$System.env.MONO_HOME" + "\\bin\\pdb2mdb.bat"
70+
exec { commandLine = [pdbToMdbConverter, "$assemblyBinDebugDir/${archivesBaseName}.dll"] }
71+
}
72+
}
73+
74+
spec.files.appendNode {
75+
file(src: "src/**/*.cs", target: 'src') {}
76+
file(src: "$assemblyBinDebugDir/${archivesBaseName}.dll", target: 'lib') {}
77+
file(src: "$assemblyBinReleaseDir/${archivesBaseName}.dll.config", target: 'lib') {}
78+
file(src: "$assemblyBinReleaseDir/${archivesBaseName}.xml", target: 'lib') {}
79+
if (isWindowsOs) {
80+
file(src: "$assemblyBinDebugDir/${archivesBaseName}.pdb", target: 'lib') {}
81+
}
82+
file(src: "$assemblyBinDebugDir/${archivesBaseName}.dll.mdb", target: 'lib') {}
8083
}
81-
file(src: "$assemblyBinDebugDir/${archivesBaseName}.dll.mdb", target: 'lib') {}
84+
85+
def fw = new FileWriter('CallfireApiClient.nuspec')
86+
XmlUtil.serialize(spec, fw)
87+
// have to close manually because on windows file remains locked
88+
fw.close()
8289
}
83-
84-
def fw = new FileWriter('CallfireApiClient.nuspec')
85-
XmlUtil.serialize(spec, fw)
86-
// have to close manually because on windows file remains locked
87-
fw.close()
8890
}
8991
updateNuspecFile.dependsOn msbuildDebug
9092

@@ -122,34 +124,36 @@ nugetPack {
122124
}
123125
nugetPack.dependsOn zipBinaries
124126

125-
task prepareTestData () << {
126-
def inFile = file('src/CallfireApiClient.IntegrationTests/App.config')
127-
def xml = new XmlSlurper().parse(inFile)
128-
129-
def apiLogin
130-
def apiPassword
131-
132-
try {
133-
apiLogin = "${testApiUsername}"
134-
apiPassword = "${testApiPassword}"
135-
println([ msbuild.projects['CallfireApiClient.IntegrationTests'].properties.TargetPath ])
136-
} catch(Exception ex) {
137-
println("Api Username and/or Password are empty, you can't run integrationTests task, set them with -PtestApiUsername/-PtestApiPassword options")
138-
apiLogin = "login"
139-
apiPassword = "password"
140-
}
141-
142-
if (apiLogin != 'null' && apiPassword != 'null') {
143-
xml.appSettings.add.findAll { it.@key == 'testLogin' || it.@key == 'testPassword' }.each { it.replaceNode {} }
144-
xml.appSettings.appendNode {
145-
add(key: "testLogin", value: apiLogin) {}
146-
add(key: "testPassword", value: apiPassword) {}
127+
task prepareTestData {
128+
doLast {
129+
def inFile = file('src/CallfireApiClient.IntegrationTests/App.config')
130+
def xml = new XmlSlurper().parse(inFile)
131+
132+
def apiLogin
133+
def apiPassword
134+
135+
try {
136+
apiLogin = "${testApiUsername}"
137+
apiPassword = "${testApiPassword}"
138+
println([ msbuild.projects['CallfireApiClient.IntegrationTests'].properties.TargetPath ])
139+
} catch(Exception ex) {
140+
println("Api Username and/or Password are empty, you can't run integrationTests task, set them with -PtestApiUsername/-PtestApiPassword options")
141+
apiLogin = "login"
142+
apiPassword = "password"
143+
}
144+
145+
if (apiLogin != 'null' && apiPassword != 'null') {
146+
xml.appSettings.add.findAll { it.@key == 'testLogin' || it.@key == 'testPassword' }.each { it.replaceNode {} }
147+
xml.appSettings.appendNode {
148+
add(key: "testLogin", value: apiLogin) {}
149+
add(key: "testPassword", value: apiPassword) {}
150+
}
147151
}
152+
def fw = new FileWriter('src/CallfireApiClient.IntegrationTests/App.config')
153+
XmlUtil.serialize(xml, fw)
154+
// have to close manually because on windows file remains locked
155+
fw.close()
148156
}
149-
def fw = new FileWriter('src/CallfireApiClient.IntegrationTests/App.config')
150-
XmlUtil.serialize(xml, fw)
151-
// have to close manually because on windows file remains locked
152-
fw.close()
153157
}
154158

155159
task msbuildForIntegrationTests (type: com.ullink.Msbuild) {
@@ -164,29 +168,33 @@ task integrationTests (type: com.ullink.gradle.nunit.NUnit) {
164168
}
165169
integrationTests.dependsOn msbuildForIntegrationTests
166170

167-
task prepareReleaseData () << {
168-
try {
169-
println("${gitHubOwner}")
170-
println("${gitHubToken}")
171-
} catch(Exception ex) {
172-
println("GitHub Owner and/or Token are empty, you can't run github release task, set them with -PgitHubOwner/-PgitHubToken options")
171+
task prepareReleaseData {
172+
doLast {
173+
try {
174+
println("${gitHubOwner}")
175+
println("${gitHubToken}")
176+
} catch(Exception ex) {
177+
println("GitHub Owner and/or Token are empty, you can't run github release task, set them with -PgitHubOwner/-PgitHubToken options")
178+
}
173179
}
174180
}
175181
prepareReleaseData.dependsOn nugetPack
176182

177-
task configureCustomGitHubRelease () << {
178-
github {
179-
owner = "${gitHubOwner}"
180-
repo = 'callfire-api-client-csharp'
181-
token = "${gitHubToken}"
182-
tagName = project.version
183-
targetCommitish = 'master'
184-
name = project.version
185-
body = releaseDescription()
186-
assets = [
187-
'build/dist/CallfireApiClient-' + project.version + '.zip',
188-
'build/dist/CallfireApiClient.' + project.version + '.nupkg'
189-
]
183+
task configureCustomGitHubRelease {
184+
doLast {
185+
github {
186+
owner = "${gitHubOwner}"
187+
repo = 'callfire-api-client-csharp'
188+
token = "${gitHubToken}"
189+
tagName = project.version
190+
targetCommitish = 'master'
191+
name = project.version
192+
body = releaseDescription()
193+
assets = [
194+
'build/dist/CallfireApiClient-' + project.version + '.zip',
195+
'build/dist/CallfireApiClient.' + project.version + '.nupkg'
196+
]
197+
}
190198
}
191199
}
192200
configureCustomGitHubRelease.dependsOn prepareReleaseData
@@ -206,4 +214,4 @@ def releaseDescription() {
206214
String secondVersionEntry = releaseNotes.find(~/Version.*/)
207215
String currentReleaseChanges = releaseNotes.substring(0, (secondVersionEntry == null ? releaseNotes.size() - 1 : releaseNotes.indexOf(secondVersionEntry))).trim()
208216
"$currentReleaseChanges"
209-
}
217+
}

src/CallfireApiClient.IntegrationTests/Api/CallsTexts/CallsApiIntegrationTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public void GetCallRecordings()
115115

116116
recs = Client.CallsApi.GetCallRecordings((long)rec.CallId, "items(callId)");
117117
Assert.Null(recs[0].Id);
118-
Assert.Null(recs[0].CallId);
118+
Assert.NotNull(recs[0].CallId);
119119
}
120120

121121
[Test]
@@ -131,7 +131,7 @@ public void GetCallRecordingByName()
131131

132132
recording = Client.CallsApi.GetCallRecordingByName((long)rec.CallId, rec.Name, "callId");
133133
Assert.Null(recording.Id);
134-
Assert.Null(recording.CallId);
134+
Assert.NotNull(recording.CallId);
135135
}
136136

137137
[Test]

src/CallfireApiClient.IntegrationTests/Api/Campaigns/CallBroadcastsApiIntegrationTest.cs

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,34 @@ public void StartStopArchiveCampaign()
127127
[Test]
128128
public void GetBroadcastCalls()
129129
{
130-
var getCallsRequest = new GetByIdRequest { Id = 1 };
130+
var broadcast = new CallBroadcast
131+
{
132+
Name = "call_broadcast",
133+
AnsweringMachineConfig = AnsweringMachineConfig.AM_AND_LIVE,
134+
Sounds = new CallBroadcastSounds
135+
{
136+
LiveSoundText = "Hello! This is a live answer text to speech recording",
137+
LiveSoundTextVoice = Voice.MALE1,
138+
MachineSoundText = "This is an answering machine text to speech recording",
139+
MachineSoundTextVoice = Voice.MALE1
140+
},
141+
Recipients = new List<Recipient>
142+
{
143+
new Recipient { PhoneNumber = "12132041238" },
144+
new Recipient { PhoneNumber = "14246525473" }
145+
}
146+
};
147+
var id = Client.CallBroadcastsApi.Create(broadcast, false);
148+
149+
var getCallsRequest = new GetByIdRequest { Id = id.Id };
131150
var calls = Client.CallBroadcastsApi.GetCalls(getCallsRequest);
132151
System.Console.WriteLine(calls);
133152
Assert.That(calls.Items, Is.Not.Empty);
134153

135154
long testBatchId = (long) calls.Items[0].BatchId;
136155

137-
getCallsRequest = new GetBroadcastCallsTextsRequest { Id = 1, BatchId = testBatchId };
138-
calls = Client.CallBroadcastsApi.GetCalls(getCallsRequest);
156+
var getCallsRequestNew = new GetBroadcastCallsTextsRequest { Id = id.Id, BatchId = testBatchId };
157+
calls = Client.CallBroadcastsApi.GetCalls(getCallsRequestNew);
139158
System.Console.WriteLine(calls);
140159
Assert.AreEqual(calls.Items[0].BatchId, testBatchId);
141160
}

src/CallfireApiClient.Tests/CallfireApiClient.Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
<Prefer32Bit>false</Prefer32Bit>
3333
</PropertyGroup>
3434
<ItemGroup>
35+
<Reference Include="DotNetZip, Version=1.10.1.0, Culture=neutral, PublicKeyToken=6583c7c814667745">
36+
<HintPath>..\..\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll</HintPath>
37+
</Reference>
3538
<Reference Include="System" />
3639
<Reference Include="System.Configuration" />
3740
<Reference Include="nunit.framework">
@@ -40,9 +43,6 @@
4043
<Reference Include="RestSharp">
4144
<HintPath>..\..\packages\RestSharp.105.2.3\lib\net4\RestSharp.dll</HintPath>
4245
</Reference>
43-
<Reference Include="Ionic.Zip">
44-
<HintPath>..\..\packages\DotNetZip.1.9.7\lib\net20\Ionic.Zip.dll</HintPath>
45-
</Reference>
4646
<Reference Include="Microsoft.Build.Utilities.v4.0" />
4747
<Reference Include="Microsoft.Build.Framework" />
4848
<Reference Include="System.Xml" />
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"intervalStart": 1000000000000,
33
"intervalEnd": 1000000000000,
4-
"remainingPlanCredits": 0.0000,
5-
"remainingPayAsYouGoCredits": 2015.0000,
6-
"totalRemainingCredits": 2015.0000
4+
"remainingPlanCredits": 0.0,
5+
"remainingPayAsYouGoCredits": 2015.0,
6+
"totalRemainingCredits": 2015.0
77
}

src/CallfireApiClient.Tests/JsonMocks/account/meApi/response/getCreditsUsage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"intervalEnd": 1000000000000,
44
"callsDurationMinutes": 100,
55
"textsSent": 2015,
6-
"creditsUsed": 2015.000
6+
"creditsUsed": 2015.0
77
}

src/CallfireApiClient.Tests/JsonMocks/campaigns/callBroadcastsApi/response/getStats.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"totalOutboundCount": 3,
33
"remainingOutboundCount": 0,
4-
"billedAmount": 0.0000,
4+
"billedAmount": 0.0,
55
"callsAttempted": 3,
66
"callsPlaced": 3,
77
"callsDuration": 0,

src/CallfireApiClient.Tests/JsonMocks/campaigns/textBroadcastsApi/response/getStats.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"totalOutboundCount": 6,
33
"remainingOutboundCount": 0,
4-
"billedAmount": 0.0000,
4+
"billedAmount": 0.0,
55
"sentCount": 0,
66
"unsentCount": 0,
77
"recievedCount": 0,

0 commit comments

Comments
 (0)