Skip to content
This repository has been archived by the owner on Oct 25, 2021. It is now read-only.

Commit

Permalink
Add new waf + resolve.json
Browse files Browse the repository at this point in the history
  • Loading branch information
petya2164 committed Apr 5, 2017
1 parent 681fcc0 commit 67bd2e9
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 108 deletions.
15 changes: 9 additions & 6 deletions .gitignore
Expand Up @@ -5,7 +5,6 @@

# Compiled Dynamic libraries
*.so
*.dylib

# Compiled Static libraries
*.lai
Expand All @@ -17,15 +16,16 @@

# Compiled Doxygen documentation
/doxygen/html
/doxygen/latex

# 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
Expand All @@ -40,10 +40,11 @@ GTAGS

#Eclipse ignore
.cproject
.project
*.project
.metadata
local.properties
.classpath
.settings/

# Visual Studio ignore
*.bat
Expand All @@ -54,4 +55,6 @@ local.properties
*.sdf
*.opensdf
*.log
VSProjects
*.txt
*.vcxproj*
VSProjects
6 changes: 5 additions & 1 deletion NEWS.rst
Expand Up @@ -6,7 +6,11 @@ of every change, see the Git log.

Latest
------
* Major: Upgrade to kodo-rlnc 4
* Major: Upgrade to waf-tools 4
* Major: Upgrade to boost 3
* Major: Upgrade to kodo-rlnc 6
* Major: Upgrade to tables 6
* Minor: Upgrade to gauge 11
* Major: Removed kodo dependency
* Major: Upgrade to waf-tools 3
* Major: Upgrade to boost 2
Expand Down
8 changes: 4 additions & 4 deletions buildbot.py
Expand Up @@ -34,13 +34,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'])]

Expand Down
83 changes: 46 additions & 37 deletions config.py
@@ -1,44 +1,48 @@
#!/usr/bin/env python
#!/usr/bin/env python
# encoding: utf-8

import os, sys, urllib2, traceback
import traceback
import sys

project_name = 'kodo_basic_simulations'
project_dependencies = \
[
'waf-tools',
'boost',
'fifi',
'kodo-rlnc',
]

# 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
try:
input = raw_input
except NameError:
pass

is equivalent to
project_name = 'kodo-basic-simulations'
project_dependencies = \
[
'waf-tools',
'gtest',
'boost',
'allocate',
'storage',
'gauge',
'tables',
'cpuid',
'platform',
'stub',
'recycle',
'endian',
'hex',
'meta',
'fifi',
'gauge',
'kodo-core',
'kodo-rlnc',
]

foofile = open("/path/to/foo.py")
foo = importCode(foofile,"foo",1)

Returns a newly generated module.
def importCode(code, name, add_to_sys_modules=0):
"""
Import dynamically generated code as a module.
Python recipe from http://code.activestate.com/recipes/82234
"""
import sys,imp
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

Expand All @@ -51,22 +55,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")
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...')
39 changes: 39 additions & 0 deletions resolve.json
@@ -0,0 +1,39 @@
[
{
"name": "waf-tools",
"resolver": "git",
"method": "semver",
"major": 4,
"sources": ["github.com/steinwurf/waf-tools.git"]
},
{
"name": "boost",
"resolver": "git",
"method": "semver",
"major": 3,
"sources": ["github.com/steinwurf/boost.git"]
},
{
"name": "kodo-rlnc",
"optional": true,
"resolver": "git",
"method": "semver",
"major": 6,
"sources": ["github.com/steinwurf/kodo-rlnc.git"]
},
{
"name": "tables",
"resolver": "git",
"method": "semver",
"major": 7,
"sources": ["github.com/steinwurf/tables.git"]
},
{
"name": "gauge",
"internal": true,
"resolver": "git",
"method": "semver",
"major": 11,
"sources": ["github.com/steinwurf/gauge.git"]
}
]
20 changes: 10 additions & 10 deletions waf

Large diffs are not rendered by default.

51 changes: 1 addition & 50 deletions wscript
@@ -1,61 +1,12 @@
#! /usr/bin/env python
# encoding: utf-8

APPNAME = 'kodo_basic_simulations'
APPNAME = 'kodo-basic-simulations'
VERSION = '1.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))

ctx.add_dependency(resolve.ResolveVersion(
name='boost',
git_repository='github.com/steinwurf/boost.git',
major=2))

ctx.add_dependency(resolve.ResolveVersion(
name='kodo-rlnc',
git_repository='github.com/steinwurf/kodo-rlnc.git',
major=4))

ctx.add_dependency(resolve.ResolveVersion(
name='tables',
git_repository='github.com/steinwurf/tables.git',
major=6))

# Internal dependencies
if ctx.is_toplevel():

ctx.add_dependency(resolve.ResolveVersion(
name='gauge',
git_repository='github.com/steinwurf/gauge.git',
major=10))


def configure(conf):

conf.load("wurf_common_tools")


def build(bld):

bld.load("wurf_common_tools")

if bld.is_toplevel():

bld.recurse('relay_simulations')
Expand Down

0 comments on commit 67bd2e9

Please sign in to comment.