Update gradle

This commit is contained in:
zosrothko 2018-04-20 13:25:51 +02:00
parent dc0897e26f
commit ca03c6b471
5 changed files with 103 additions and 90 deletions

View File

@ -7,22 +7,22 @@ model {
if (buildType == buildTypes.debug) {
libName = 'libmysqld.lib'
if (targetPlatform.name == 'win32') {
headers.srcDir "$mysql32Home/include"
headers.srcDir new File("$mysql32Home/include")
staticLibraryFile = new File("$mysql32Home/lib/$libName")
} else
if (targetPlatform.name == 'win64') {
headers.srcDir "$mysql64Home/include"
headers.srcDir new File("$mysql64Home/include")
staticLibraryFile = new File("$mysql64Home/lib/$libName")
}
} else
if (buildType == buildTypes.release) {
libName = 'libmysql.lib'
if (targetPlatform.name == 'win32') {
headers.srcDir "$mysql32Home/include"
headers.srcDir new File("$mysql32Home/include")
staticLibraryFile = new File("$mysql32Home/lib/$libName")
} else
if (targetPlatform.name == 'win64') {
headers.srcDir "$mysql64Home/include"
headers.srcDir new File("$mysql64Home/include")
staticLibraryFile = new File("$mysql64Home/lib/$libName")
}
}
@ -34,12 +34,12 @@ model {
dllName = 'libmysqld.dll'
linkName = 'libmysqld.lib'
if (targetPlatform.name == 'win32') {
headers.srcDir "$mysql32Home/include"
headers.srcDir new File("$mysql32Home/include")
sharedLibraryFile = new File("$mysql32Home/lib/$dllName")
sharedLibraryLinkFile = new File("$mysql32Home/lib/$linkName")
} else
if (targetPlatform.name == 'win64') {
headers.srcDir "$mysql64Home/include"
headers.srcDir new File("$mysql64Home/include")
sharedLibraryFile = new File("$mysql64Home/lib/$dllName")
sharedLibraryLinkFile = new File("$mysql64Home/lib/$linkName")
}
@ -48,12 +48,12 @@ model {
dllName = 'libmysql.dll'
linkName = 'libmysql.lib'
if (targetPlatform.name == 'win32') {
headers.srcDir "$mysql32Home/include"
headers.srcDir new File("$mysql32Home/include")
sharedLibraryFile = new File("$mysql32Home/lib/$dllName")
sharedLibraryLinkFile = new File("$mysql32Home/lib/$linkName")
} else
if (targetPlatform.name == 'win64') {
headers.srcDir "$mysql64Home/include"
headers.srcDir new File("$mysql64Home/include")
sharedLibraryFile = new File("$mysql64Home/lib/$dllName")
sharedLibraryLinkFile = new File("$mysql64Home/lib/$linkName")
}
@ -73,7 +73,7 @@ model {
exportedHeaders {
srcDir 'include'
}
lib library: 'mysql'
// lib library: 'mysql'
lib project: ':Data', library: 'Data'
lib project: ':Foundation', library: 'Foundation'
}
@ -83,10 +83,26 @@ model {
binaries {
all {
cppCompiler.define "THREADSAFE"
cppCompiler.define "__LCC__"
if (toolChain in VisualCpp) {
cppCompiler.define "WINVER=0x0600"
cppCompiler.define "__LCC__"
}
/*
SYSLIBS += -L/usr/local/lib$(LIB64SUFFIX)/mysql -L/usr/lib$(LIB64SUFFIX)/mysql -L/usr/mysql/lib$(LIB64SUFFIX) -L/usr/mysql/lib$(LIB64SUFFIX)/mysql -L/usr/local/mysql/lib$(LIB64SUFFIX) -lmysqlclient
INCLUDE += -I/usr/local/include/mysql/ -I/usr/include/mysql/ -I/usr/mysql/include/mysql -I/usr/local/mysql/include
SYSFLAGS += -DTHREADSAFE -DNO_TCL
*/
if (toolChain in Gcc) {
def String LIB64SUFFIX = "64"
cppCompiler.define "NO_TCL"
cppCompiler.args ( "-I", "/usr/local/include/mysql/" )
cppCompiler.args ( "-I", "/usr/include/mysql/" )
cppCompiler.args ( "-I", "/usr/mysql/include/mysql" )
cppCompiler.args ( "-I", "/usr/local/mysql/include" )
linker.args "-L/usr/local/lib$LIB64SUFFIX/mysql -L/usr/lib$LIB64SUFFIX/mysql -L/usr/mysql/lib$LIB64SUFFIX -L/usr/mysql/lib$LIB64SUFFIX/mysql -L/usr/local/mysql/lib$LIB64SUFFIX -lmysqlclient"
}
}
withType(SharedLibraryBinarySpec) {
if (toolChain in VisualCpp) {

View File

@ -82,5 +82,3 @@ model {
}
}
task poco { dependsOn "assemble" }

View File

@ -272,37 +272,37 @@ subprojects {
def libName = "foobar"
if (buildType == buildTypes.debug) {
if (targetPlatform.name == 'win32') {
headers.srcDir "$openSSLWinHome/include"
headers.srcDir "$openSSLWindowsHome/include"
libName = 'libcryptod.lib'
staticLibraryFile = file("$openSSLWinHome/win32/lib/debug/$libName")
staticLibraryFile = new File("$openSSLWindowsHome/win32/lib/debug/$libName")
} else if (targetPlatform.name == 'win64') {
headers.srcDir "$openSSLWinHome/include"
headers.srcDir "$openSSLWindowsHome/include"
libName = 'libcryptod.lib'
staticLibraryFile = file("$openSSLWinHome/win64/lib/debug/$libName")
staticLibraryFile = new File("$openSSLWindowsHome/win64/lib/debug/$libName")
} else if (targetPlatform.operatingSystem.macOsX) {
headers.srcDir "$openSSLBrewHome/include"
libName = 'libcryptod.a'
staticLibraryFile = file("$openSSLBrewHome/lib/$libName")
staticLibraryFile = new File("$openSSLBrewHome/lib/$libName")
} else if (targetPlatform.operatingSystem.linux) {
headers.srcDir "$openSSLLinuxInc/include"
libName = 'libcrypto.a'
staticLibraryFile = file("$openSSLLinuxLib/$libName")
staticLibraryFile = new File("$openSSLLinuxLib/$libName")
}
} else
if (buildType == buildTypes.release) {
if (targetPlatform.name == 'win32') {
libName = 'libcrypto.lib'
staticLibraryFile = file("$openSSLWinHome/win32/lib/release/$libName")
staticLibraryFile = new File("$openSSLWindowsHome/win32/lib/release/$libName")
} else if (targetPlatform.name == 'win64') {
libName = 'libcrypto.lib'
staticLibraryFile = file("$openSSLWinHome/win64/lib/release/$libName")
staticLibraryFile = new File("$openSSLWindowsHome/win64/lib/release/$libName")
} else if (targetPlatform.operatingSystem.macOsX) {
libName = 'libcrypto.a'
staticLibraryFile = file("$openSSLBrewHome/lib/$libName")
staticLibraryFile = new File("$openSSLBrewHome/lib/$libName")
} else if (targetPlatform.operatingSystem.linux) {
headers.srcDir "$openSSLLinuxInc/include"
libName = 'libcrypto.a'
staticLibraryFile = file("$openSSLLinuxLib/$libName")
staticLibraryFile = new File("$openSSLLinuxLib/$libName")
}
} else {
throw new GradleException("Unknown buildType" + buildType)
@ -315,48 +315,48 @@ subprojects {
if (targetPlatform.name == 'win32') {
dllName = 'libcryptod.dll'
linkName = 'libcryptod.lib'
sharedLibraryFile = file("$openSSLWinHome/win32/bin/debug/$dllName")
sharedLibraryLinkFile = file("$openSSLWinHome/win32/bin/debug/$linkName")
sharedLibraryFile = new File("$openSSLWindowsHome/win32/bin/debug/$dllName")
sharedLibraryLinkFile = new File("$openSSLWindowsHome/win32/bin/debug/$linkName")
} else if (targetPlatform.name == 'win64') {
dllName = 'libcryptod.dll'
linkName = 'libcryptod.lib'
sharedLibraryFile = file("$openSSLWinHome/win64/bin/debug/$dllName")
sharedLibraryLinkFile = file("$openSSLWinHome/win64/bin/debug/$linkName")
sharedLibraryFile = new File("$openSSLWindowsHome/win64/bin/debug/$dllName")
sharedLibraryLinkFile = new File("$openSSLWindowsHome/win64/bin/debug/$linkName")
} else if (targetPlatform.operatingSystem.macOsX) {
dllName = 'libcryptod.dylib'
linkName = 'libcryptod.dylib'
sharedLibraryFile = file("$openSSLBrewHome/lib/$dllName")
sharedLibraryLinkFile = file("$openSSLBrewHome/lib/$linkName")
sharedLibraryFile = new File("$openSSLBrewHome/lib/$dllName")
sharedLibraryLinkFile = new File("$openSSLBrewHome/lib/$linkName")
} else if (targetPlatform.operatingSystem.linux) {
headers.srcDir "$openSSLLinuxInc/include"
dllName = 'libcrypto.so'
linkName = 'libcrypto.a'
sharedLibraryFile = file("$openSSLLinuxLib/$dllName")
sharedLibraryLinkFile = file("$openSSLLinuxLib/$linkName")
sharedLibraryFile = new File("$openSSLLinuxLib/$dllName")
sharedLibraryLinkFile = new File("$openSSLLinuxLib/$linkName")
}
} else
if (buildType == buildTypes.release) {
if (targetPlatform.name == 'win32') {
dllName = 'libcrypto.dll'
linkName = 'libcrypto.lib'
sharedLibraryFile = file("$openSSLWinHome/win32/bin/release/$dllName")
sharedLibraryLinkFile = file("$openSSLWinHome/win32/bin/release/$linkName")
sharedLibraryFile = new File("$openSSLWindowsHome/win32/bin/release/$dllName")
sharedLibraryLinkFile = new File("$openSSLWindowsHome/win32/bin/release/$linkName")
} else if (targetPlatform.name == 'win64') {
dllName = 'libcrypto.dll'
linkName = 'libcrypto.lib'
sharedLibraryFile = file("$openSSLWinHome/win64/bin/release/$dllName")
sharedLibraryLinkFile = file("$openSSLWinHome/win64/bin/release/$linkName")
sharedLibraryFile = new File("$openSSLWindowsHome/win64/bin/release/$dllName")
sharedLibraryLinkFile = new File("$openSSLWindowsHome/win64/bin/release/$linkName")
} else if (targetPlatform.operatingSystem.macOsX) {
dllName = 'libcrypto.dylib'
linkName = 'libcrypto.dylib'
sharedLibraryFile = file("$openSSLBrewHome/lib/$dllName")
sharedLibraryLinkFile = file("$openSSLBrewHome/lib/$linkName")
sharedLibraryFile = new File("$openSSLBrewHome/lib/$dllName")
sharedLibraryLinkFile = new File("$openSSLBrewHome/lib/$linkName")
} else if (targetPlatform.operatingSystem.linux) {
headers.srcDir "$openSSLLinuxInc/include"
dllName = 'libcrypto.so'
linkName = 'libcrypto.a'
sharedLibraryFile = file("$openSSLLinuxLib/$dllName")
sharedLibraryLinkFile = file("$openSSLLinuxLib/$linkName")
sharedLibraryFile = new File("$openSSLLinuxLib/$dllName")
sharedLibraryLinkFile = new File("$openSSLLinuxLib/$linkName")
}
} else {
throw new GradleException("Unknown buildType" + buildType)
@ -369,36 +369,36 @@ subprojects {
def libName
if (buildType == buildTypes.debug) {
if (targetPlatform.name == 'win32') {
headers.srcDir "$openSSLWinHome/include"
headers.srcDir "$openSSLWindowsHome/include"
libName = 'libssld.lib'
staticLibraryFile = file("$openSSLWinHome/win32/lib/debug/$libName")
staticLibraryFile = new File("$openSSLWindowsHome/win32/lib/debug/$libName")
} else if (targetPlatform.name == 'win64') {
headers.srcDir "$openSSLWinHome/include"
headers.srcDir "$openSSLWindowsHome/include"
libName = 'libssld.lib'
staticLibraryFile = file("$openSSLWinHome/win64/lib/debug/$libName")
staticLibraryFile = new File("$openSSLWindowsHome/win64/lib/debug/$libName")
} else if (targetPlatform.operatingSystem.macOsX) {
libName = 'libssld.a'
staticLibraryFile = file("$openSSLBrewHome/lib/$libName")
staticLibraryFile = new File("$openSSLBrewHome/lib/$libName")
} else if (targetPlatform.operatingSystem.linux) {
headers.srcDir "$openSSLLinuxInc/include"
libName = 'libssl.a'
staticLibraryFile = file("$openSSLLinuxLib/$libName")
staticLibraryFile = new File("$openSSLLinuxLib", "$libName")
}
} else
if (buildType == buildTypes.release) {
if (targetPlatform.name == 'win32') {
libName = 'libssl.lib'
staticLibraryFile = file("$openSSLWinHome/win32/lib/release/$libName")
staticLibraryFile = new File("$openSSLWindowsHome/win32/lib/release/$libName")
} else if (targetPlatform.name == 'win64') {
libName = 'libssl.lib'
staticLibraryFile = file("$openSSLWinHome/win64/lib/release/$libName")
staticLibraryFile = new File("$openSSLWindowsHome/win64/lib/release/$libName")
} else if (targetPlatform.operatingSystem.macOsX) {
libName = 'libssl.a'
staticLibraryFile = file("$openSSLBrewHome/lib/$libName")
staticLibraryFile = new File("$openSSLBrewHome/lib/$libName")
} else if (targetPlatform.operatingSystem.linux) {
headers.srcDir "$openSSLLinuxInc/include"
libName = 'libssl.a'
staticLibraryFile = file("$openSSLLinuxLib/$libName")
staticLibraryFile = new File("$openSSLLinuxLib/$libName")
}
} else {
throw new GradleException("Unknown buildType" + buildType)
@ -411,47 +411,48 @@ subprojects {
if (targetPlatform.name == 'win32') {
dllName = 'libssld.dll'
linkName = 'libssld.lib'
sharedLibraryFile = file("$openSSLWinHome/win32/bin/debug/$dllName")
sharedLibraryLinkFile = file("$openSSLWinHome/win32/bin/debug/$linkName")
sharedLibraryFile = new File("$openSSLWindowsHome/win32/bin/debug/$dllName")
sharedLibraryLinkFile = new File("$openSSLWindowsHome/win32/bin/debug/$linkName")
} else if (targetPlatform.name == 'win64') {
dllName = 'libssld.dll'
linkName = 'libssld.lib'
sharedLibraryFile = file("$openSSLWinHome/win64/bin/debug/$dllName")
sharedLibraryLinkFile = file("$openSSLWinHome/win64/bin/debug/$linkName")
sharedLibraryFile = new File("$openSSLWindowsHome/win64/bin/debug/$dllName")
sharedLibraryLinkFile = new File("$openSSLWindowsHome/win64/bin/debug/$linkName")
} else if (targetPlatform.operatingSystem.macOsX) {
dllName = 'libssld.dylib'
linkName = 'libssld.dylib'
sharedLibraryFile = file("$openSSLBrewHome/lib/$dllName")
sharedLibraryLinkFile = file("$openSSLBrewHome/lib/$linkName")
sharedLibraryFile = new File("$openSSLBrewHome/lib/$dllName")
sharedLibraryLinkFile = new File("$openSSLBrewHome/lib/$linkName")
} else if (targetPlatform.operatingSystem.linux) {
def File openSSLLinuxLibFile = new File("$openSSLLinuxLib")
headers.srcDir "$openSSLLinuxInc/include"
dllName = 'libssl.so'
linkName = 'libssl.a'
sharedLibraryFile = file("$openSSLLinuxLib/$dllName")
sharedLibraryLinkFile = file("$openSSLLinuxLib/$linkName")
dllName = "libssl.so"
linkName = "libssl.a"
sharedLibraryFile = new File(openSSLLinuxLibFile, dllName)
sharedLibraryLinkFile = new File(openSSLLinuxLibFile, linkName)
}
} else if (buildType == buildTypes.release) {
if (targetPlatform.name == 'win32') {
dllName = 'libssl.dll'
linkName = 'libssl.lib'
sharedLibraryFile = file("$openSSLWinHome/win32/bin/release/$dllName")
sharedLibraryLinkFile = file("$openSSLWinHome/win32/bin/release/$linkName")
sharedLibraryFile = new File("$openSSLWindowsHome/win32/bin/release/$dllName")
sharedLibraryLinkFile = new File("$openSSLWindowsHome/win32/bin/release/$linkName")
} else if (targetPlatform.name == 'win64') {
dllName = 'libssl.dll'
linkName = 'libssl.lib'
sharedLibraryFile = file("$openSSLWinHome/win64/bin/release/$dllName")
sharedLibraryLinkFile = file("$openSSLWinHome/win64/bin/release/$linkName")
sharedLibraryFile = new File("$openSSLWindowsHome/win64/bin/release/$dllName")
sharedLibraryLinkFile = new File("$openSSLWindowsHome/win64/bin/release/$linkName")
} else if (targetPlatform.operatingSystem.macOsX) {
dllName = 'libssl.dylib'
linkName = 'libssl.dylib'
sharedLibraryFile = file("$openSSLBrewHome/lib/$dllName")
sharedLibraryLinkFile = file("$openSSLBrewHome/lib/$linkName")
sharedLibraryFile = new File("$openSSLBrewHome/lib/$dllName")
sharedLibraryLinkFile = new File("$openSSLBrewHome/lib/$linkName")
} else if (targetPlatform.operatingSystem.linux) {
headers.srcDir "$openSSLLinuxInc/include"
dllName = 'libssl.so'
linkName = 'libssl.a'
sharedLibraryFile = file("$openSSLLinuxLib/$dllName")
sharedLibraryLinkFile = file("$openSSLLinuxLib/$linkName")
sharedLibraryFile = new File("$openSSLLinuxLib/$dllName")
sharedLibraryLinkFile = new File("$openSSLLinuxLib/$linkName")
}
} else {
throw new GradleException("Unknown buildType" + buildType)
@ -462,7 +463,7 @@ subprojects {
}
components {
withType(NativeComponentSpec) {
targetPlatform "linux32"
//targetPlatform "linux32"
targetPlatform "linux64"
targetPlatform "macos"
@ -796,24 +797,21 @@ subprojects {
args test
}
}
tasks.withType(CppCompile) {
maxParallelForks = 2
}
task PocoDocIni {
task PocoDocIni() {
def file = new File("$rootDir/PocoDoc/PocoDoc.ini")
file.createNewFile()
file.text = """
Includes=-I$rootDir/CppParser/include,-I$rootDir/CppUnit/include,-I$rootDir/Encodings/include,-I$rootDir/Crypto/include,-I$rootDir/Data/include,-I$rootDir/Data/include,-I$rootDir/Data/MySQL/include,-I$rootDir/Data/ODBC/include,-I$rootDir/Data/PostgreSQL/include,-I$rootDir/Data/SQLite/include, -I$rootDir/Data/SQLite/src,-I$rootDir/Foundation/include,-I$rootDir/JSON/include,-I$rootDir/MongoDB/include,-I$rootDir/Net/include,-I$rootDir/NetSSL_OpenSSL/include,-I$rootDir/NetSSL_Win/include,-I$rootDir/Redis/include,-I$rootDir/Util/include,-I$rootDir/XML/include,-I$rootDir/Zip/include,-I$rootDir/SevenZip/include,-I$rootDir/PDF/include
PocoBuild=$rootDir
PocoBase=$rootDir
PocoDoc.output=releases/poco-${version}-all-doc
PocoDoc.version=${version}-all
Includes=-I${postgres32Home}/include,-I${mysql32Home}/include,-ICppParser/include,-ICppUnit/include,-ICrypto/include,-IData/include,-IData/include,-IData/MySQL/include,-IData/ODBC/include,-IData/PostgreSQL/include,-IData/SQLite/include, -IData/SQLite/src,-IFoundation/include,-IJSON/include,-IMongoDB/include,-INet/include,-INetSSL_OpenSSL/include,-INetSSL_Win/include,-IRedis/include,-IUtil/include,-IXML/include,-IZip/include,-ISevenZip/include,-IPDF/include
"""
if (os.windows) {
def String javaVCH = VCHome.replace('\\','/')
@ -830,7 +828,7 @@ CLP=${javaCLP}
if (os.linux) {
file.text += """
CXX=g++
CXXFLAGS=
CXXFLAGS=-std=c++11
"""
} else
if (os.macos) {
@ -850,13 +848,13 @@ task pocoDoc(type: Exec) {
if (os.linux) {
environment "LD_LIBRARY_PATH", "$rootDir/lib64:$LD_LIBRARY_PATH"
executable "PocoDoc/bin64/PocoDoc"
args "-config=$rootDir/PocoDoc/cfg/mkdoc-gradle.xml"
args "-config=$rootDir/PocoDoc/PocoDoc.ini"
args "--config=$rootDir/PocoDoc/cfg/mkdoc-gradle.xml"
args "--config=$rootDir/PocoDoc/PocoDoc.ini"
}
if (os.macOsX) {
//FIXME environment "LD_LIBRARY_PATH", "$rootDir/bin:$LD_LIBRARY_PATH"
args "-config=$rootDir/PocoDoc/cfg/mkdoc-gradle.xml"
args "-config=$rootDir/PocoDoc/PocoDoc.ini"
args "--config=$rootDir/PocoDoc/cfg/mkdoc-gradle.xml"
args "--config=$rootDir/PocoDoc/PocoDoc.ini"
}
// inputs.files(tasks.getByPath(':production').outputs.files)
inputs.files(executable)

View File

@ -43,19 +43,21 @@ OpenCppCoverageHome=C:/Program Files/OpenCppCoverage
#ReportGeneratorHome=C:/ProgramFiles/ReportGenerator
ReportGeneratorHome=C:/ProgramFiles/ReportGenerator
openSSLWindowsHome = "openssl/build"
openSSLWindowsHome = openssl/build
###############################################################################
# Linux Customization
###############################################################################
openSSLLinuxLib = "/usr/local/lib"
openSSLLinuxInc = "/usr/local/include/openssl"
openSSLLinuxLib = /usr/local/lib
openSSLLinuxInc = /usr/local/include/openssl
mysql32LinuxLib =
mysql32LinuxInc = /usr/local
###############################################################################
# Mac OSX Customization
###############################################################################
openSSLBrewHome = "/usr/local/opt/openssl"
openSSLBrewHome = /usr/local/opt/openssl
###############################################################################

View File

@ -8,8 +8,8 @@ include ':XML'
include ':JSON'
include ':Util'
include ':Net'
//include ':Crypto'
//include ':NetSSL_OpenSSL'
include ':Crypto'
include ':NetSSL_OpenSSL'
if (os.windows) {
include ':NetSSL_Win'
}
@ -17,7 +17,7 @@ include ':Data'
// SQL not ready yet
include ':Data:ODBC'
//include ':Data:SQLite'
//include ':Data:MySQL'
include ':Data:MySQL'
include ':Zip'
include ':PageCompiler'
include ':PageCompiler:File2Page'
@ -34,16 +34,15 @@ include ':XML:testsuite'
include ':JSON:testsuite'
include ':Util:testsuite'
include ':Net:testsuite'
//include ':Crypto:testsuite'
//include ':NetSSL_OpenSSL:testsuite'
include ':Crypto:testsuite'
include ':NetSSL_OpenSSL:testsuite'
if (os.windows) {
include ':NetSSL_Win:testsuite'
}
include ':Data:testsuite'
include ':Data:ODBC:testsuite'
include ':Data:SQLite:testsuite'
//include ':Data:MySQL:testsuite'
//include ':Data:SQLite:testsuite'
include ':Data:MySQL:testsuite'
include ':MongoDB:testsuite'
include ':Redis:testsuite'
include ':CppParser:testsuite'
@ -51,8 +50,8 @@ include ':Zip:testsuite'
include ':Encodings:samples'
include ':Foundation:samples'
include ':Data:samples'
//include ':NetSSL_OpenSSL:samples'
//include ':Data:samples'
include ':NetSSL_OpenSSL:samples'
if (os.windows) {
include ':NetSSL_Win:samples'
}