Skip to content

Commit

Permalink
Release preparation (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
eile authored Dec 2, 2016
1 parent 895ab49 commit 2da95ea
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 57 deletions.
65 changes: 14 additions & 51 deletions CMake/GitExternal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# update target to bump the tag to the master revision by
# recreating .gitexternals.
# * Provides function
# git_external(<directory> <giturl> <gittag> [VERBOSE,SHALLOW]
# git_external(<directory> <giturl> <gittag> [VERBOSE]
# [RESET <files>])
# which will check out directory in CMAKE_SOURCE_DIR (if relative)
# or in the given absolute path using the given repository and tag
Expand All @@ -18,11 +18,6 @@
# VERBOSE, when present, this option tells the function to output
# information about what operations are being performed by git on
# the repo.
# SHALLOW, when present, causes a shallow clone of depth 1 to be made
# of the specified repo. This may save considerable memory/bandwidth
# when only a specific branch of a repo is required and the full history
# is not required. Note that the SHALLOW option will only work for a branch
# or tag and cannot be used for an arbitrary SHA.
# OPTIONAL, when present, this option makes this operation optional.
# The function will output a warning and return if the repo could not be
# cloned.
Expand All @@ -33,7 +28,7 @@
# * rebase: Rebases all git externals, including sub projects
#
# Options (global) which control behaviour:
# GIT_EXTERNAL_VERBOSE
# COMMON_GIT_EXTERNAL_VERBOSE
# This is a global option which has the same effect as the VERBOSE option,
# with the difference that output information will be produced for all
# external repos when set.
Expand All @@ -56,28 +51,21 @@ if(NOT GIT_EXECUTABLE)
endif()

include(CMakeParseArguments)
option(GIT_EXTERNAL_VERBOSE "Print git commands as they are executed" OFF)
option(COMMON_GIT_EXTERNAL_VERBOSE "Print git commands as they are executed" OFF)

if(NOT GITHUB_USER AND DEFINED ENV{GITHUB_USER})
set(GITHUB_USER $ENV{GITHUB_USER} CACHE STRING
"Github user name used to setup remote for 'user' forks")
endif()

macro(GIT_EXTERNAL_MESSAGE msg)
if(GIT_EXTERNAL_VERBOSE OR GIT_EXTERNAL_LOCAL_VERBOSE)
if(COMMON_GIT_EXTERNAL_VERBOSE)
message(STATUS "${NAME}: ${msg}")
endif()
endmacro()

# utility function for printing a list with custom separator
function(JOIN VALUES GLUE OUTPUT)
string (REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}")
string (REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
endfunction()

function(GIT_EXTERNAL DIR REPO tag)
cmake_parse_arguments(GIT_EXTERNAL_LOCAL "VERBOSE;SHALLOW;OPTIONAL" "" "RESET" ${ARGN})
cmake_parse_arguments(GIT_EXTERNAL_LOCAL "VERBOSE;OPTIONAL" "" "RESET" ${ARGN})
set(TAG ${tag})
if(GIT_EXTERNAL_TAG AND "${tag}" MATCHES "^[0-9a-f]+$")
set(TAG ${GIT_EXTERNAL_TAG})
Expand Down Expand Up @@ -105,16 +93,9 @@ function(GIT_EXTERNAL DIR REPO tag)

if(NOT EXISTS "${DIR}")
# clone
set(_clone_options --recursive)
if(GIT_EXTERNAL_LOCAL_SHALLOW)
list(APPEND _clone_options --depth 1 --branch ${TAG})
else()
set(_msg_tag "[${TAG}]")
endif()
JOIN("${_clone_options}" " " _msg_text)
message(STATUS "git clone ${_msg_text} ${REPO} ${DIR} ${_msg_tag}")
message(STATUS "git clone --recursive ${REPO} ${DIR} [${TAG}]")
execute_process(
COMMAND "${GIT_EXECUTABLE}" clone ${_clone_options} ${REPO} ${DIR}
COMMAND "${GIT_EXECUTABLE}" clone --recursive ${REPO} ${DIR}
RESULT_VARIABLE nok ERROR_VARIABLE error
WORKING_DIRECTORY "${GIT_EXTERNAL_DIR}")
if(nok)
Expand All @@ -127,21 +108,8 @@ function(GIT_EXTERNAL DIR REPO tag)
endif()

# checkout requested tag
if(NOT GIT_EXTERNAL_LOCAL_SHALLOW)
execute_process(
COMMAND "${GIT_EXECUTABLE}" checkout -q "${TAG}"
RESULT_VARIABLE nok ERROR_VARIABLE error
WORKING_DIRECTORY "${DIR}")
if(nok)
message(FATAL_ERROR "git checkout ${TAG} in ${DIR} failed: ${error}\n")
endif()
endif()

# checkout requested tag
execute_process(
COMMAND "${GIT_EXECUTABLE}" checkout -q "${TAG}"
RESULT_VARIABLE nok ERROR_VARIABLE error
WORKING_DIRECTORY "${DIR}")
execute_process(COMMAND "${GIT_EXECUTABLE}" checkout -q "${TAG}"
RESULT_VARIABLE nok ERROR_VARIABLE error WORKING_DIRECTORY "${DIR}")
if(nok)
message(FATAL_ERROR "git checkout ${TAG} in ${DIR} failed: ${error}\n")
endif()
Expand Down Expand Up @@ -281,13 +249,10 @@ if(EXISTS ${GIT_EXTERNALS} AND NOT GIT_EXTERNAL_SCRIPT_MODE)
if(NOT TARGET update)
add_custom_target(update)
endif()
if(NOT TARGET update-gitexternal)
add_custom_target(update-gitexternal)
add_custom_target(flatten-gitexternal)
add_dependencies(update update-gitexternal)
endif()
if(NOT TARGET ${PROJECT_NAME}-flatten-gitexternal)
if(NOT TARGET ${PROJECT_NAME}-update-gitexternal)
add_custom_target(${PROJECT_NAME}-update-gitexternal)
add_custom_target(${PROJECT_NAME}-flatten-gitexternal)
add_dependencies(update ${PROJECT_NAME}-update-gitexternal)
endif()

# Create a unique, flat name
Expand Down Expand Up @@ -328,7 +293,7 @@ endif()")
COMMENT "Update ${REPO} in ${GIT_EXTERNALS_BASE}"
DEPENDS ${GIT_EXTERNAL_TARGET}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_dependencies(update-gitexternal
add_dependencies(${PROJECT_NAME}-update-gitexternal
update-gitexternal-${GIT_EXTERNAL_NAME})

# Flattens a git external repository into its parent repo:
Expand All @@ -346,12 +311,10 @@ endif()")
COMMENT "Flatten ${REPO} into ${DIR}"
DEPENDS ${PROJECT_NAME}-make-branch
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${DIR}")
add_dependencies(flatten-gitexternal
flatten-gitexternal-${GIT_EXTERNAL_NAME})
add_dependencies(${PROJECT_NAME}-flatten-gitexternal
flatten-gitexternal-${GIT_EXTERNAL_NAME})

foreach(_target flatten-gitexternal-${GIT_EXTERNAL_NAME} ${PROJECT_NAME}-flatten-gitexternal flatten-gitexternal update-gitexternal-${GIT_EXTERNAL_NAME} ${GIT_EXTERNAL_TARGET} update-gitexternal update)
foreach(_target flatten-gitexternal-${GIT_EXTERNAL_NAME} ${PROJECT_NAME}-flatten-gitexternal update-gitexternal-${GIT_EXTERNAL_NAME} ${GIT_EXTERNAL_TARGET} ${PROJECT_NAME}-update-gitexternal update)
set_target_properties(${_target} PROPERTIES
EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER git)
endforeach()
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[TOC]

# Introduction {#Introduction}
# Introduction

Servus is a small C++ network utility library that provides a zeroconf
API, URI parsing and UUIDs.
Expand All @@ -10,7 +10,7 @@ Servus can be retrieved by cloning the
[Bug Report](https://github.com/HBPVis/servus/issues) if you find any issues
with this release.

## Features {#Features}
## Features

Servus provides classes for:

Expand All @@ -20,15 +20,17 @@ Servus provides classes for:
* Zeroconf announcement and browsing using Avahi or DNSSD
* Detailed @ref Changelog

# Building {#Building}
# Building

Servus is a cross-platform library, the only mandatory dependency is a C++11
compiler. Zeroconf will be available in those platforms were either Avahi or
DNSSD are available, otherwise an empty dummy backend is used. Servus uses CMake
to provide a platform-independent build configuration. The following platforms
and build environments have been tested:

* Linux: Ubuntu 16.04, RHEL 6 using gcc 4.8.3
* Linux: Ubuntu 16.04, RHEL 6.8 (Makefile, Ninja)
* Windows: 7 (Visual Studio 2012)
* Mac OS X: 10.9 (Makefile, Ninja)

The following external, pre-installed optional dependencies are used:

Expand All @@ -42,5 +44,5 @@ Building from source is as simple as:
git clone https://github.com/HBPVIS/Servus.git
mkdir Servus/build
cd Servus/build
cmake ..
make
cmake -GNinja ..
ninja
2 changes: 2 additions & 0 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

# git master

# Release 1.5 (09-12-2016)

* [64](https://github.com/HBPVis/Servus/pull/64):
Add Serializable::getSchema()
* [64](https://github.com/HBPVis/Servus/pull/64):
Expand Down

0 comments on commit 2da95ea

Please sign in to comment.