Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
codemercenary committed Jul 15, 2015
2 parents 566cb8e + 4204c23 commit 0e1fb97
Show file tree
Hide file tree
Showing 86 changed files with 1,734 additions and 587 deletions.
73 changes: 37 additions & 36 deletions .travis.yml
@@ -1,6 +1,28 @@
language: cpp
compiler: g++
os: linux
sudo: false

matrix:
include:
- os: linux
env:
- _CC: gcc-4.8
- _CXX: g++-4.8
- CMAKE_URL=http://www.cmake.org/files/v3.1/cmake-3.1.0-Linux-i386.tar.gz
- CMAKE_DIRNAME=cmake-3.1.0-Linux-i386
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
- libc6-i386
- os: osx
env:
- _CC: clang
- _CXX: clang++
- CMAKE_URL=http://www.cmake.org/files/v3.1/cmake-3.1.0-Darwin64.tar.gz
- CMAKE_DIRNAME=cmake-3.1.0-Darwin64/CMake.app/Contents

before_install:
# Enforce whitespace guidelines
Expand All @@ -12,49 +34,28 @@ before_install:
# Verify that our version numbers all line up
- ./scripts/version_number_updated.sh

# g++4.8.1
- if [ "$CXX" == "g++" ]; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
&& export CXX;
fi

# clang 3.4
- if [ "$CXX" == "clang++" ]; then
sudo add-apt-repository -y ppa:h-rayflood/llvm;
fi

- sudo apt-get remove gcc-4.6 g++-4.6 cmake
- sudo apt-get -qq update

install:
# CMake 3.1
- sudo apt-get -qq install libc6-i386
&& wget http://www.cmake.org/files/v3.1/cmake-3.1.0-Linux-i386.tar.gz
&& tar -xzf cmake-3.1.0-Linux-i386.tar.gz
&& sudo cp -fR cmake-3.1.0-Linux-i386/* /usr

# g++4.8.1
- if [ "$CXX" = "g++" ]; then
sudo apt-get install -qq gcc-4.8 g++-4.8
&& export CXX="g++-4.8"
&& sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc
&& sudo ln -s /usr/bin/g++-4.8 /usr/bin/g++;
fi

# clang 3.4
- if [ "$CXX" == "clang++" ]; then
sudo apt-get install --allow-unauthenticated -qq clang-3.4
&& export CXX="clang++-3.4";
fi
- curl $CMAKE_URL | tar xz

before_script:
- export CC=$_CC
- export CXX=$_CXX
- $CXX --version
- export CPATH=/usr/include/c++/4.8:/usr/include/x86_64-linux-gnu/c++/4.8/:$CPATH
- export LD_LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8:$LD_LIBRARY_PATH
- cmake . -DCMAKE_BUILD_TYPE=Release -Dautowiring_ARCHITECTURE=x64

script:
# Build Autowriring, run unit tests, and install
- ./scripts/build_test_install.sh
- $CMAKE_DIRNAME/bin/cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=~/autowiring/
- make -j 4 || make
- ctest --output-on-failure
- make install
- cpack || (cat _CPack_Packages/Linux/TGZ/InstallOutput.log; exit 3)
- cd examples
- ../$CMAKE_DIRNAME/bin/cmake . -DCMAKE_PREFIX_PATH:PATH=~
- make


after_failure:
- cat Testing/Temporary/LastTest.log 2> /dev/null
14 changes: 8 additions & 6 deletions CMakeLists.txt
Expand Up @@ -191,12 +191,14 @@ if(NOT AUTOWIRING_IS_EMBEDDED)
)

# Install autoboost headers on ARM, which still requires them
if(autowiring_BUILD_ANDROID)
install(
DIRECTORY ${PROJECT_SOURCE_DIR}/contrib/autoboost/autoboost
DESTINATION include
COMPONENT autowiring
)
if(CMAKE_COMPILER_IS_GNUCC AND ("${CMAKE_CXX_COMPILER}" MATCHES "androideabi"))
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
install(
DIRECTORY ${PROJECT_SOURCE_DIR}/contrib/autoboost/autoboost
DESTINATION include
COMPONENT autowiring
)
endif()
endif()

# Targets file is needed in order to describe how to link Autowiring to the rest of the system
Expand Down
4 changes: 2 additions & 2 deletions Doxyfile
Expand Up @@ -32,7 +32,7 @@ PROJECT_NAME = Autowiring
# This could be handy for archiving the generated documentation or
# if some version control system is used.

PROJECT_NUMBER = "0.7.0"
PROJECT_NUMBER = "0.7.1"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
Expand Down Expand Up @@ -1519,7 +1519,7 @@ PERLMOD_MAKEVAR_PREFIX =
# evaluate all C-preprocessor directives found in the sources and include
# files.

ENABLE_PREPROCESSING = YES
ENABLE_PREPROCESSING = NO

# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
# names in the source code. If set to NO (the default) only conditional
Expand Down
42 changes: 15 additions & 27 deletions README.md
@@ -1,31 +1,21 @@
# Purpose

Autowiring is an [inversion-of-control](http://en.wikipedia.org/wiki/Inversion_of_control) framework for C++11. It provides a declarative way to manage resources through [dependency injection](http://en.wikipedia.org/wiki/Dependency_injection). Instead of explicitly instantiating dependencies, simply declare what you need and Autowiring will manage object creation and wiring.
Autowiring is an [inversion-of-control](http://en.wikipedia.org/wiki/Inversion_of_control) framework for C++11. It provides a declarative way to manage resources through
[dependency injection](http://en.wikipedia.org/wiki/Dependency_injection). Instead of explicitly instantiating dependencies, simply declare what you need and Autowiring
will manage object creation and wiring.

# Build [![Build Status](https://travis-ci.org/leapmotion/autowiring.png)](https://travis-ci.org/leapmotion/autowiring)

Autowiring project structure is specified with [CMake](http://www.cmake.org/). Simply point CMake to the root project directory and generate your desired project file. While Autowiring is written using C++11 features, it supports linking the non-C++11 STL. The `C++11/` directory provides [boost](http://www.boost.org/) shims for missing C++11 library features.

### CMake Options

Because AutoNet has a Boost dependency, it can sometimes be desirable to influence how Boost should be linked to the project. You can influence the decision
making process by setting CMake Boost attributes, which are described by the [cmake documentation](http://www.cmake.org/cmake/help/v3.0/module/FindBoost.html).
A common use case is to statically link to a pre-specified installation of boost. To do this, run CMake as follows:

cmake . \
-DBOOST_ROOT:PATH=/path/to/boost \
-DBoost_USE_STATIC_LIBS:BOOL=ON \
-DBoost_NO_SYSTEM_PATHS:BOOL=ON

Watch the cases, you will get "unused variable" warnings if you don't match what is written above exactly.
Autowiring project structure is specified with [CMake](http://www.cmake.org/). Simply point CMake to the root project directory and generate your desired project file.
The `C++11/` directory provides [boost](http://www.boost.org/) shims for platforms that have incomplete C++11 support.

### Mac

Mac dependencies are installed with [port](http://guide.macports.org/) or [brew](http://brew.sh/). If you have port installed, this will build the project:

git clone git@github.com:leapmotion/autowiring.git
cd autowiring
sudo port install boost cmake
sudo port install cmake
cmake .
make
make test
Expand All @@ -35,16 +25,14 @@ This will configure the project to build fat binaries by default. If you wish t

cmake . -DCMAKE_OSX_ARCHITECTURES:STRING=x86_64

Note that AutoNet will be built for 64-bit only, unless your Boost installation was built as fat binaries.

### Unix
### Linix

The commands for Unix are different depending on what package manager you're using. Ubuntu's package manager is apt-get, OpenSUSE uses zypper, and
CentOS systems use yum. The major apparent difference to the user will be that the package to install has a different name. For Ubuntu, do this:

git clone git@github.com:leapmotion/autowiring.git
cd autowiring
sudo apt-get install libboost-dev cmake
sudo apt-get install cmake
cmake .
make
make test
Expand All @@ -56,19 +44,19 @@ If you want to build for 32-bit Linux, run the following CMake command instead:

### Windows

Unfortunately, Windows doesn't have any sort of nifty package manager, and this requires that you download and install the boost dependency by hand. Once
you've followed the instructions for installing boost as indicated [here](http://www.boost.org/doc/libs/1_55_0/doc/html/bbv2/installation.html) you will
need to set BOOST_ROOT during cmake configuration time to point to the path where boost was built. Here's the magic incantation required, assuming you're
running from a MinGW terminal (comes for free with [Git Extensions](https://code.google.com/p/gitextensions/). You're also going to need a copy of Visual
Studio 2012 or better. Other build systems will probably work, but they aren't officially supported here.
Unfortunately, Windows doesn't have any sort of nifty package manager, and this requires that you download and install cmake yourself. Once that's done,
Here's the magic incantation required, assuming you're running from a MinGW terminal (comes for free with [Git Extensions](https://code.google.com/p/gitextensions/).
You're also going to need a copy of Visual Studio 2012 or better. Other build systems will probably work, but they aren't officially supported here.

git clone git@github.com:leapmotion/autowiring.git
cd autowiring
cmake . -DBOOST_ROOT:Path=<path/to/boost/with/forward/slashes>
cmake .

At this point, you'll have a solution file in your root directory called "Autowiring.sln", if you run Visual Studio as an adminstrator and build the INSTALL
target then Autowiring will be installed on your system. As with the other platforms, CMake will be able to find autowiring when it's installed this way
via the [find_package](http://www.cmake.org/cmake/help/v3.0/command/find_package.html) command.
via the [find_package](http://www.cmake.org/cmake/help/v3.0/command/find_package.html) command. Alternatively, if you prefer to build from the command line:

cmake --build . --config Release

### Arm-linux

Expand Down
2 changes: 1 addition & 1 deletion autowiring/AutoFilterArgument.h
Expand Up @@ -51,4 +51,4 @@ struct AutoFilterArgumentT:
auto_arg<T>::tshift
)
{}
};
};
4 changes: 2 additions & 2 deletions autowiring/AutoFilterDescriptor.h
Expand Up @@ -265,7 +265,7 @@ struct AutoFilterDescriptor:
};

namespace autowiring {
namespace internal {
namespace detail {
/// <summary>
/// Alias for AutoFilterDescriptor(ptr)
/// </summary>
Expand Down Expand Up @@ -295,7 +295,7 @@ AutoFilterDescriptor MakeAFDescriptor(const std::shared_ptr<T>&, std::false_type
/// </remarks>
template<class T>
AutoFilterDescriptor MakeAutoFilterDescriptor(const std::shared_ptr<T>& ptr) {
return autowiring::internal::MakeAFDescriptor(ptr, std::integral_constant<bool, has_autofilter<T>::value>());
return autowiring::detail::MakeAFDescriptor(ptr, std::integral_constant<bool, has_autofilter<T>::value>());
}

namespace std {
Expand Down
2 changes: 1 addition & 1 deletion autowiring/AutoInjectable.h
Expand Up @@ -97,7 +97,7 @@ class AutoInjectableExpressionFn:
/// to create instances of the enclosed payload objects in the current context. This operation is
/// idempotent according to the ordinary rules of AutoRequire and CoreContext::Construct.
/// </remarks>
class AutoInjectable
class DEPRECATED_CLASS(AutoInjectable, "This class is deprecated. Use std::vector<std::function<void()>> instead")
{
public:
AutoInjectable(AutoInjectableExpressionBase* pValue = nullptr);
Expand Down

0 comments on commit 0e1fb97

Please sign in to comment.