You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bb...@apache.org on 2020/01/08 17:01:46 UTC

[geode-native] branch develop updated: GEODE-7646: Fix CI failure to build examples on Windows (#570)

This is an automated email from the ASF dual-hosted git repository.

bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
     new 07db3d8  GEODE-7646: Fix CI failure to build examples on Windows (#570)
07db3d8 is described below

commit 07db3d8104ba38eb1c8655f0daa74055169baa23
Author: Michael Martell <mm...@pivotal.io>
AuthorDate: Wed Jan 8 09:01:39 2020 -0800

    GEODE-7646: Fix CI failure to build examples on Windows (#570)
    
    * Fix CI failure building examples on Windows
    * Fix dotnet/sslputget example
---
 examples/cpp/sslputget/CMakeLists.txt.in    | 20 +++++++---
 examples/dotnet/sslputget/CMakeLists.txt.in |  2 +-
 examples/dotnet/sslputget/Program.cs        | 60 ++++++++++++++---------------
 examples/dotnet/sslputget/startserver.ps1   |  2 +-
 4 files changed, 47 insertions(+), 37 deletions(-)

diff --git a/examples/cpp/sslputget/CMakeLists.txt.in b/examples/cpp/sslputget/CMakeLists.txt.in
index 874e533..5f346af 100644
--- a/examples/cpp/sslputget/CMakeLists.txt.in
+++ b/examples/cpp/sslputget/CMakeLists.txt.in
@@ -54,16 +54,26 @@ if ("Linux" STREQUAL ${CMAKE_SYSTEM_NAME} )
     LINK_WHAT_YOU_USE TRUE)
 endif()
   
-target_link_libraries(${PROJECT_NAME}
-  PUBLIC
-    @PRODUCT_NAME_NOSPACE@::cpp
-    @PRODUCT_NAME_NOSPACE@::crypto
-)
+if (NOT WIN32)
+  target_link_libraries(${PROJECT_NAME}
+    PUBLIC
+      @PRODUCT_NAME_NOSPACE@::cpp
+      @PRODUCT_NAME_NOSPACE@::crypto
+  )
+else()
+  target_link_libraries(${PROJECT_NAME}
+    PUBLIC
+      @PRODUCT_NAME_NOSPACE@::cpp
+  )
+endif()
 
 if(WIN32)
   add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
     COMMAND ${CMAKE_COMMAND} -E copy
       $<SH...@.dll>
       $<SHELL_PATH:$<TARGET_FILE_DIR:${PROJECT_NAME}>>
+    COMMAND ${CMAKE_COMMAND} -E copy
+      $<SHELL_PATH:$<TARGET_FILE_DIR:@PRODUCT_NAME_NOSPACE@::crypto>/../bin/cryptoImpl.dll>
+      $<SHELL_PATH:$<TARGET_FILE_DIR:${PROJECT_NAME}>>
   )
 endif()
diff --git a/examples/dotnet/sslputget/CMakeLists.txt.in b/examples/dotnet/sslputget/CMakeLists.txt.in
index 4142fb7..021b2f1 100644
--- a/examples/dotnet/sslputget/CMakeLists.txt.in
+++ b/examples/dotnet/sslputget/CMakeLists.txt.in
@@ -43,6 +43,6 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
 
 add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E copy
-    $<SHELL_PATH:$<TARGET_FILE:GeodeNative::crypto>>
+    $<SHELL_PATH:$<TARGET_FILE:@PRODUCT_NAME_NOSPACE@::crypto>>
     $<SHELL_PATH:$<TARGET_FILE_DIR:${PROJECT_NAME}>>
 )
diff --git a/examples/dotnet/sslputget/Program.cs b/examples/dotnet/sslputget/Program.cs
index 1f0af75..d73eb9c 100644
--- a/examples/dotnet/sslputget/Program.cs
+++ b/examples/dotnet/sslputget/Program.cs
@@ -22,45 +22,45 @@ using Apache.Geode.Client;
 
 namespace Apache.Geode.Examples.FunctionExecution
 {
-  class Program
-  {
-    static void Main(string[] args)
+    class Program
     {
-      var cacheFactory = new CacheFactory();
-      cacheFactory.Set("log-level", "none");
-      cacheFactory.Set("ssl-enabled", "true");
-      cacheFactory.Set("ssl-keystore", Environment.CurrentDirectory + @"\..\ClientSslKeys\client_keystore.password.pem");
-      cacheFactory.Set("ssl-keystore-password", "gemstone");
-      cacheFactory.Set("ssl-truststore", Environment.CurrentDirectory + @"\..\ClientSslKeys\client_truststore.pem");
+        static void Main(string[] args)
+        {
+            var cacheFactory = new CacheFactory();
+            cacheFactory.Set("log-level", "none");
+            cacheFactory.Set("ssl-enabled", "true");
+            cacheFactory.Set("ssl-keystore", Environment.CurrentDirectory + @"\.\ClientSslKeys\client_keystore.pem");
+            cacheFactory.Set("ssl-keystore-password", "apachegeode");
+            cacheFactory.Set("ssl-truststore", Environment.CurrentDirectory + @"\.\ClientSslKeys\client_truststore.pem");
 
-      var cache = cacheFactory.Create();
+            var cache = cacheFactory.Create();
 
-      var poolFactory = cache.GetPoolFactory()
-          .AddLocator("localhost", 10334);
-      var pool = poolFactory.Create("pool");
+            var poolFactory = cache.GetPoolFactory()
+                .AddLocator("localhost", 10334);
+            var pool = poolFactory.Create("pool");
 
-      var regionFactory = cache.CreateRegionFactory(RegionShortcut.PROXY)
-          .SetPoolName("pool");
-      var region = regionFactory.Create<object, object>("testSSLRegion");
+            var regionFactory = cache.CreateRegionFactory(RegionShortcut.PROXY)
+                .SetPoolName("pool");
+            var region = regionFactory.Create<object, object>("testSSLRegion");
 
-      Console.WriteLine("Storing id and username in the region");
+            Console.WriteLine("Storing id and username in the region");
 
-      string rtimmonsKey = "rtimmons";
-      string rtimmonsValue = "Robert Timmons";
-      string scharlesKey = "scharles";
-      string scharlesValue = "Sylvia Charles";
+            string rtimmonsKey = "rtimmons";
+            string rtimmonsValue = "Robert Timmons";
+            string scharlesKey = "scharles";
+            string scharlesValue = "Sylvia Charles";
 
-      region.Put(rtimmonsKey, rtimmonsValue, null);
-      region.Put(scharlesKey, scharlesValue, null);
+            region.Put(rtimmonsKey, rtimmonsValue, null);
+            region.Put(scharlesKey, scharlesValue, null);
 
-      Console.WriteLine("Getting the user info from the region");
-      var user1 = region.Get(rtimmonsKey, null);
-      var user2 = region.Get(scharlesKey, null);
+            Console.WriteLine("Getting the user info from the region");
+            var user1 = region.Get(rtimmonsKey, null);
+            var user2 = region.Get(scharlesKey, null);
 
-      Console.WriteLine(rtimmonsKey + " = " + user1);
-      Console.WriteLine(scharlesKey + " = " + user2);
+            Console.WriteLine(rtimmonsKey + " = " + user1);
+            Console.WriteLine(scharlesKey + " = " + user2);
 
-      cache.Close();
+            cache.Close();
+        }
     }
-  }
 }
diff --git a/examples/dotnet/sslputget/startserver.ps1 b/examples/dotnet/sslputget/startserver.ps1
index d0a649e..5555d29 100644
--- a/examples/dotnet/sslputget/startserver.ps1
+++ b/examples/dotnet/sslputget/startserver.ps1
@@ -35,5 +35,5 @@ else
 
 if ($GFSH_PATH -ne "")
 {
-   Invoke-Expression "$GFSH_PATH -e 'start locator --name=locator --dir=$PSScriptRoot/locator --connect=false --J=-Dgemfire.ssl-enabled-components=all --J=-Dgemfire.ssl-keystore=$PSScriptRoot\ServerSslKeys\server_keystore.jks --J=-Dgemfire.ssl-truststore=$PSScriptRoot\ServerSslKeys\server_truststore.jks  --J=-Dgemfire.ssl-keystore-password=gemstone --J=-Dgemfire.ssl-truststore-password=gemstone' -e 'connect --use-ssl=true --key-store=$PSScriptRoot\ServerSslKeys\server_keystore.jks --trus [...]
+   Invoke-Expression "$GFSH_PATH -e 'start locator --name=locator --dir=$PSScriptRoot/locator --connect=false --J=-Dgemfire.ssl-enabled-components=all --J=-Dgemfire.ssl-keystore=$PSScriptRoot\ServerSslKeys\server_keystore.p12 --J=-Dgemfire.ssl-truststore=$PSScriptRoot\ServerSslKeys\server_truststore.jks  --J=-Dgemfire.ssl-keystore-password=apachegeode --J=-Dgemfire.ssl-truststore-password=apachegeode' -e 'connect --use-ssl=true --key-store=$PSScriptRoot\ServerSslKeys\server_keystore.p12  [...]
 }