On Mon, Mar 6, 2017 at 9:56 AM Anthony Baker <aba...@pivotal.io> wrote:
GEODE-1416 lays out the tasks needed to prepare geode-native to be included in a geode release. I spent some time reviewing the source and found several other things to consider: 3) Build The cmake build can produce source and binary distributions though it’s not very obvious how to do so. Here’s how to create the binary distribution: cmake ../src -DPRODUCT_VERSION=1.2.0-SNAPSHOT cmake --build . cmake --build . —target docs cmake --build . --target package -rw-r--r-- 1 abaker staff 25355797 Mar 6 08:48 apache-geode-native-1.2.0-SNAPSHOT-Linux-64bit.tar.gz -rw-r--r-- 1 abaker staff 27074260 Mar 6 08:54 apache-geode-native-1.2.0-SNAPSHOT-Linux-64bit.zip $ cmake --build . Invokes built-in target `all`. I would update this to be a little faster... $ cmake ../src -DPRODUCT_VERSION=1.2.0-SNAPSHOT $ make all docs -j<number of cores> $ make package -j<number of cores> ( cmake --build is just an wrapper around the generator's build executable, on Linux this will likely be make, but is limited to a single target.) $ cmake ../src -DPRODUCT_VERSION=1.2.0-SNAPSHOT $ cmake --build --target all -- -j<number of cores> $ cmake --build --target docs -- -j<number of cores> $ cmake --build --target package -- -j<number of cores> An open ticket exists with CMake project to allow targets to be dependencies on built-in targets so that in the future package will be dependent on all and docs. One could create a custom target, `do-package`, that depends on all, docs and package if having a single target is necessary. Here’s how to create the source distribution: cpack --config CPackSourceConfig.cmake Comments: - The distributions don’t include the version in the top-level directory. We should include that. I believe you are looking for `make package_source`. No care has been taken yet for a src target. Some CMakeList.txt work needs to be tackled. The first thing is that the root CMakeLists.txt needs to be moved to the root of the repo. In fact the whole src directory is probably ready to be moved to the root. It was under a sub directory for migration purposes only. - The binary distributions include cmake files and several *.in files. Are those necessary? Depends. There are some necessary for the quickstarts and plug-in examples. - The source distribution only includes files from src/. It should capture everything in the geode-native/ root dir. - It looks like src/cppcache/src/version.cmake.in relies on the presence of a git repo. That will not be present for a source release, see [1]. This should be easy to change to fallback to something if .git is not found. It currently pulls the revisions SHA out of the repo. Personally I think that is silly and we should just remove it altogether. The other option is that a src distribution would just ship version.h and not cmake bits to determine it. We also need to generate signatures and hashes for each of the distribution artifacts. How hard is that to do in cmake? Should we just create a simple gradle wrapper script to do this so we have a common release toolset across geode, geode-examples, and geode-native? I really dislike having yet another build tool. CMake 3.7.2 and newer supports hashing directly in CPack. Older versions of CMake support hashing directly in the FILE command. Signatures are easy enough to achieve with a custom target call to openssl or pgp. -Jake