Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

Commit 3fb2e5f

Browse files
prepare 2.0.0 release (#17)
1 parent f95cdbb commit 3fb2e5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+8947
-3569
lines changed

.circleci/config.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
docker:
1717
- image: ldcircleci/ld-c-sdk-ubuntu # defined in sdks-ci-docker project
1818
- image: redis
19+
environment:
20+
CTEST_OUTPUT_ON_FAILURE: 1
1921
steps:
2022
- checkout
2123
- run:
@@ -26,11 +28,15 @@ jobs:
2628
cmake --build .
2729
- run:
2830
name: Test
29-
command: ./.ldrelease/test.sh
31+
command: |
32+
cd build
33+
CTEST_OUTPUT_ON_FAILURE=1 make test
3034
3135
build-test-osx:
3236
macos:
3337
xcode: "9.0"
38+
environment:
39+
CTEST_OUTPUT_ON_FAILURE: 1
3440
steps:
3541
- checkout
3642
- run:
@@ -51,12 +57,16 @@ jobs:
5157
cmake --build .
5258
- run:
5359
name: Test
54-
command: ./.ldrelease/test.sh
60+
command: |
61+
cd build
62+
CTEST_OUTPUT_ON_FAILURE=1 make test
5563
5664
build-test-windows:
5765
executor:
5866
name: win/vs2019
5967
shell: powershell.exe
68+
environment:
69+
CTEST_OUTPUT_ON_FAILURE: 1
6070
steps:
6171
- checkout
6272
- run:

.ldrelease/build.ps1

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,42 @@ ExecuteOrFail { cmake --build . }
2828
Pop-Location
2929

3030
Write-Host
31-
Write-Host Building SDK
31+
Write-Host Building SDK statically
3232
Push-Location
33-
New-Item -ItemType Directory -Force -Path .\build
34-
cd build
35-
ExecuteOrFail { cmake -G "Visual Studio 16 2019" -A x64 .. }
33+
New-Item -ItemType Directory -Force -Path ".\build-static"
34+
cd "build-static"
35+
New-Item -ItemType Directory -Force -Path release
36+
ExecuteOrFail {
37+
cmake -G "Visual Studio 16 2019" -A x64 `
38+
-D SKIP_DATABASE_TESTS=ON `
39+
-D CMAKE_INSTALL_PREFIX="C:/Users/circleci/project/build-static/release" `
40+
-D CURL_LIBRARY="C:/Users/circleci/project/curl-7.59.0/builds/libcurl-vc-x64-release-static-ipv6-sspi-winssl/lib/libcurl_a.lib" `
41+
-D CURL_INCLUDE_DIR="C:/Users/circleci/project/curl-7.59.0/builds/libcurl-vc-x64-release-static-ipv6-sspi-winssl/include" `
42+
-D PCRE_LIBRARY="C:/Users/circleci/project/pcre-8.43/build/Debug/pcred.lib" `
43+
-D PCRE_INCLUDE_DIR="C:/Users/circleci/project/pcre-8.43/build" `
44+
..
45+
}
46+
ExecuteOrFail { cmake --build . }
47+
ExecuteOrFail { cmake --build . --target install }
48+
Pop-Location
49+
50+
Write-Host
51+
Write-Host Building SDK dynamically
52+
Push-Location
53+
New-Item -ItemType Directory -Force -Path ".\build-dynamic"
54+
cd "build-dynamic"
55+
New-Item -ItemType Directory -Force -Path release
56+
ExecuteOrFail {
57+
cmake -G "Visual Studio 16 2019" -A x64 `
58+
-D BUILD_TESTING=OFF `
59+
-D BUILD_SHARED_LIBS=ON `
60+
-D CMAKE_INSTALL_PREFIX="C:/Users/circleci/project/build-dynamic/release" `
61+
-D CURL_LIBRARY="C:/Users/circleci/project/curl-7.59.0/builds/libcurl-vc-x64-release-static-ipv6-sspi-winssl/lib/libcurl_a.lib" `
62+
-D CURL_INCLUDE_DIR="C:/Users/circleci/project/curl-7.59.0/builds/libcurl-vc-x64-release-static-ipv6-sspi-winssl/include" `
63+
-D PCRE_LIBRARY="C:/Users/circleci/project/pcre-8.43/build/Debug/pcred.lib" `
64+
-D PCRE_INCLUDE_DIR="C:/Users/circleci/project/pcre-8.43/build" `
65+
..
66+
}
3667
ExecuteOrFail { cmake --build . }
68+
ExecuteOrFail { cmake --build . --target install }
3769
Pop-Location

.ldrelease/build.sh

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,30 @@ set -e
55
# Releaser runs this script for both the Linux build and the Mac build. If we ever need them
66
# to be different, we can instead provide linux-build.sh and mac-build.sh
77

8-
mkdir build
9-
cd build
10-
cmake -D REDIS_STORE=ON -D SKIP_DATABASE_TESTS=ON ..
8+
mkdir -p build-static && cd build-static
9+
mkdir -p release
10+
cmake -D SKIP_DATABASE_TESTS=ON -D CMAKE_INSTALL_PREFIX=./release ..
11+
cmake --build .
12+
cmake --build . --target install
13+
cd ..
1114

12-
make
15+
mkdir -p build-dynamic && cd build-dynamic
16+
mkdir -p release
17+
cmake -D BUILD_TESTING=OFF -D BUILD_SHARED_LIBS=ON -D CMAKE_INSTALL_PREFIX=./release ..
18+
cmake --build .
19+
cmake --build . --target install
20+
cd ..
21+
22+
mkdir -p build-redis-static && cd build-redis-static
23+
mkdir -p release
24+
cmake -D SKIP_BASE_INSTALL=ON -D REDIS_STORE=ON -D BUILD_TESTING=OFF -D CMAKE_INSTALL_PREFIX=./release ..
25+
cmake --build .
26+
cmake --build . --target install
27+
cd ..
28+
29+
mkdir -p build-redis-dynamic && cd build-redis-dynamic
30+
mkdir -p release
31+
cmake -D SKIP_BASE_INSTALL=ON -D REDIS_STORE=ON -D BUILD_TESTING=OFF -D BUILD_SHARED_LIBS=ON -D CMAKE_INSTALL_PREFIX=./release ..
32+
cmake --build .
33+
cmake --build . --target install
34+
cd ..

.ldrelease/linux-publish.sh

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

.ldrelease/mac-publish.sh

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

.ldrelease/publish.ps1

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11

22
# Windows test script for PowerShell (just puts artifacts in output directory)
33

4+
$ErrorActionPreference = "Stop"
5+
6+
$global:ProgressPreference = "SilentlyContinue" # prevents console errors from CircleCI host
7+
8+
# the built in powershell zip seems to be horribly broken when working with nested directories
9+
choco install zip
10+
411
$prefix = $env:LD_LIBRARY_FILE_PREFIX # set in .ldrelease/config.yml
512
New-Item -ItemType Directory -Force -Path .\artifacts
613

7-
cp ".\build\Debug\ldserverapidynamic.dll" ".\artifacts\$prefix-ldserverapi-dynamic.dll"
8-
cp ".\build\Debug\ldserverapidynamic.lib" ".\artifacts\$prefix-ldserverapi-dynamic.lib"
9-
cp ".\build\Debug\ldserverapi.lib" ".\artifacts\$prefix-ldserverapi-static.lib"
14+
cd "build-static/release"
15+
zip -r "../../artifacts/${prefix}-static.zip" *
16+
cd ..
17+
cd ..
18+
19+
cd "build-dynamic/release"
20+
zip -r "../../artifacts/${prefix}-dynamic.zip" *
21+
cd ..
22+
cd ..

.ldrelease/publish.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
set -e
2+
3+
mkdir -p artifacts
4+
5+
base=$(pwd)
6+
7+
# cp build/libldserverapi.a artifacts/${LD_LIBRARY_FILE_PREFIX}-libldserverapi.a
8+
# cp build/libldserverapidynamic.so artifacts/${LD_LIBRARY_FILE_PREFIX}-libldserverapidynamic.so
9+
# build/stores/redis/libldserverapi-redis.a artifacts/${LD_LIBRARY_FILE_PREFIX}-libldserverapi-redis.a
10+
11+
cd "${base}/build-static/release"
12+
zip -r "${base}/artifacts/${LD_LIBRARY_FILE_PREFIX}-static.zip" *
13+
tar -cf "${base}/artifacts/${LD_LIBRARY_FILE_PREFIX}-static.tar" *
14+
15+
cd "${base}/build-dynamic/release"
16+
zip -r "${base}/artifacts/${LD_LIBRARY_FILE_PREFIX}-dynamic.zip" *
17+
tar -cf "${base}/artifacts/${LD_LIBRARY_FILE_PREFIX}-dynamic.tar" *
18+
19+
cd "${base}/build-redis-static/release"
20+
zip -r "${base}/artifacts/${LD_LIBRARY_FILE_PREFIX}-redis-static.zip" *
21+
tar -cf "${base}/artifacts/${LD_LIBRARY_FILE_PREFIX}-redis-static.tar" *
22+
23+
cd "${base}/build-redis-dynamic/release"
24+
zip -r "${base}/artifacts/${LD_LIBRARY_FILE_PREFIX}-redis-dynamic.zip" *
25+
tar -cf "${base}/artifacts/${LD_LIBRARY_FILE_PREFIX}-redis-dynamic.tar" *

.ldrelease/test.ps1

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ Import-Module ".\.ldrelease\helpers.psm1" -Force
77

88
SetupVSToolsEnv -architecture amd64
99

10-
cd build
10+
cd build-static
1111
ExecuteOrFail { cmake --build . --target RUN_TESTS }

.ldrelease/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ set -e
55
# Releaser runs this script for both the Linux build and the Mac build. If we ever need them
66
# to be different, we can instead provide linux-test.sh and mac-test.sh
77

8-
cd build
8+
cd build-static
99
CTEST_OUTPUT_ON_FAILURE=1 make test

CMakeFiles/FindPCRE.cmake

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (C) 2007-2009 LuaDist.
2+
# Created by Peter Kapec <kapecp@gmail.com>
3+
# Redistribution and use of this file is allowed according to the terms of the MIT license.
4+
# For details see the COPYRIGHT file distributed with LuaDist.
5+
# Note:
6+
# Searching headers and libraries is very simple and is NOT as powerful as scripts
7+
# distributed with CMake, because LuaDist defines directories to search for.
8+
# Everyone is encouraged to contact the author with improvements. Maybe this file
9+
# becomes part of CMake distribution sometimes.
10+
11+
# - Find pcre
12+
# Find the native PCRE headers and libraries.
13+
#
14+
# PCRE_INCLUDE_DIRS - where to find pcre.h, etc.
15+
# PCRE_LIBRARIES - List of libraries when using pcre.
16+
# PCRE_FOUND - True if pcre found.
17+
18+
# Look for the header file.
19+
FIND_PATH(PCRE_INCLUDE_DIR NAMES pcre.h)
20+
21+
# Look for the library.
22+
FIND_LIBRARY(PCRE_LIBRARY NAMES pcre)
23+
24+
# Handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if all listed variables are TRUE.
25+
INCLUDE(FindPackageHandleStandardArgs)
26+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG PCRE_LIBRARY PCRE_INCLUDE_DIR)
27+
28+
# Copy the results to the output variables.
29+
IF(PCRE_FOUND)
30+
SET(PCRE_LIBRARIES ${PCRE_LIBRARY})
31+
SET(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR})
32+
ELSE(PCRE_FOUND)
33+
SET(PCRE_LIBRARIES)
34+
SET(PCRE_INCLUDE_DIRS)
35+
ENDIF(PCRE_FOUND)
36+
37+
MARK_AS_ADVANCED(PCRE_INCLUDE_DIRS PCRE_LIBRARIES)

0 commit comments

Comments
 (0)