-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GEODE-4343: Add auto-serialization example for .net #227
Conversation
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
cmake_minimum_required(VERSION 3.8.2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3.10 is required to do CSharp.
|
||
project(AuthInitialize CSharp) | ||
|
||
message(STATUS "Assembly is ${GEODE_ASSEMBLY}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug messages?
|
||
add_executable(${PROJECT_NAME} | ||
Program.cs | ||
ExampleAuthInitialize.cs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting
message(STATUS "project binary dir: ${PROJECT_BINARY_DIR}") | ||
|
||
message(STATUS "current source dir is ${CMAKE_CURRENT_SOURCE_DIR}") | ||
message(STATUS "Attempting to link to ${CMAKE_CURRENT_SOURCE_DIR}/../../../build/clicache/src/Debug/Apache.Geode.dll") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded build directory!
Program.cs | ||
ExampleAuthInitialize.cs) | ||
|
||
message(STATUS "output dir is ${RUNTIME_OUTPUT_DIRECTORY}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The checked in .csproj files should be deleted now that a CMake file has been added.
{ | ||
if (-not (Test-Path env:GEODE_HOME)) | ||
{ | ||
echo "Could not find gfsh. Please set the GEODE_HOME path. e.g. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why write powershell script and use cmd echo?
examples/dotnet/CMakeLists.txt
Outdated
@@ -16,4 +16,6 @@ cmake_minimum_required(VERSION 3.4) | |||
|
|||
project(Apache.Geode.Examples) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs language NONE
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
cmake_minimum_required(VERSION 3.8.2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSharp requires 3.10.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, below all the same comments that the other CMake file has.
return "Order: [" + OrderId + ", " + Name + ", " + Quantity + "]"; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should end with a blank line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What the heck??? I definitely added these, looks like VS or maybe Git "helped" me by taking the newline back out. Will try again.
cache.Close(); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should end with a blank line.
{ | ||
if (-not (Test-Path env:GEODE_HOME)) | ||
{ | ||
echo "Could not find gfsh. Please set the GEODE_HOME path. e.g. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issues as with the other powershell script.
|
||
Console.WriteLine("Storing id and username in the region"); | ||
|
||
const string rtimmonsKey = "rtimmons"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, why not using var
since the type is deduced by the rhs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using const string prevents the variable from being modified once initialized.
So this won't compile:
const string foo = "foo"
foo = "bar"
but this will:
var foo = "foo"
foo = "bar"
Using 'const string' is mostly an indication of intent (rtimmonsKey should not be modified after initialization), but also protects against accidentally reassigning it at some point (unlikely).
|
||
message(STATUS "Assembly is ${GEODE_ASSEMBLY}") | ||
|
||
if ("${GEODE_ASSEMBLY}" STREQUAL "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be using the find_package
to find this and not force the user to specify it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The find_package call in Findgeode-native.cmake is broken and we made the decision to just require the location explicitly rather than rathole on fixing the script for this story.
|
||
project(AuthInitialize CSharp) | ||
|
||
if ("${GEODE_ASSEMBLY}" STREQUAL "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use find_package
.
{ | ||
if (-not (Test-Path env:GEODE_HOME)) | ||
{ | ||
write-output "Could not find gfsh. Please set the GEODE_HOME path. e.g. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write-Output
to be consistent with PS formatting. May want to consider Write-Host
.
|
||
Console.WriteLine("Storing id and username in the region"); | ||
|
||
const string rtimmonsKey = "rtimmons"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, why not using var
since the type is deduced by the rhs?
@austxcodemonkey Please rebase and force push. |
Signed-off-by: Ivan Godwin <igodwin@pivotal.io> Signed-off-by: Ryan McMahon <rmcmahon@pivotal.io>
e8018a1
to
1c29165
Compare
examples/cmake/FindGeodeNative.cmake
Outdated
if(NOT TARGET ${GEODE_NATIVE_CPP_TARGET}) | ||
set(GEODE_NATIVE_CPP_TARGET "apache.geode::cpp") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep consistent naming. Maybe we should change this from apache.geode::cpp
to ApacheGeode::cpp
to match find_package(ApacheGeode COMPONENT cpp)
.
examples/cmake/FindGeodeNative.cmake
Outdated
INTERFACE_INCLUDE_DIRECTORIES "${GEODE_NATIVE_CPP_INCLUDE_DIR}") | ||
endif() | ||
if(NOT TARGET ${GEODE_NATIVE_DOTNET_TARGET}) | ||
set(GEODE_NATIVE_DOTNET_TARGET "apache.geode::dotnet") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here for naming.
examples/cmake/FindGeodeNative.cmake
Outdated
@@ -31,15 +31,14 @@ | |||
# | |||
# This module will set the following variables in your project: | |||
# | |||
# ``GEODE_NATIVE_INCLUDE_DIRS`` | |||
# ``GEODE_NATIVE_CPP_INCLUDE_DIRS`` | |||
# where to find CacheFactory.hpp, etc. | |||
# ``GEODE_NATIVE_LIBRARIES`` | |||
# the libraries to link against to use Geode Native. | |||
# ``GEODE_NATIVE_FOUND`` | |||
# true if the Geode Native headers and libraries were found. | |||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to verify there names are still valid and update the docs to include the dotnet component.
* Normalize naming convention in find module.
* Normalize naming convention in find module.
* Normalize naming convention in find module.
Signed-off-by: Ivan Godwin igodwin@pivotal.io
Signed-off-by: Ryan McMahon rmcmahon@pivotal.io