From 365d1c86268eeab5bcd7ad2f2e4929c4cefd9864 Mon Sep 17 00:00:00 2001 From: zosrothko Date: Sat, 11 Nov 2017 13:30:59 +0100 Subject: [PATCH] Add Redis module Signed-off-by: zosrothko --- Redis/build.gradle | 37 +++++++++++++++++++++ Redis/testsuite/build.gradle | 63 ++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 Redis/build.gradle create mode 100644 Redis/testsuite/build.gradle diff --git a/Redis/build.gradle b/Redis/build.gradle new file mode 100644 index 000000000..fd68befb8 --- /dev/null +++ b/Redis/build.gradle @@ -0,0 +1,37 @@ +model { + components { + Redis(NativeLibrarySpec) { + sources { + rc { + source { + srcDir '..' + include 'DLLVersion.rc' + } + } + cpp { + source { + srcDir 'src' + include '**/*.cpp' + } + exportedHeaders { + srcDir 'include' + } + lib project: ':Net', library: 'Net' + lib project: ':Foundation', library: 'Foundation' + } + } + } + } + binaries { + all { + } + withType(SharedLibraryBinarySpec) { + if (toolChain in VisualCpp) { + cppCompiler.define "Redis_EXPORTS" + } + } + } +} +task poco { dependsOn "assemble" } + + diff --git a/Redis/testsuite/build.gradle b/Redis/testsuite/build.gradle new file mode 100644 index 000000000..8c4a09549 --- /dev/null +++ b/Redis/testsuite/build.gradle @@ -0,0 +1,63 @@ +import org.gradle.nativeplatform.test.cppunit.CppUnitTestSuiteSpec + +model { + components { + withType(NativeComponentSpec) { + binaries.withType(NativeBinarySpec) { + if (buildType == buildTypes.debug) { + if (it instanceof NativeExecutableBinarySpec) { + executable.file = toLocalBin(appendDebugSuffix(executable.file), targetPlatform) + } + } else + if (buildType == buildTypes.release) { + if (it instanceof NativeExecutableBinarySpec) { + executable.file = toLocalBin(executable.file, targetPlatform) + } + } + } + } + TestSuite(NativeLibrarySpec) { + sources { + cpp { + source { + srcDir 'src' + include '**/*.cpp' + exclude '*Driver.cpp' + } + exportedHeaders { + srcDir 'src' + } + lib project: ':CppUnit', library: 'CppUnit', linkage: 'shared' + lib project: ':Redis', library: 'Redis', linkage: 'shared' + lib project: ':Net', library: 'Net', linkage: 'shared' + lib project: ':Foundation', library: 'Foundation', linkage: 'shared' + } + } + } + } + testSuites { + RedisTestSuite(org.gradle.nativeplatform.test.cppunit.CppUnitTestSuiteSpec) { + testing $.components.TestSuite + } + } + binaries { + withType(org.gradle.nativeplatform.test.cppunit.CppUnitTestSuiteBinarySpec) { + lib project: ':CppUnit', library: 'CppUnit', linkage: 'shared' + if (toolChain in VisualCpp) { + if (buildType == buildTypes.debug) { + cCompiler.args "/MDd" + cppCompiler.args "/MDd" + } else + if (buildType == buildTypes.release) { + cCompiler.args "/MD" + cppCompiler.args "/MD" + } else { + throw new GradleException("Unknown buildType" + buildType) + } + } + if (toolChain in Gcc) { + } + } + } +} +task testsuite { dependsOn "assemble" }