Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of SWIG with C# bindings #2577

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c0fcf24
SRT SWIG
lewk2 Dec 6, 2022
cee3a35
Srt1.5.1 swig (#8)
lewk2 Dec 6, 2022
e73b119
-docker lin build now uses ubuntu 22.04 base
Dec 6, 2022
2ea30af
SWIG Linux improvements, C# type mapping fixes
lewk2 Dec 8, 2022
3191862
Scripts update
BlackGad Feb 25, 2023
7971f28
-swig off by default (breaks older CI builds)
lewk2 Feb 26, 2023
4961728
-explicit call to run linux build in pwsh (CI fix)
lewk2 Feb 26, 2023
ae46ba8
-compile up-to-date swig within linux container
lewk2 Feb 28, 2023
85f38a4
WIP
BlackGad Mar 18, 2023
741c3ca
Added options handling
BlackGad Mar 18, 2023
40357d3
Marshaler fix
BlackGad Mar 18, 2023
0972dd3
Fixed delegates, a lot of modifications
BlackGad Mar 18, 2023
5a761af
-SWIG on in teamcity if VS2019+
Mar 23, 2023
02c9634
-update cmake to 3.25.3 (VS2022 support)
Mar 23, 2023
e0e20d7
-remove use of span (fails with netstandard2.0)
Mar 23, 2023
57c0df6
-fix cmake download
Mar 28, 2023
464dec3
Fixed callback delegates associated with socket GC lifetime
BlackGad Apr 8, 2023
3103108
Added EPOLL mappings
BlackGad Apr 29, 2023
efa8fa2
-clear null-forgiveness flag (not C# 8)
May 4, 2023
571c07c
-change ordering of SWIG cmake policies inclusion
May 5, 2023
e7ab2f2
Merge pull request #11 from Cinegy/vshkolka_swig_upgrade
lewk2 May 5, 2023
7583958
-added missed () from cmake else
May 5, 2023
671a2ee
Merge pull request #12 from Cinegy/vshkolka_swig_upgrade
lewk2 May 5, 2023
319d933
Merge branch 'Haivision:master' into master-swig
lewk2 May 8, 2023
0afb40b
-skip enum define due to conditionals
lewk2 May 8, 2023
661cc37
Fixed ps1 file permission
BlackGad Jun 17, 2023
7eb250d
Merge branch 'master-swig' of https://github.com/Cinegy/srt into mast…
BlackGad Jun 17, 2023
2b57581
Merged with upstream
BlackGad Jan 6, 2024
44a548d
Nuget package configuration update
BlackGad Jan 7, 2024
cd30b74
Added readme file
BlackGad Jan 7, 2024
f29b2eb
Added proper readme file
BlackGad Jan 7, 2024
97bd170
Fixed Nuget readme metadata
BlackGad Jan 7, 2024
e9fbd51
Fixed .NET 8 SocketAddress internal fields access issue
BlackGad Jan 13, 2024
33a150c
Fixed Dispose call on sockets
BlackGad Jun 1, 2024
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
SRT SWIG
* -add swig bindings and wrapper for c#
  • Loading branch information
lewk2 committed Dec 6, 2022
commit c0fcf243baecca659b1c514a29ecfb5db12903ef
22 changes: 11 additions & 11 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ configuration:
- Debug

image:
- Ubuntu
- Visual Studio 2019
- Visual Studio 2015
- Visual Studio 2013

platform:
- x64
- x86

build_script:
- ps: $VSIMG = $Env:APPVEYOR_BUILD_WORKER_IMAGE; $CNFG = $Env:CONFIGURATION
- ps: $VSIMG = $Env:APPVEYOR_BUILD_WORKER_IMAGE; $CNFG = $Env:CONFIGURATION
# use a few differing arguments depending on VS version to exercise different options during builds
- ps: if ($VSIMG -match '2019' -and $CNFG -eq "Release") { .\scripts\build-windows.ps1 -STATIC_LINK_SSL ON -BUILD_APPS ON -UNIT_TESTS ON -BONDING ON }
- ps: if ($VSIMG -match '2019' -and $CNFG -eq "Debug") { .\scripts\build-windows.ps1 -STATIC_LINK_SSL ON -BUILD_APPS ON }
- ps: if ($VSIMG -match '2019' -and $CNFG -eq "Release") { .\scripts\build-windows.ps1 -STATIC_LINK_SSL ON -BUILD_APPS ON -UNIT_TESTS ON -BONDING ON -ENABLE_SWIG ON}
- ps: if ($VSIMG -match '2019' -and $CNFG -eq "Debug") { .\scripts\build-windows.ps1 -STATIC_LINK_SSL ON -BUILD_APPS ON -ENABLE_SWIG ON}
- ps: if ($VSIMG -match '2015' -and $CNFG -eq "Release") { .\scripts\build-windows.ps1 -STATIC_LINK_SSL ON -BUILD_APPS ON -UNIT_TESTS ON -BONDING ON}
- ps: if ($VSIMG -match '2015' -and $CNFG -eq "Debug") { .\scripts\build-windows.ps1 -STATIC_LINK_SSL ON -BUILD_APPS OFF }
- ps: if ($VSIMG -match '2013' -and $CNFG -eq "Release") { .\scripts\build-windows.ps1 -CXX11 OFF -BUILD_APPS ON }
- ps: if ($VSIMG -match '2013' -and $CNFG -eq "Debug") { Exit-AppveyorBuild } # just skip 2013 debug build for speed
- sh: ./scripts/build-lin-docker.ps1

test_script:
- ps: if ( $Env:RUN_UNIT_TESTS ) { cd ./_build; ctest -E "TestIPv6.v6_calls_v4" --extra-verbose -C $Env:CONFIGURATION; cd ../ }

after_build:
- cmd: >-
scripts/gather-package.bat
7z a SRT-%APPVEYOR_REPO_BRANCH%-%CONFIGURATION%-Win%PLATFORM%-%VS_VERSION%-%APPVEYOR_BUILD_VERSION%.zip %APPVEYOR_BUILD_FOLDER%\package\*
appveyor PushArtifact SRT-%APPVEYOR_REPO_BRANCH%-%CONFIGURATION%-Win%PLATFORM%-%VS_VERSION%-%APPVEYOR_BUILD_VERSION%.zip
- cmd: cd %APPVEYOR_BUILD_FOLDER%
- cmd: scripts/gather-package.bat
- cmd: scripts/create-win64-nuget.bat
- cmd: 7z a SRT-%APPVEYOR_REPO_BRANCH%-%CONFIGURATION%-Win%PLATFORM%-%VS_VERSION%-%APPVEYOR_BUILD_VERSION%.zip %APPVEYOR_BUILD_FOLDER%\package\*
- cmd: appveyor PushArtifact SRT-%APPVEYOR_REPO_BRANCH%-%CONFIGURATION%-Win%PLATFORM%-%VS_VERSION%-%APPVEYOR_BUILD_VERSION%.zip
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,11 @@ vcpkg/

# LSP
compile_commands.json

# Nuget packages
packages/
package/
*.nupkg

# Swig bindings
/srtcore/swig_bindings
30 changes: 30 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ option(USE_BUSY_WAITING "Enable more accurate sending times at a cost of potenti
option(USE_GNUSTL "Get c++ library/headers from the gnustl.pc" OFF)
option(ENABLE_SOCK_CLOEXEC "Enable setting SOCK_CLOEXEC on a socket" ON)
option(ENABLE_SHOW_PROJECT_CONFIG "Enable show Project Configuration" OFF)
option(ENABLE_SWIG "Enable SWIG, used to generate alternative language bindings" OFF)
option(ENABLE_SWIG_CSHARP "Enable SWIG binding generation for CSharp language (only effective if ENABLE_SWIG is ON)" ON)

option(ENABLE_CLANG_TSA "Enable Clang Thread Safety Analysis" OFF)

Expand Down Expand Up @@ -1340,6 +1342,34 @@ endif()
srt_add_example(testcapi-connect.c)
endif()

#SWIG support - adding bindings for other languages into a new library that statically include the main SRT lib
cmake_policy(SET CMP0078 NEW)
cmake_policy(SET CMP0086 NEW)

#older cmakes do not understand this policy, so filter (VS2015 AppVeyor cmake is too old)
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.21)
cmake_policy(SET CMP0122 NEW)
endif()


#experimental SWIG support for csharp - only enabled for Windows currently
if(ENABLE_SWIG)
if(MICROSOFT)
#if nuget has been used to install swig in the project packages, bind to that
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/packages/swig/swigwin-4.1.1/swig.exe")
set(SWIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}/packages/swig/swigwin-4.1.1/swig.exe")
endif()
endif()

FIND_PACKAGE(SWIG REQUIRED)
INCLUDE(${SWIG_USE_FILE})

if(ENABLE_SWIG_CSHARP)
swig_add_library(srt_swig_csharp LANGUAGE csharp SOURCES srtcore/srt.i OUTPUT_DIR ${CMAKE_BINARY_DIR}/swig_bindings/csharp)
swig_link_libraries(srt_swig_csharp ${srt_link_library} ${DEPENDS_srt})
set_property(TARGET srt_swig_csharp PROPERTY SWIG_COMPILE_OPTIONS -namespace SrtSharp)
endif()
endif()

if (ENABLE_UNITTESTS AND ENABLE_CXX11)

Expand Down
38 changes: 38 additions & 0 deletions scripts/Dockerfile.linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM ubuntu:20.04

LABEL maintainer="Lewis Kirkaldie <lewis@cinegy.com>"

ENV TZ=Europe/Berlin
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

#base dev packages and OS tools, including mono and boost other library dependencies
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
build-essential git nano gnupg apt-utils unzip sudo bzip2 \
apt-transport-https curl wget ca-certificates cpio \
libssl-dev software-properties-common \
p7zip-full p7zip-rar swig && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

#add powershell core & dotnet 6.0
RUN cd /tmp && \
curl -o packages-microsoft-prod.deb https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -sS && \
dpkg -i packages-microsoft-prod.deb && \
rm packages-microsoft-prod.deb && \
apt-get update && \
apt-get install -y powershell && \
apt-get install -y dotnet-sdk-6.0 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

#add cmake 3.24.1
RUN mkdir -p /usr/src/cmake \
&& curl -L https://github.com/Kitware/CMake/releases/download/v3.24.1/cmake-3.24.1-linux-x86_64.tar.gz -o /usr/src/cmake/cmake.tar.gz -sS \
&& tar -C /usr/src/cmake -xzf /usr/src/cmake/cmake.tar.gz \
&& ln -s /usr/src/cmake/cmake-3.24.1-linux-x86_64/bin/cmake /usr/bin/cmake \
&& rm /usr/src/cmake/cmake.tar.gz
3 changes: 3 additions & 0 deletions scripts/build-lin-docker.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@ECHO OFF
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\PowerShell.exe -Command "& '%~dpn0.ps1'"
pause
55 changes: 55 additions & 0 deletions scripts/build-lin-docker.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#! /usr/bin/pwsh

################################################################################
# Linux SRT Build Script
#============================
# Usable on a Linux machine (or container), or called by CI systems like AppVeyor
#
# By default produces a 64-bit Release binary using C++11 threads, without
# encryption or unit tests enabled, but including test apps.
################################################################################

param (
[Parameter()][String]$CONFIGURATION = "Release",
[Parameter()][String]$DEVENV_PLATFORM = "x64",
[Parameter()][String]$ENABLE_ENCRYPTION = "OFF",
[Parameter()][String]$STATIC_LINK_SSL = "OFF",
[Parameter()][String]$CXX11 = "ON",
[Parameter()][String]$BUILD_APPS = "ON",
[Parameter()][String]$UNIT_TESTS = "OFF",
[Parameter()][String]$BUILD_DIR = "_build-linux",
[Parameter()][String]$ENABLE_SWIG = "OFF",
[Parameter()][String]$ENABLE_SWIG_CSHARP = "ON"
)

$projectRoot = Join-Path $PSScriptRoot "/.." -Resolve

# generate command to make sure an up-to-date docker container (for compiling within) is built
$execVar = "docker build -t srtbuildcontainer:latest -f $($projectRoot)/scripts/Dockerfile.linux ."
Write-Output $execVar
Invoke-Expression "& $execVar"

# clear any previous build and create & enter the build directory
$buildDir = Join-Path "$projectRoot" "$BUILD_DIR"
Write-Output "Creating (or cleaning if already existing) the folder $buildDir for project files and outputs"
Remove-Item -Path $buildDir -Recurse -Force -ErrorAction SilentlyContinue | Out-Null
New-Item -ItemType Directory -Path $buildDir -ErrorAction SilentlyContinue | Out-Null

# build the cmake command flags from arguments
$cmakeFlags = "-DCMAKE_BUILD_TYPE=$CONFIGURATION " +
"-DENABLE_STDCXX_SYNC=$CXX11 " +
"-DENABLE_APPS=$BUILD_APPS " +
"-DENABLE_ENCRYPTION=$ENABLE_ENCRYPTION " +
"-DENABLE_UNITTESTS=$UNIT_TESTS " +
"-DENABLE_SWIG=$ENABLE_SWIG " +
"-DENABLE_SWIG_CSHARP=$ENABLE_SWIG_CSHARP"

# generate command for docker run of cmake generation step
$execVar = "docker run --rm -v $($projectRoot):/srt -w /srt/$BUILD_DIR srtbuildcontainer:latest cmake -S ../ $cmakeFlags"
Write-Output $execVar
Invoke-Expression "& $execVar"

# generate command for docker run of cmake build
$execVar = "docker run --rm -v $($projectRoot):/srt -w /srt/$BUILD_DIR srtbuildcontainer:latest cmake --build ./"
Write-Output $execVar
Invoke-Expression "& $execVar"
14 changes: 14 additions & 0 deletions scripts/build-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /usr/bin/bash

set -e
set -o pipefail

if [ -d Release.linux ]; then
rm -rf ./Release.linux
fi

printf "\nBuilding Release\n"
mkdir Release.linux
cd Release.linux
cmake -S ../ -DENABLE_STDCXX_SYNC=ON -DENABLE_UNITTESTS=ON -DENABLE_EXPERIMENTAL_BONDING=ON -DENABLE_SWIG=ON
cmake --build ./
50 changes: 36 additions & 14 deletions scripts/build-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ param (
[Parameter()][String]$UNIT_TESTS = "OFF",
[Parameter()][String]$BUILD_DIR = "_build",
[Parameter()][String]$VCPKG_OPENSSL = "OFF",
[Parameter()][String]$BONDING = "OFF"
[Parameter()][String]$BONDING = "OFF",
[Parameter()][String]$ENABLE_SWIG = "ON",
[Parameter()][String]$ENABLE_SWIG_CSHARP = "ON"
)

# cmake can be optionally installed (useful when running interactively on a developer station).
Expand All @@ -38,7 +40,6 @@ if ( $Env:APPVEYOR ) {
if ( $Env:PLATFORM -eq 'x86' ) { $DEVENV_PLATFORM = 'Win32' } else { $DEVENV_PLATFORM = 'x64' }
if ( $Env:APPVEYOR_BUILD_WORKER_IMAGE -eq 'Visual Studio 2019' ) { $VS_VERSION='2019' }
if ( $Env:APPVEYOR_BUILD_WORKER_IMAGE -eq 'Visual Studio 2015' ) { $VS_VERSION='2015' }
if ( $Env:APPVEYOR_BUILD_WORKER_IMAGE -eq 'Visual Studio 2013' ) { $VS_VERSION='2013' }

#if not statically linking OpenSSL, set flag to gather the specific openssl package from the build server into package
if ( $STATIC_LINK_SSL -eq 'OFF' ) { $Env:GATHER_SSL_INTO_PACKAGE = $true }
Expand All @@ -48,13 +49,11 @@ if ( $Env:APPVEYOR ) {

$CONFIGURATION = $Env:CONFIGURATION

#appveyor has many openssl installations - place the latest one in the default location unless VS2013
if( $VS_VERSION -ne '2013' ) {
Remove-Item -Path "C:\OpenSSL-Win32" -Recurse -Force -ErrorAction SilentlyContinue | Out-Null
Remove-Item -Path "C:\OpenSSL-Win64" -Recurse -Force -ErrorAction SilentlyContinue | Out-Null
Copy-Item -Path "C:\OpenSSL-v111-Win32" "C:\OpenSSL-Win32" -Recurse | Out-Null
Copy-Item -Path "C:\OpenSSL-v111-Win64" "C:\OpenSSL-Win64" -Recurse | Out-Null
}
#appveyor has many openssl installations - place the latest v111 edition in the default location
Remove-Item -Path "C:\OpenSSL-Win32" -Recurse -Force -ErrorAction SilentlyContinue | Out-Null
Remove-Item -Path "C:\OpenSSL-Win64" -Recurse -Force -ErrorAction SilentlyContinue | Out-Null
Copy-Item -Path "C:\OpenSSL-v111-Win32" "C:\OpenSSL-Win32" -Recurse | Out-Null
Copy-Item -Path "C:\OpenSSL-v111-Win64" "C:\OpenSSL-Win64" -Recurse | Out-Null
}

# persist VS_VERSION so it can be used in an artifact name later
Expand All @@ -64,8 +63,6 @@ $Env:VS_VERSION = $VS_VERSION
if ( $VS_VERSION -eq '2019' ) { $CMAKE_GENERATOR = 'Visual Studio 16 2019'; $MSBUILDVER = "16.0"; }
if ( $VS_VERSION -eq '2015' -and $DEVENV_PLATFORM -eq 'Win32' ) { $CMAKE_GENERATOR = 'Visual Studio 14 2015'; $MSBUILDVER = "14.0"; }
if ( $VS_VERSION -eq '2015' -and $DEVENV_PLATFORM -eq 'x64' ) { $CMAKE_GENERATOR = 'Visual Studio 14 2015 Win64'; $MSBUILDVER = "14.0"; }
if ( $VS_VERSION -eq '2013' -and $DEVENV_PLATFORM -eq 'Win32' ) { $CMAKE_GENERATOR = 'Visual Studio 12 2013'; $MSBUILDVER = "12.0"; }
if ( $VS_VERSION -eq '2013' -and $DEVENV_PLATFORM -eq 'x64' ) { $CMAKE_GENERATOR = 'Visual Studio 12 2013 Win64'; $MSBUILDVER = "12.0"; }

# clear any previous build and create & enter the build directory
$buildDir = Join-Path "$projectRoot" "$BUILD_DIR"
Expand Down Expand Up @@ -132,13 +129,29 @@ if ( $VCPKG_OPENSSL -eq "ON" ) {
}
}

# check to see if SWIG is marked to be used - if so, download swig into packages folder so cmake can find it
if ( $ENABLE_SWIG -eq "ON" ) {
if ( Test-Path "$projectRoot/packages/swig/swigwin-4.1.1" ) {
Write-Output "Found pre-existing copy of Swigwin 4.1.1 - using this binary"
}
else {
Write-Output "Swigwin 4.1.1 not found - downloading and unpacking..."
Remove-Item -LiteralPath $projectRoot/packages/swig/ -Force -Recurse -ErrorAction Ignore
Invoke-WebRequest 'https://deac-fra.dl.sourceforge.net/project/swig/swigwin/swigwin-4.1.1/swigwin-4.1.1.zip' -OutFile swig.zip
Expand-Archive swig.zip -DestinationPath $projectRoot/packages/swig
Remove-Item swig.zip
}
}

# build the cmake command flags from arguments
$cmakeFlags = "-DCMAKE_BUILD_TYPE=$CONFIGURATION " +
"-DENABLE_STDCXX_SYNC=$CXX11 " +
"-DENABLE_APPS=$BUILD_APPS " +
"-DENABLE_ENCRYPTION=$ENABLE_ENCRYPTION " +
"-DENABLE_BONDING=$BONDING " +
"-DENABLE_UNITTESTS=$UNIT_TESTS"
"-DENABLE_ENCRYPTION=$ENABLE_ENCRYPTION " +
"-DENABLE_BONDING=$BONDING " +
"-DENABLE_UNITTESTS=$UNIT_TESTS " +
"-DENABLE_SWIG=$ENABLE_SWIG " +
"-DENABLE_SWIG_CSHARP=$ENABLE_SWIG_CSHARP"

# if VCPKG is flagged to provide OpenSSL, checkout VCPKG and install package
if ( $VCPKG_OPENSSL -eq 'ON' ) {
Expand Down Expand Up @@ -229,6 +242,15 @@ if ( $null -eq $msBuildPath ) {

& $msBuildPath SRT.sln -m /p:Configuration=$CONFIGURATION /p:Platform=$DEVENV_PLATFORM

# if CSharp SWIG is on, now trigger compilation of these elements (cmake for dotnet is very new, and not available in older versions)
if($ENABLE_SWIG_CSHARP){
Push-Location "$buildDir/swig_bindings/csharp"
Copy-Item "$projectRoot/srtcore/swig_bindings/csharp/*.csproj" .
& dotnet build -c $CONFIGURATION
Copy-Item "bin/$CONFIGURATION/netstandard2.0/*.dll" "$buildDir/$CONFIGURATION"
Pop-Location
}

# return to the directory previously occupied before running the script
Pop-Location

Expand Down
29 changes: 29 additions & 0 deletions scripts/create-win64-nuget.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
rem Bundle CI NuGet package for VS2015 Win64 Release only build (true package should contain multi-arch composite output)
@echo off

rem If running in AppVeyor, only create a NuGet package on VS2015 x64 Release
IF DEFINED APPVEYOR_BUILD_VERSION (
IF "%PLATFORM%"=="x64" (
IF "%VS_VERSION%"=="2015" (
IF "%CONFIGURATION%"=="Release" (
echo "Building NuPkg for this build (VS2015, x64 Release)"
nuget pack .\scripts\nuget\SrtSharp\SrtSharp.nuspec -version %APPVEYOR_BUILD_VERSION%-2015-beta
appveyor PushArtifact SrtSharp.%APPVEYOR_BUILD_VERSION%-2015-beta.nupkg
exit 0
)
)
IF "%VS_VERSION%"=="2019" (
IF "%CONFIGURATION%"=="Release" (
echo "Building NuPkg for this build (VS2019, x64 Release)"
nuget pack .\scripts\nuget\SrtSharp\SrtSharp.nuspec -version %APPVEYOR_BUILD_VERSION%-beta
appveyor PushArtifact SrtSharp.%APPVEYOR_BUILD_VERSION%-beta.nupkg
exit 0
)
)
)
echo "Skipping NuPkg build (not VS2015/2019, x64 Release)"
exit 0
) ELSE (
rem probably running on a local workstation, so use the first given argument parameter as the version number and don't push or exit
nuget pack .\scripts\nuget\SrtSharp\SrtSharp.nuspec -version %1
)
11 changes: 9 additions & 2 deletions scripts/gather-package.bat
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,27 @@ md %APPVEYOR_BUILD_FOLDER%\package\lib
IF "%GATHER_SSL_INTO_PACKAGE%"=="True" (
md %APPVEYOR_BUILD_FOLDER%\package\openssl-win%FOLDER_PLATFORM%
)
md %APPVEYOR_BUILD_FOLDER%\package\swig_bindings

rem Gather SRT includes, binaries and libs
copy %APPVEYOR_BUILD_FOLDER%\version.h %APPVEYOR_BUILD_FOLDER%\package\include\
copy %APPVEYOR_BUILD_FOLDER%\_build\version.h %APPVEYOR_BUILD_FOLDER%\package\include\
copy %APPVEYOR_BUILD_FOLDER%\srtcore\*.h %APPVEYOR_BUILD_FOLDER%\package\include\
copy %APPVEYOR_BUILD_FOLDER%\haicrypt\*.h %APPVEYOR_BUILD_FOLDER%\package\include\
copy %APPVEYOR_BUILD_FOLDER%\common\*.h %APPVEYOR_BUILD_FOLDER%\package\include\
copy %APPVEYOR_BUILD_FOLDER%\common\win\*.h %APPVEYOR_BUILD_FOLDER%\package\include\win\
copy %APPVEYOR_BUILD_FOLDER%\_build\%CONFIGURATION%\*.exe %APPVEYOR_BUILD_FOLDER%\package\bin\
copy %APPVEYOR_BUILD_FOLDER%\_build\%CONFIGURATION%\*.dll %APPVEYOR_BUILD_FOLDER%\package\bin\
copy %APPVEYOR_BUILD_FOLDER%\_build\%CONFIGURATION%\*.lib %APPVEYOR_BUILD_FOLDER%\package\lib\
copy %APPVEYOR_BUILD_FOLDER%\_build\%CONFIGURATION%\*.pdb %APPVEYOR_BUILD_FOLDER%\package\bin\

rem Gather 3rd party openssl elements
IF "%GATHER_SSL_INTO_PACKAGE%"=="True" (
(robocopy c:\openssl-win%FOLDER_PLATFORM%\ %APPVEYOR_BUILD_FOLDER%\package\openssl-win%FOLDER_PLATFORM% /s /e /np) ^& IF %ERRORLEVEL% GTR 1 exit %ERRORLEVEL%
)
IF "%CONFIGURATION%"=="Debug" (
copy %APPVEYOR_BUILD_FOLDER%\_build\%CONFIGURATION%\*.pdb %APPVEYOR_BUILD_FOLDER%\package\bin\
)

rem gather any generated bindings for languages
(robocopy %APPVEYOR_BUILD_FOLDER%\srtcore\swig_bindings\ %APPVEYOR_BUILD_FOLDER%\package\swig_bindings /s /e /np) ^& IF %ERRORLEVEL% GTR 1 exit %ERRORLEVEL%

exit 0
2 changes: 2 additions & 0 deletions scripts/get-windows-build-packages.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@ECHO OFF
PowerShell.exe -ExecutionPolicy Bypass -Command "& '%~dpn0.ps1'"
6 changes: 6 additions & 0 deletions scripts/get-windows-build-packages.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Script to grab external libraries for building these samples

# prep shared variables
$DEVENV_PLATFORM = 'x64' # alternative is x86
$FOLDER_PLATFORM = 'win64' # alternative is win32
nuget install swigwintools -version 4.0.0
Loading