Update gradle

This commit is contained in:
zosrothko 2018-05-11 17:03:06 +02:00
parent e703457a41
commit 6ba292a567
4 changed files with 225 additions and 84 deletions

View File

@ -5,62 +5,104 @@ model {
binaries.withType(StaticLibraryBinary) {
def libName = "foobar"
if (buildType == buildTypes.debug) {
libName = 'libintl.lib'
if (targetPlatform.name == 'win32') {
libName = 'libintl.lib'
headers.srcDir "$postgres32Home/include"
staticLibraryFile = file("$postgres32Home/lib/$libName")
staticLibraryFile = new File("$postgres32Home/lib/$libName")
} else
if (targetPlatform.name == 'win64') {
libName = 'libintl.lib'
headers.srcDir "$postgres64Home/include"
staticLibraryFile = file("$postgres64Home/lib/$libName")
staticLibraryFile = new File("$postgres64Home/lib/$libName")
} else
if (targetPlatform.operatingSystem.macOsX) {
libName = 'libintl.lib'
//staticLibraryFile = new File("$postgres32OSXHome/lib/$libName")
} else
if (targetPlatform.operatingSystem.linux) {
libName = 'libintl.a'
staticLibraryFile = new File("$postgres32LinuxLib/$libName")
}
} else
if (buildType == buildTypes.release) {
libName = 'libintl.lib'
if (targetPlatform.name == 'win32') {
libName = 'libintl.lib'
headers.srcDir "$postgres32Home/include"
staticLibraryFile = file("$postgres32Home/lib/$libName")
staticLibraryFile = new File("$postgres32Home/lib/$libName")
} else
if (targetPlatform.name == 'win64') {
libName = 'libintl.lib'
headers.srcDir "$postgres64Home/include"
staticLibraryFile = file("$postgres64Home/lib/$libName")
staticLibraryFile = new File("$postgres64Home/lib/$libName")
} else
if (targetPlatform.operatingSystem.macOsX) {
libName = 'libintl.a'
staticLibraryFile = new File("$postgres32LinuxLib/$libName")
} else
if (targetPlatform.operatingSystem.linux) {
libName = 'libintl.a'
staticLibraryFile = new File("$postgres32LinuxLib/$libName")
}
} else {
throw new GradleException("Unknown buildType" + buildType)
}
}
binaries.withType(SharedLibraryBinary) {
def dllName
def linkName
if (buildType == buildTypes.debug) {
dllName = 'libintl-8.dll'
linkName = 'libintl.lib'
if (targetPlatform.name == 'win32') {
dllName = 'libintl-8.dll'
linkName = 'libintl.lib'
headers.srcDir "$postgres32Home/include"
sharedLibraryFile = file("$postgres32Home/bin/$dllName")
sharedLibraryLinkFile = file("$postgres32Home/lib/$linkName")
sharedLibraryFile = new File("$postgres32Home/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName")
} else
if (targetPlatform.name == 'win64') {
dllName = 'libintl-8.dll'
linkName = 'libintl.lib'
headers.srcDir "$postgres64Home/include"
sharedLibraryFile = file("$postgres64Home/bin/$dllName")
sharedLibraryLinkFile = file("$postgres64Home/lib/$linkName")
sharedLibraryFile = new File("$postgres64Home/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName")
} else
if (targetPlatform.operatingSystem.macOsX) {
dllName = 'libintl-8.dll'
linkName = 'libintl.lib'
//staticLibraryFile = new File("$postgres32OSXHome/lib/$libName")
} else
if (targetPlatform.operatingSystem.linux) {
dllName = 'libintl-8.so'
linkName = 'libintl.a'
headers.srcDir "$postgres32LinuxInc"
sharedLibraryFile = new File("$postgres32LinuxLib/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres32LinuxLib/lib/$linkName")
}
} else
if (buildType == buildTypes.release) {
dllName = 'libintl-8.dll'
linkName = 'libintl.lib'
if (targetPlatform.name == 'win32') {
dllName = 'libintl-8.dll'
linkName = 'libintl.lib'
headers.srcDir "$postgres32Home/include"
sharedLibraryFile = file("$postgres32Home/bin/$dllName")
sharedLibraryLinkFile = file("$postgres32Home/lib/$linkName")
sharedLibraryFile = new File("$postgres32Home/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName")
} else
if (targetPlatform.name == 'win64') {
dllName = 'libintl-8.dll'
linkName = 'libintl.lib'
headers.srcDir "$postgres64Home/include"
sharedLibraryFile = file("$postgres64Home/bin/$dllName")
sharedLibraryLinkFile = file("$postgres64Home/lib/$linkName")
sharedLibraryFile = new File("$postgres64Home/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName")
} else
if (targetPlatform.operatingSystem.macOsX) {
dllName = 'libintl-8.so'
linkName = 'libintl.a'
sharedLibraryFile = new File("$postgres32LinuxLib/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres32LinuxLib/lib/$linkName")
} else
if (targetPlatform.operatingSystem.linux) {
dllName = 'libintl-8.so'
linkName = 'libintl.a'
sharedLibraryFile = new File("$postgres32LinuxLib/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres32LinuxLib/lib/$linkName")
}
} else {
throw new GradleException("Unknown buildType" + buildType)
}
}
}
@ -68,62 +110,100 @@ model {
binaries.withType(StaticLibraryBinary) {
def libName = "foobar"
if (buildType == buildTypes.debug) {
libName = 'iconv.lib'
if (targetPlatform.name == 'win32') {
libName = 'iconv.lib'
headers.srcDir "$postgres32Home/include"
staticLibraryFile = file("$postgres32Home/lib/$libName")
staticLibraryFile = new File("$postgres32Home/lib/$libName")
} else
if (targetPlatform.name == 'win64') {
libName = 'iconv.lib'
headers.srcDir "$postgres64Home/include"
staticLibraryFile = file("$postgres64Home/lib/$libName")
staticLibraryFile = new File("$postgres64Home/lib/$libName")
} else
if (targetPlatform.operatingSystem.macOsX) {
libName = 'iconv.a'
//staticLibraryFile = new File("$postgres32OSXHome/lib/$libName")
} else
if (targetPlatform.operatingSystem.linux) {
libName = 'iconv.a'
staticLibraryFile = new File("$postgres32LinuxLib/$libName")
}
} else
if (buildType == buildTypes.release) {
libName = 'iconv.lib'
if (targetPlatform.name == 'win32') {
headers.srcDir "$postgres32Home/include"
staticLibraryFile = file("$postgres32Home/lib/$libName")
staticLibraryFile = new File("$postgres32Home/lib/$libName")
} else
if (targetPlatform.name == 'win64') {
headers.srcDir "$postgres64Home/include"
staticLibraryFile = file("$postgres64Home/lib/$libName")
staticLibraryFile = new File("$postgres64Home/lib/$libName")
} else
if (targetPlatform.operatingSystem.macOsX) {
//staticLibraryFile = new File("$postgres32OSXHome/lib/$libName")
} else
if (targetPlatform.operatingSystem.linux) {
libName = 'iconv.a'
staticLibraryFile = new File("$postgres32LinuxLib/$libName")
}
} else {
throw new GradleException("Unknown buildType" + buildType)
}
}
binaries.withType(SharedLibraryBinary) {
def dllName
def linkName
if (buildType == buildTypes.debug) {
dllName = 'libiconv-2.dll'
linkName = 'iconv.lib'
if (targetPlatform.name == 'win32') {
dllName = 'libiconv-2.dll'
linkName = 'iconv.lib'
headers.srcDir "$postgres32Home/include"
sharedLibraryFile = file("$postgres32Home/bin/$dllName")
sharedLibraryLinkFile = file("$postgres32Home/lib/$linkName")
sharedLibraryFile = new File("$postgres32Home/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName")
} else
if (targetPlatform.name == 'win64') {
dllName = 'libiconv-2.dll'
linkName = 'iconv.lib'
headers.srcDir "$postgres64Home/include"
sharedLibraryFile = file("$postgres64Home/bin/$dllName")
sharedLibraryLinkFile = file("$postgres64Home/lib/$linkName")
sharedLibraryFile = new File("$postgres64Home/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName")
} else
if (targetPlatform.operatingSystem.macOsX) {
dllName = 'libiconv-2.so'
linkName = 'iconv.a'
//staticLibraryFile = new File("$postgres32OSXHome/lib/$libName")
} else
if (targetPlatform.operatingSystem.linux) {
dllName = 'libiconv-2.so'
linkName = 'iconv.a'
sharedLibraryFile = new File("$postgres32LinuxLib/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres32LinuxLib/lib/$linkName")
}
} else
if (buildType == buildTypes.release) {
dllName = 'libiconv-2.dll'
linkName = 'iconv.lib'
if (targetPlatform.name == 'win32') {
dllName = 'libiconv-2.dll'
linkName = 'iconv.lib'
headers.srcDir "$postgres32Home/include"
sharedLibraryFile = file("$postgres32Home/bin/$dllName")
sharedLibraryLinkFile = file("$postgres32Home/lib/$linkName")
sharedLibraryFile = new File("$postgres32Home/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName")
} else
if (targetPlatform.name == 'win64') {
dllName = 'libiconv-2.dll'
linkName = 'iconv.lib'
headers.srcDir "$postgres64Home/include"
sharedLibraryFile = file("$postgres64Home/bin/$dllName")
sharedLibraryLinkFile = file("$postgres64Home/lib/$linkName")
sharedLibraryFile = new File("$postgres64Home/bin/$dllName")
sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName")
} else
if (targetPlatform.operatingSystem.macOsX) {
dllName = 'libiconv-2.so'
linkName = 'iconv.a'
//staticLibraryFile = new File("$postgres32OSXHome/lib/$libName")
} else
if (targetPlatform.operatingSystem.linux) {
dllName = 'libiconv-2.so'
linkName = 'iconv.a'
sharedLibraryFile = new File("$postgres32LinuxLib/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres32LinuxLib/lib/$linkName")
}
} else {
throw new GradleException("Unknown buildType" + buildType)
}
}
}
@ -134,42 +214,72 @@ model {
libName = 'libpq.lib'
if (targetPlatform.name == 'win32') {
headers.srcDir "$postgres32Home/include"
staticLibraryFile = file("$postgres32Home/lib/$libName")
staticLibraryFile = new File("$postgres32Home/lib/$libName")
} else
if (targetPlatform.name == 'win64') {
headers.srcDir "$postgres64Home/include"
staticLibraryFile = file("$postgres64Home/lib/$libName")
staticLibraryFile = new File("$postgres64Home/lib/$libName")
} else
if (targetPlatform.operatingSystem.macOsX) {
staticLibraryFile = new File("$postgres32OSXHome/lib/$libName")
} else
if (targetPlatform.operatingSystem.linux) {
libName = 'libpq.a'
headers.srcDir "$postgres32LinuxInc"
staticLibraryFile = new File("$postgres32LinuxLib/lib/$libName")
}
} else
if (buildType == buildTypes.release) {
libName = 'libpq.lib'
if (targetPlatform.name == 'win32') {
libName = 'libpq.lib'
headers.srcDir "$postgres32Home/include"
staticLibraryFile = file("$postgres32Home/lib/$libName")
staticLibraryFile = new File("$postgres32Home/lib/$libName")
} else
if (targetPlatform.name == 'win64') {
libName = 'libpq.lib'
headers.srcDir "$postgres64Home/include"
staticLibraryFile = file("$postgres64Home/lib/$libName")
staticLibraryFile = new File("$postgres64Home/lib/$libName")
} else
if (targetPlatform.operatingSystem.macOsX) {
staticLibraryFile = new File("$postgres32OSXHome/lib/$libName")
} else
if (targetPlatform.operatingSystem.linux) {
libName = 'libpq.a'
staticLibraryFile = new File("$postgres32LinuxLib/lib/$libName")
}
} else {
throw new GradleException("Unknown buildType" + buildType)
}
}
binaries.withType(SharedLibraryBinary) {
def dllName
def linkName
if (buildType == buildTypes.debug) {
dllName = 'libpq.dll'
linkName = 'libpq.lib'
if (targetPlatform.name == 'win32') {
dllName = 'libpq.dll'
linkName = 'libpq.lib'
headers.srcDir "$postgres32Home/include"
sharedLibraryFile = file("$postgres32Home/lib/$dllName")
sharedLibraryLinkFile = file("$postgres32Home/lib/$linkName")
sharedLibraryFile = new File("$postgres32Home/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName")
} else
if (targetPlatform.name == 'win64') {
dllName = 'libpq.dll'
linkName = 'libpq.lib'
headers.srcDir "$postgres64Home/include"
sharedLibraryFile = file("$postgres64Home/lib/$dllName")
sharedLibraryLinkFile = file("$postgres64Home/lib/$linkName")
sharedLibraryFile = new File("$postgres64Home/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName")
} else
if (targetPlatform.operatingSystem.macOsX) {
dllName = 'libpq.dll'
linkName = 'libpq.lib'
headers.srcDir "$postgres32Home/include"
sharedLibraryFile = new File("$postgres32Home/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName")
} else
if (targetPlatform.operatingSystem.linux) {
dllName = 'libpq.so'
linkName = 'libpq.a'
headers.srcDir "$postgres32LinuxInc"
sharedLibraryFile = new File("$postgres32LinuxLib/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres32LinuxLib/lib/$linkName")
}
} else
if (buildType == buildTypes.release) {
@ -177,16 +287,28 @@ model {
linkName = 'libpq.lib'
if (targetPlatform.name == 'win32') {
headers.srcDir "$postgres32Home/include"
sharedLibraryFile = file("$postgres32Home/lib/$dllName")
sharedLibraryLinkFile = file("$postgres32Home/lib/$linkName")
sharedLibraryFile = new File("$postgres32Home/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres32Home/lib/$linkName")
} else
if (targetPlatform.name == 'win64') {
headers.srcDir "$postgres64Home/include"
sharedLibraryFile = file("$postgres64Home/lib/$dllName")
sharedLibraryLinkFile = file("$postgres64Home/lib/$linkName")
sharedLibraryFile = new File("$postgres64Home/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres64Home/lib/$linkName")
} else
if (targetPlatform.operatingSystem.macOsX) {
dllName = 'libpq.so'
linkName = 'libpq.a'
headers.srcDir "$postgres32LinuxInc"
sharedLibraryFile = new File("$postgres32LinuxLib/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres32LinuxLib/lib/$linkName")
} else
if (targetPlatform.operatingSystem.linux) {
dllName = 'libpq.so'
linkName = 'libpq.a'
headers.srcDir "$postgres32LinuxInc"
sharedLibraryFile = new File("$postgres32LinuxLib/lib/$dllName")
sharedLibraryLinkFile = new File("$postgres32LinuxLib/lib/$linkName")
}
} else {
throw new GradleException("Unknown buildType" + buildType)
}
}
}
@ -209,7 +331,7 @@ model {
exportedHeaders {
srcDir 'include'
}
lib library: 'postgres'
// lib library: 'postgres'
lib project: ':Data', library: 'Data'
lib project: ':Foundation', library: 'Foundation'
}
@ -218,6 +340,11 @@ model {
}
binaries {
all {
if (toolChain in Gcc) {
cppCompiler.args ( "-I", "/usr/include/postgresql")
linker.args ( "-L", "/usr/lib/x86_64-linux-gnu/")
linker.args ( "-l", "pq")
}
}
withType(SharedLibraryBinarySpec) {
if (toolChain in VisualCpp) {

View File

@ -284,9 +284,9 @@ subprojects {
libName = 'libcryptod.a'
staticLibraryFile = new File("$openSSLBrewHome/lib/$libName")
} else if (targetPlatform.operatingSystem.linux) {
headers.srcDir "$openSSLLinuxInc/include"
headers.srcDir "$openSSL64LinuxInc/include"
libName = 'libcrypto.a'
staticLibraryFile = new File("$openSSLLinuxLib/$libName")
staticLibraryFile = new File("$openSSL64LinuxLib/$libName")
}
} else
if (buildType == buildTypes.release) {
@ -300,9 +300,9 @@ subprojects {
libName = 'libcrypto.a'
staticLibraryFile = new File("$openSSLBrewHome/lib/$libName")
} else if (targetPlatform.operatingSystem.linux) {
headers.srcDir "$openSSLLinuxInc/include"
headers.srcDir "$openSSL64LinuxInc/include"
libName = 'libcrypto.a'
staticLibraryFile = new File("$openSSLLinuxLib/$libName")
staticLibraryFile = new File("$openSSL64LinuxLib/$libName")
}
} else {
throw new GradleException("Unknown buildType" + buildType)
@ -328,11 +328,11 @@ subprojects {
sharedLibraryFile = new File("$openSSLBrewHome/lib/$dllName")
sharedLibraryLinkFile = new File("$openSSLBrewHome/lib/$linkName")
} else if (targetPlatform.operatingSystem.linux) {
headers.srcDir "$openSSLLinuxInc/include"
headers.srcDir "$openSSL64LinuxInc/include"
dllName = 'libcrypto.so'
linkName = 'libcrypto.a'
sharedLibraryFile = new File("$openSSLLinuxLib/$dllName")
sharedLibraryLinkFile = new File("$openSSLLinuxLib/$linkName")
sharedLibraryFile = new File("$openSSL64LinuxLib/$dllName")
sharedLibraryLinkFile = new File("$openSSL64LinuxLib/$linkName")
}
} else
if (buildType == buildTypes.release) {
@ -352,11 +352,11 @@ subprojects {
sharedLibraryFile = new File("$openSSLBrewHome/lib/$dllName")
sharedLibraryLinkFile = new File("$openSSLBrewHome/lib/$linkName")
} else if (targetPlatform.operatingSystem.linux) {
headers.srcDir "$openSSLLinuxInc/include"
headers.srcDir "$openSSL64LinuxInc/include"
dllName = 'libcrypto.so'
linkName = 'libcrypto.a'
sharedLibraryFile = new File("$openSSLLinuxLib/$dllName")
sharedLibraryLinkFile = new File("$openSSLLinuxLib/$linkName")
sharedLibraryFile = new File("$openSSL64LinuxLib/$dllName")
sharedLibraryLinkFile = new File("$openSSL64LinuxLib/$linkName")
}
} else {
throw new GradleException("Unknown buildType" + buildType)
@ -380,9 +380,9 @@ subprojects {
libName = 'libssld.a'
staticLibraryFile = new File("$openSSLBrewHome/lib/$libName")
} else if (targetPlatform.operatingSystem.linux) {
headers.srcDir "$openSSLLinuxInc/include"
headers.srcDir "$openSSL64LinuxInc/include"
libName = 'libssl.a'
staticLibraryFile = new File("$openSSLLinuxLib", "$libName")
staticLibraryFile = new File("$openSSL64LinuxLib", "$libName")
}
} else
if (buildType == buildTypes.release) {
@ -396,9 +396,9 @@ subprojects {
libName = 'libssl.a'
staticLibraryFile = new File("$openSSLBrewHome/lib/$libName")
} else if (targetPlatform.operatingSystem.linux) {
headers.srcDir "$openSSLLinuxInc/include"
headers.srcDir "$openSSL64LinuxInc/include"
libName = 'libssl.a'
staticLibraryFile = new File("$openSSLLinuxLib/$libName")
staticLibraryFile = new File("$openSSL64LinuxLib/$libName")
}
} else {
throw new GradleException("Unknown buildType" + buildType)
@ -424,12 +424,12 @@ subprojects {
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"
def File openSSL64LinuxLibFile = new File("$openSSL64LinuxLib")
headers.srcDir "$openSSL64LinuxInc/include"
dllName = "libssl.so"
linkName = "libssl.a"
sharedLibraryFile = new File(openSSLLinuxLibFile, dllName)
sharedLibraryLinkFile = new File(openSSLLinuxLibFile, linkName)
sharedLibraryFile = new File(openSSL64LinuxLibFile, dllName)
sharedLibraryLinkFile = new File(openSSL64LinuxLibFile, linkName)
}
} else if (buildType == buildTypes.release) {
if (targetPlatform.name == 'win32') {
@ -448,11 +448,11 @@ subprojects {
sharedLibraryFile = new File("$openSSLBrewHome/lib/$dllName")
sharedLibraryLinkFile = new File("$openSSLBrewHome/lib/$linkName")
} else if (targetPlatform.operatingSystem.linux) {
headers.srcDir "$openSSLLinuxInc/include"
headers.srcDir "$openSSL64LinuxInc/include"
dllName = 'libssl.so'
linkName = 'libssl.a'
sharedLibraryFile = new File("$openSSLLinuxLib/$dllName")
sharedLibraryLinkFile = new File("$openSSLLinuxLib/$linkName")
sharedLibraryFile = new File("$openSSL64LinuxLib/$dllName")
sharedLibraryLinkFile = new File("$openSSL64LinuxLib/$linkName")
}
} else {
throw new GradleException("Unknown buildType" + buildType)

View File

@ -60,11 +60,23 @@ mysql32LinuxInc = /usr/local
mysql64LinuxLib =
mysql64LinuxInc = /usr/local
postgres32LinuxLib =
postgres32LinuxInc = /usr/local
postgres64LinuxLib = /usr/lib/x86_64-linux-gnu/
postgres64LinuxInc = /usr/include/postgresql/
###############################################################################
# Mac OSX Customization
###############################################################################
openSSLBrewHome = /usr/local/opt/openssl
postgres32OSXHome =
postgres32OSXLib =
postgres32OSXInc = /usr/local
postgres64OSXLib = /usr/lib/x86_64-linux-gnu/
postgres64OSXInc = /usr/include/postgresql/
###############################################################################
# Common

View File

@ -17,6 +17,7 @@ include ':Data'
include ':Data:ODBC'
include ':Data:SQLite'
//include ':Data:MySQL'
include ':Data:PosgreSQL'
include ':Zip'
include ':PageCompiler'
include ':PageCompiler:File2Page'
@ -42,6 +43,7 @@ include ':Data:testsuite'
include ':Data:ODBC:testsuite'
include ':Data:SQLite:testsuite'
//include ':Data:MySQL:testsuite'
include ':Data:PostgreSQL:testsuite'
include ':MongoDB:testsuite'
include ':Redis:testsuite'
include ':CppParser:testsuite'