Permalink
Browse files

Add new waf + resolve.json

  • Loading branch information...
petya2164 committed Apr 1, 2017
1 parent 613361d commit 6fe0ae9f1e5cda37023cf24a82b22db34f9cc3ab
Showing with 76 additions and 91 deletions.
  1. +8 −3 .gitignore
  2. +4 −1 NEWS.rst
  3. +4 −4 buildbot.py
  4. +20 −28 config.py
  5. +25 −0 resolve.json
  6. +6 −6 test/src/test_program.cpp
  7. +9 −9 waf
  8. +0 −40 wscript
View
@@ -17,12 +17,15 @@
# Compiled Doxygen documentation
/doxygen/html
# For projects that use Waf for building: http://code.google.com/p/waf/
# Waf files
waf-*
waf3-*
.waf-*
.waf3-*
.lock-*
build
bundle_dependencies
resolve_symlinks
resolved_dependencies
# Gnu Global tag files
GPATH
@@ -37,10 +40,11 @@ GTAGS
#Eclipse ignore
.cproject
.project
*.project
.metadata
local.properties
.classpath
.settings/
# Visual Studio ignore
*.bat
@@ -51,4 +55,5 @@ local.properties
*.sdf
*.opensdf
*.log
*.vcxproj*
VSProjects
View
@@ -6,7 +6,10 @@ every change, see the Git log.
Latest
------
* TBD
* tbd
* Major: Upgrade to waf-tools 4
* Minor: Upgrade to gtest 4
* Minor: Upgrade to stub 6
2.0.0
-----
View
@@ -33,13 +33,13 @@ def configure(properties):
if properties.get('build_distclean'):
command += ['distclean']
command += ['configure', '--git-protocol=git@']
command += ['configure', '--git_protocol=git@']
if 'waf_bundle_path' in properties:
command += ['--bundle-path=' + properties['waf_bundle_path']]
if 'waf_resolve_path' in properties:
command += ['--resolve_path=' + properties['waf_resolve_path']]
if 'dependency_project' in properties:
command += ['--{0}-use-checkout={1}'.format(
command += ['--{0}_checkout={1}'.format(
properties['dependency_project'],
properties['dependency_checkout'])]
View
@@ -1,46 +1,33 @@
#!/usr/bin/env python
# encoding: utf-8
import urllib2
import traceback
import sys
project_name = 'skipper'
try:
input = raw_input
except NameError:
pass
project_name = 'hex'
project_dependencies = \
[
'waf-tools',
'gtest',
'stub',
]
# Importing a dynamically generated module
# Python recipe from http://code.activestate.com/recipes/82234
def importCode(code, name, add_to_sys_modules=0):
"""
Import dynamically generated code as a module. code is the
object containing the code (a string, a file handle or an
actual compiled code object, same types as accepted by an
exec statement). The name is the name to give to the module,
and the final argument says wheter to add it to sys.modules
or not. If it is added, a subsequent import statement using
name will return this module. If it is not added to sys.modules
import will try to load it in the normal fashion.
import foo
is equivalent to
foofile = open("/path/to/foo.py")
foo = importCode(foofile,"foo",1)
Returns a newly generated module.
Import dynamically generated code as a module.
Python recipe from http://code.activestate.com/recipes/82234
"""
import imp
module = imp.new_module(name)
exec code in module.__dict__
exec(code, module.__dict__)
if add_to_sys_modules:
sys.modules[name] = module
@@ -53,22 +40,27 @@ def importCode(code, name, add_to_sys_modules=0):
url = "https://raw.github.com/steinwurf/steinwurf-labs/" \
"master/config_helper/config-impl.py"
try:
from urllib.request import urlopen, Request
except ImportError:
from urllib2 import urlopen, Request
try:
# Fetch the code file from the given url
req = urllib2.Request(url)
response = urllib2.urlopen(req)
req = Request(url)
response = urlopen(req)
code = response.read()
print("Update complete. Code size: {}\n".format(len(code)))
try:
# Import the code string as a module
mod = importCode(code, "config_helper")
# Run the actual config tool from the dynamic module
mod.config_tool(project_dependencies)
mod.config_tool(project_dependencies, project_name)
except:
print("Unexpected error:")
print traceback.format_exc()
print(traceback.format_exc())
except Exception as e:
print("Could not fetch code file from:\n\t{}".format(url))
print(e)
raw_input('Press ENTER to exit...')
input('Press ENTER to exit...')
View
@@ -0,0 +1,25 @@
[
{
"name": "waf-tools",
"resolver": "git",
"method": "semver",
"major": 4,
"sources": ["github.com/steinwurf/waf-tools.git"]
},
{
"name": "gtest",
"internal": true,
"resolver": "git",
"method": "semver",
"major": 4,
"sources": ["github.com/steinwurf/gtest.git"]
},
{
"name": "stub",
"internal": true,
"resolver": "git",
"method": "semver",
"major": 6,
"sources": ["github.com/steinwurf/stub.git"]
}
]
View
@@ -6,7 +6,7 @@
#include <skipper/program.hpp>
#include <gtest/gtest.h>
#include <stub/call.hpp>
#include <stub/function.hpp>
#include <sstream>
@@ -23,7 +23,7 @@ TEST(test_program, void_command)
p.set_print_help(false);
p.set_ready_indicator("");
stub::call<void(void)> m_print_function;
stub::function<void(void)> m_print_function;
auto print_function = [&]() {m_print_function();};
p.add_command("p", "print something", print_function);
@@ -41,7 +41,7 @@ TEST(test_program, int_set_command)
p.set_print_help(false);
p.set_ready_indicator("");
stub::call<void(int)> m_function;
stub::function<void(int)> m_function;
std::function<void(int)> function = [&](int value) {m_function(value);};
p.add_command<int>("a", "help", function, skipper::set<int>({0,7,42,1}));
@@ -59,7 +59,7 @@ TEST(test_program, string_any_command)
p.set_print_help(false);
p.set_ready_indicator("");
stub::call<void(std::string)> m_function;
stub::function<void(std::string)> m_function;
std::function<void(std::string)> function = [&](std::string value)
{
m_function(value);
@@ -81,7 +81,7 @@ TEST(test_program, float_range_command)
p.set_print_help(false);
p.set_ready_indicator("");
stub::call<void(float)> m_function;
stub::function<void(float)> m_function;
std::function<void(float)> function = [&](float value) {m_function(value);};
p.add_command<float>("a", "help", function,
skipper::range<float>(-4.0F, 7.2F));
@@ -100,7 +100,7 @@ TEST(test_program, trigger_errors)
p.set_print_help(false);
p.set_ready_indicator("");
stub::call<void(int)> m_function;
stub::function<void(int)> m_function;
std::function<void(int)> function = [&](int value) {m_function(value);};
p.add_command<int>("a", "help", function, skipper::range<int>(0, 10));
View
18 waf

Large diffs are not rendered by default.

Oops, something went wrong.
View
40 wscript
@@ -4,49 +4,9 @@
APPNAME = 'skipper'
VERSION = '2.0.0'
import waflib.extras.wurf_options
def options(opt):
opt.load('wurf_common_tools')
def resolve(ctx):
import waflib.extras.wurf_dependency_resolve as resolve
ctx.load('wurf_common_tools')
ctx.add_dependency(resolve.ResolveVersion(
name='waf-tools',
git_repository='github.com/steinwurf/waf-tools.git',
major=3))
# Internal dependencies
if ctx.is_toplevel():
ctx.add_dependency(resolve.ResolveVersion(
name='gtest',
git_repository='github.com/steinwurf/gtest.git',
major=3))
ctx.add_dependency(resolve.ResolveVersion(
name='stub',
git_repository='github.com/steinwurf/stub.git',
major=4))
def configure(conf):
conf.load("wurf_common_tools")
def build(bld):
bld.load("wurf_common_tools")
bld.env.append_unique(
'DEFINES_STEINWURF_VERSION',
'STEINWURF_SKIPPER_VERSION="{}"'.format(

0 comments on commit 6fe0ae9

Please sign in to comment.