diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 303029d7d0620b6dd020670deb5aa6c69baacafe..2370f80dc8595d6828bb661edc6c4bc14322daf5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -159,7 +159,11 @@ trigger_inttest: ## Determine the juliainttest branch... # ... use an f-branch if posible... - if echo "$CI_COMMIT_REF_NAME" | grep -c "^f-" ; then - JULIAINT_REF=$CI_COMMIT_REF_NAME ; + if curl -o /dev/null -s -w "%{http_code}" $JULIAINTTEST_BRANCHES/$CI_COMMIT_REF_NAME | grep "404"; then + JULIAINT_REF=dev ; + else + JULIAINT_REF=$CI_COMMIT_REF_NAME; + fi fi; # ... or use main if possible... - if [[ "$CI_COMMIT_REF_NAME" == "main" ]] ; then diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bbc22bba66dfe6cf699b689e3342f91f0101858..485e806bd957d5cc8b8a314c3661e707c5ca6378 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Basic functionality to establish connection to a CaosDB server and retrieve its version (using the Extern C interface of caosdb-cpplib) +* Support for Windows ### Changed diff --git a/src/CaosDB.jl b/src/CaosDB.jl index 4f5987b55366a93f2d661ed8ddc6061610eb8b9d..f8bf67eb4593ee58e0bc8d49dfcd776ae6b616ed 100644 --- a/src/CaosDB.jl +++ b/src/CaosDB.jl @@ -23,6 +23,11 @@ module CaosDB +""" +Chose the name of the library according to the OS you're running. +""" +library_name = (@static Sys.iswindows() ? "ccaosdb" : "libccaosdb") + module Info """ @@ -49,6 +54,8 @@ module Utility export get_env_var +using ..CaosDB + """ get_env_var(var[, default]) @@ -59,7 +66,7 @@ instead. function get_env_var(var::AbstractString, default::AbstractString = "") ret = ccall( - (:caosdb_utility_get_env_var, "libccaosdb"), + (:caosdb_utility_get_env_var, CaosDB.library_name), Cstring, (Cstring, Cstring), var, @@ -74,6 +81,8 @@ end # Utility module Authentication +using ..CaosDB + """ Struct containing a pointer to the wrapped cpp authenticator class. Meant for internal use; call a @@ -91,7 +100,7 @@ mutable struct _Authenticator if t.wrapped_authenticator != C_NULL # Only if pointer was filled after real initialization ccall( - (:caosdb_authentication_delete_authenticator, "libccaosdb"), + (:caosdb_authentication_delete_authenticator, CaosDB.library_name), Cint, (Ref{_Authenticator},), Ref{_Authenticator}(t), @@ -120,7 +129,7 @@ function create_plain_password_authenticator( auth = Ref{_Authenticator}(_Authenticator()) err_code = ccall( - (:caosdb_authentication_create_plain_password_authenticator, "libccaosdb"), + (:caosdb_authentication_create_plain_password_authenticator, CaosDB.library_name), Cint, (Ref{_Authenticator}, Cstring, Cstring), auth, @@ -160,7 +169,7 @@ mutable struct _Connection function f(t) if t.wrapped_connection != C_NULL ccall( - (:caosdb_connection_delete_connection, "libccaosdb"), + (:caosdb_connection_delete_connection, CaosDB.library_name), Cint, (Ref{_Connection},), Ref{_Connection}(t), @@ -186,7 +195,7 @@ mutable struct _CertificateProvider function f(t) if t.wrapped_certificate_provider != C_NULL ccall( - (:caosdb_connection_delete_certificate_provider, "libccaosdb"), + (:caosdb_connection_delete_certificate_provider, CaosDB.library_name), Cint, (Ref{_CertificateProvider},), Ref{_CertificateProvider}(t), @@ -212,7 +221,10 @@ mutable struct _Configuration function f(t) if t.wrapped_connection_configuration != C_NULL ccall( - (:caosdb_connection_delete_connection_configuration, "libccaosdb"), + ( + :caosdb_connection_delete_connection_configuration, + CaosDB.library_name, + ), Cint, (Ref{_Configuration},), Ref{_Configuration}(t), @@ -234,7 +246,7 @@ function create_pem_file_certificate_provider(path::AbstractString) cert_provider = Ref{_CertificateProvider}(_CertificateProvider()) err_code = ccall( - (:caosdb_connection_create_pem_file_certificate_provider, "libccaosdb"), + (:caosdb_connection_create_pem_file_certificate_provider, CaosDB.library_name), Cint, (Ref{_CertificateProvider}, Cstring), cert_provider, @@ -271,7 +283,7 @@ function create_tls_connection_configuration( config = Ref{_Configuration}(_Configuration()) err_code = ccall( - (:caosdb_connection_create_tls_connection_configuration, "libccaosdb"), + (:caosdb_connection_create_tls_connection_configuration, CaosDB.library_name), Cint, ( Ref{_Configuration}, @@ -302,7 +314,7 @@ function create_insecure_connection_configuration(host::AbstractString, port::Ci config = Ref{_Configuration}(_Configuration()) err_code = ccall( - (:caosdb_connection_create_insecure_connection_configuration, "libccaosdb"), + (:caosdb_connection_create_insecure_connection_configuration, CaosDB.library_name), Cint, (Ref{_Configuration}, Cstring, Cint), config, @@ -329,7 +341,7 @@ function create_connection(config::Ref{_Configuration}) connection = Ref{_Connection}(_Connection()) err_code = ccall( - (:caosdb_connection_create_connection, "libccaosdb"), + (:caosdb_connection_create_connection, CaosDB.library_name), Cint, (Ref{_Connection}, Ref{_Configuration}), connection, @@ -357,7 +369,7 @@ function get_version_info(con::Ref{_Connection}) info = Ref{CaosDB.Info._VersionInfo}(CaosDB.Info._VersionInfo()) err_code = ccall( - (:caosdb_connection_get_version_info, "libccaosdb"), + (:caosdb_connection_get_version_info, CaosDB.library_name), Cint, (Ref{CaosDB.Info._VersionInfo}, Ref{_Connection}), info,