Skip to content

Commit

Permalink
Package update (#235)
Browse files Browse the repository at this point in the history
* Update gitignore to ignore Jetbrains Rider files

* Update projects versions; unsupported framework versions have been removed

* Update packages in Test project

* Update dependencies in HelloWorld sample

* Update packages in Archiving sample app

* Update packages in Broadcasting sample app

* Update packages in OpenTok project

* Remove unnecessary target-specific shenanigans

* Fix issue in Test csproj

* Update build pipeline
  • Loading branch information
Tr00d authored Sep 15, 2023
1 parent 37e6600 commit 6fc265a
Show file tree
Hide file tree
Showing 10 changed files with 219 additions and 271 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,12 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
2.0.x
2.1.x
2.2.x
3.1.x
5.0.x
6.0.x
dotnet-version: 6.0.x
- name: Clean
run: dotnet clean OpenTok.sln --configuration ${{ env.CONFIGURATION }} && dotnet nuget locals all --clear
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build OpenTok.sln --configuration ${{ env.CONFIGURATION }} --no-restore
- name: Test
run: dotnet test OpenTokTest/OpenTokTest.csproj --configuration ${{ env.CONFIGURATION }} --no-build -f netcoreapp3.1
run: dotnet test OpenTokTest/OpenTokTest.csproj --configuration ${{ env.CONFIGURATION }} --no-build
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,7 @@ pip-log.txt

## Samples
#Samples/HelloWorld/App.config
#Samples/Archiving/App.config
#Samples/Archiving/App.config

## Jetbrains IDE
.idea/
27 changes: 4 additions & 23 deletions OpenTok/OpenTok.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net452;net46;net461;netstandard2.0</TargetFrameworks>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>3.11.2</Version>
<Description>OpenTok is an API from TokBox that enables websites to weave live group video communication into their online experience.</Description>
<PackageProjectUrl>https://github.com/opentok/Opentok-.NET-SDK</PackageProjectUrl>
Expand All @@ -22,32 +22,13 @@
<Deterministic>true</Deterministic>
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
<LangVersion>8</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net452|AnyCPU'">
<DocumentationFile/>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net452'">
<PackageReference Include="JWT" Version="2.3.2"/>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3"/>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net46'">
<PackageReference Include="JWT" Version="2.3.2"/>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3"/>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="JWT" Version="7.2.1"/>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3"/>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461'">
<PackageReference Include="JWT" Version="7.2.1"/>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3"/>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'netstandard2.0' ">
<Reference Include="System.Web"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="JWT" Version="10.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Enums.NET" Version="4.0.0"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
Expand Down
22 changes: 11 additions & 11 deletions OpenTokTest/OpenTokTest.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Company>Vonage</Company>
<TargetFrameworks>net452;net46;net461;net462;net47;net471;net472;net48;netcoreapp3.1</TargetFrameworks>
<TargetFramework>net481</TargetFramework>
<Authors>Vonage</Authors>
<Copyright>Vonage 2020</Copyright>
<RootNamespace>OpenTokSDKTest</RootNamespace>
Expand Down Expand Up @@ -286,22 +286,22 @@
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutoFixture" Version="4.17.0" />
<PackageReference Include="Enums.NET" Version="4.0.0" />
<PackageReference Include="Moq" Version="4.14.1" />
<Reference Include="System.Web" />
<Reference Include="Microsoft.CSharp" />
<PackageReference Include="AutoFixture" Version="4.18.0" />
<PackageReference Include="Enums.NET" Version="4.0.1" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenTok\OpenTok.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'netcoreapp3.1' ">
<Reference Include="System.Web" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup>
<None Update="Data\DialTests\DialAsyncCorrectHeaders-response.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
13 changes: 8 additions & 5 deletions Samples/Archiving/Archiving.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
<PropertyGroup>
<AssemblyName>Archiving</AssemblyName>
<Version>1.0.0</Version>
<TargetFramework>net452</TargetFramework>
<TargetFramework>net481</TargetFramework>
<Authors>Vonage</Authors>
<Company>Vonage</Company>
<Copyright>Copyright © 2020</Copyright>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'netstandard2.0' ">
<PackageReference Include="Nancy.Owin" Version="1.1.0" />
<PackageReference Include="Nancy.Viewengines.Razor" Version="1.1.0" />
<PackageReference Include="Microsoft.Owin.Host.HttpListener" Version="3.0.1" />
<PackageReference Include="Microsoft.Owin.Hosting" Version="3.0.1" />
<PackageReference Include="Nancy.Owin" Version="2.0.0" />
<PackageReference Include="Nancy.Viewengines.Razor" Version="2.0.0" />
<PackageReference Include="Microsoft.Owin.Host.HttpListener" Version="4.2.2" />
<PackageReference Include="Microsoft.Owin.Hosting" Version="4.2.2" />
</ItemGroup>
<ItemGroup>
<None Remove="Content\css\sample.css" />
Expand Down Expand Up @@ -77,5 +77,8 @@
<Content Include="views\_ViewStart.cshtml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Nancy" Version="2.0.0" />
</ItemGroup>
</Project>
150 changes: 64 additions & 86 deletions Samples/Archiving/MainModule.cs
Original file line number Diff line number Diff line change
@@ -1,91 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Dynamic;

using System.Dynamic;
using Nancy;
using OpenTokSDK;

namespace Archiving
{

public class MainModule : NancyModule
{

public MainModule(OpenTokService opentokService)
{

Get["/"] = _ => View["index"];

Get["/host"] = _ =>
{
dynamic locals = new ExpandoObject();
locals.ApiKey = opentokService.OpenTok.ApiKey.ToString();
locals.SessionId = opentokService.Session.Id;
locals.Token = opentokService.Session.GenerateToken();
return View["host", locals];
};

Get["/participant"] = _ =>
{
dynamic locals = new ExpandoObject();
locals.ApiKey = opentokService.OpenTok.ApiKey.ToString();
locals.SessionId = opentokService.Session.Id;
locals.Token = opentokService.Session.GenerateToken();
return View["participant", locals];
};

Get["/history"] = _ =>
{
var page = Request.Query.page.HasValue ? (int)Request.Query.page : 1;
var offset = (page - 1) * 5;
ArchiveList archives = opentokService.OpenTok.ListArchives(offset, 5);
string showPrevious = page > 1 ? "/history?page=" + (page - 1).ToString() : null;
string showNext = archives.TotalCount > (offset + 5) ? "/history?page=" + (page + 1).ToString() : null;
dynamic locals = new ExpandoObject();
locals.Archives = archives;
locals.ShowPrevious = showPrevious;
locals.ShowNext = showNext;
return View["history", locals];
};

Get["/download/{id}"] = parameters =>
{
Archive archive = opentokService.OpenTok.GetArchive(parameters.id);
return Response.AsRedirect(archive.Url);
};

Post["/start"] = _ =>
{
Archive archive = opentokService.OpenTok.StartArchive(
opentokService.Session.Id,
name: ".NET Archiving Sample App",
hasAudio: (Boolean)(this.Request.Form.hasAudio),
hasVideo: (Boolean)(this.Request.Form.hasVideo),
outputMode: (this.Request.Form.outputMode == "composed" ? OutputMode.COMPOSED : OutputMode.INDIVIDUAL)
);
return archive;
};

Get["/stop/{id}"] = parameters =>
{
Archive archive = opentokService.OpenTok.StopArchive(parameters.id);
return archive;
};

Get["/delete/{id}"] = parameters =>
{
opentokService.OpenTok.DeleteArchive(parameters.id);
return Response.AsRedirect("/history");
};
}
}
}
public class MainModule : NancyModule
{
public MainModule(OpenTokService opentokService)
{
Get("/", _ => View["index"]);
Get("/host", _ =>
{
dynamic locals = new ExpandoObject();
locals.ApiKey = opentokService.OpenTok.ApiKey.ToString();
locals.SessionId = opentokService.Session.Id;
locals.Token = opentokService.Session.GenerateToken();
return View["host", locals];
});
Get("/participant", _ =>
{
dynamic locals = new ExpandoObject();
locals.ApiKey = opentokService.OpenTok.ApiKey.ToString();
locals.SessionId = opentokService.Session.Id;
locals.Token = opentokService.Session.GenerateToken();
return View["participant", locals];
});
Get("/history", _ =>
{
var page = Request.Query.page.HasValue ? (int) Request.Query.page : 1;
var offset = (page - 1) * 5;
var archives = opentokService.OpenTok.ListArchives(offset, 5);
var showPrevious = page > 1 ? "/history?page=" + (page - 1) : null;
var showNext = archives.TotalCount > offset + 5 ? "/history?page=" + (page + 1) : null;
dynamic locals = new ExpandoObject();
locals.Archives = archives;
locals.ShowPrevious = showPrevious;
locals.ShowNext = showNext;
return View["history", locals];
});
Get("/download/{id}", parameters =>
{
Archive archive = opentokService.OpenTok.GetArchive(parameters.id);
return Response.AsRedirect(archive.Url);
});
Post("/start", _ =>
{
var archive = opentokService.OpenTok.StartArchive(
opentokService.Session.Id,
".NET Archiving Sample App",
hasAudio: (bool) this.Request.Form.hasAudio,
hasVideo: (bool) this.Request.Form.hasVideo,
outputMode: this.Request.Form.outputMode == "composed" ? OutputMode.COMPOSED : OutputMode.INDIVIDUAL
);
return archive;
});
Get("/stop/{id}", parameters =>
{
Archive archive = opentokService.OpenTok.StopArchive(parameters.id);
return archive;
});
Get("/delete/{id}", parameters =>
{
opentokService.OpenTok.DeleteArchive(parameters.id);
return Response.AsRedirect("/history");
});
}
}
}
11 changes: 6 additions & 5 deletions Samples/Broadcasting/Broadcasting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
<PropertyGroup>
<AssemblyName>Broadcasting</AssemblyName>
<Version>1.0.0</Version>
<TargetFramework>net452</TargetFramework>
<TargetFramework>net481</TargetFramework>
<Authors>Vonage</Authors>
<Company>Vonage</Company>
<Copyright>Copyright © 2020</Copyright>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'netstandard2.0' ">
<PackageReference Include="Nancy.Owin" Version="1.1.0" />
<PackageReference Include="Nancy.Viewengines.Razor" Version="1.1.0" />
<PackageReference Include="Microsoft.Owin.Host.HttpListener" Version="3.0.1" />
<ItemGroup>
<PackageReference Include="Nancy" Version="2.0.0" />
<PackageReference Include="Nancy.Owin" Version="2.0.0" />
<PackageReference Include="Nancy.Viewengines.Razor" Version="2.0.0" />
<PackageReference Include="Microsoft.Owin.Host.HttpListener" Version="4.2.2" />
<PackageReference Include="Microsoft.Owin.Hosting" Version="3.0.1" />
</ItemGroup>
<ItemGroup>
Expand Down
Loading

0 comments on commit 6fc265a

Please sign in to comment.