#
$project = 'scons';
-$env = new cons( ENV => {
- AEGIS_PROJECT => $ENV{AEGIS_PROJECT},
- PATH => $ENV{PATH},
- } );
-
Default qw( . );
#
map {s/^[CD]//, s/^0*(\d\d)$/$1/} @arr;
$version = join('.', @arr);
-#
-# Use %(-%) around the date so date changes don't cause rebuilds.
-#
-$sed_cmd = "sed" .
- " %( -e 's+__DATE__+$date+' %)" .
- " -e 's+__DEVELOPER__+$developer+'" .
- " -e 's+__REVISION__+$revision+'" .
- " -e 's+__VERSION__+$version+'" .
- " %< > %>";
+chomp($python_ver = `python -c 'import sys; print sys.version[0:3]'`);
-#
-# Run everything in the MANIFEST through the sed command we concocted.
-#
-chomp(@files = `cat src/MANIFEST`);
-foreach $file (@files) {
- Command $env "build/$file", "src/$file", $sed_cmd;
-}
+use Cwd;
+$test_dir = File::Spec->catfile(cwd, "build", "test");
-#
-# Use the Python distutils to generate the packages.
-#
-$tar_gz = "build/dist/$project-$version.tar.gz";
+%package_name = (
+ 'script' => $project,
+ 'engine' => "$project-pylib",
+);
-@setup_args = ('bdist sdist');
+$test_bin_dir = File::Spec->catfile($test_dir, "bin");
+$test_lib_dir = File::Spec->catfile($test_dir,
+ "lib",
+ "python${python_ver}",
+ "site-packages"),
-@targets = (
- "build/dist/$project-$version.linux-i686.tar.gz",
- $tar_gz,
+%install_dir = (
+ 'script' => $test_bin_dir,
+ 'engine' => $test_lib_dir,
);
-if ($rpm) {
- push(@setup_args, 'bdist_rpm');
+$env = new cons( ENV => {
+ AEGIS_PROJECT => $ENV{AEGIS_PROJECT},
+ PATH => $ENV{PATH},
+ },
- push(@targets,
- "build/build/bdist.linux-i686/rpm/SOURCES/$project-$version.tar.gz",
- "build/build/bdist.linux-i686/rpm/SPECS/$project.spec",
- "build/dist/$project-$version-1.src.rpm",
- "build/dist/$project-$version-1.noarch.rpm",
- );
-};
+ TEST_BIN_DIR => $test_bin_dir,
+ TEST_LIB_DIR => $test_lib_dir,
+
+ DATE => $date,
+ DEVELOPER => $developer,
+ REVISION => $revision,
+ VERSION => $version,
+
+ SED => 'sed',
+ # Use %(-%) around the date so date
+ # changes don't cause rebuilds.
+ SEDFLAGS => " %( -e 's+__DATE__+%DATE+' %)" .
+ " -e 's+__DEVELOPER__+%DEVELOPER+'" .
+ " -e 's+__REVISION__+%REVISION+'" .
+ " -e 's+__VERSION__+%VERSION+'",
+ SEDCOM => "%SED %SEDFLAGS %< > %>",
+ );
+
+my @src_deps;
+for $dir ('script', 'engine') {
-$env->Command([@targets],
- map("build/$_", @files),
- qq(rm -rf build/build build/dist/*
- cd build && python setup.py @setup_args)
+ my $pkg = $package_name{$dir};
+ my $install = $install_dir{$dir};
+
+ my $build = "build/$dir";
+ my $src = "src/$dir";
+
+ my @files;
+ chomp(@files = `cat src/$dir/MANIFEST`);
+
+ #
+ # Run everything in the MANIFEST through the sed command we concocted.
+ #
+ my $file;
+ foreach $file (@files) {
+ $env->Command("$build/$file", "$src/$file", "%SEDCOM");
+ }
+
+ #
+ # Use the Python distutils to generate the packages.
+ #
+ my $tar_gz = "$build/dist/$pkg-$version.tar.gz";
+
+ push(@src_deps, $tar_gz);
+
+ my @setup_args = ('bdist sdist');
+
+ my @targets = (
+ "$build/dist/$pkg-$version.linux-i686.tar.gz",
+ $tar_gz,
+ );
+
+ if ($rpm) {
+ push(@setup_args, 'bdist_rpm');
+
+ # XXX "$build/build/bdist.linux-i686/rpm/SOURCES/$pkg-$version.tar.gz",
+ # XXX "$build/build/bdist.linux-i686/rpm/SPECS/$pkg.spec",
+ push(@targets,
+ "$build/dist/$pkg-$version-1.src.rpm",
+ "$build/dist/$pkg-$version-1.noarch.rpm",
+ );
+ };
+
+ $env->Command([@targets],
+ map("$build/$_", @files),
+ qq(rm -rf $build/build $build/dist/*
+ cd $build && python setup.py @setup_args)
);
-$env->Depends([@targets], 'build/MANIFEST');
+ $env->Depends([@targets], "$build/MANIFEST");
-#
-# Unpack the .tar.gz created by the distutils into build/test, and
-# add the TestCmd.py module. The runtest.py script will set PYTHONPATH
-# so that the tests only look under build/test. This makes sure that
-# our tests pass with what we really packaged, not because of something
-# hanging around in the development directory.
-#
-$test_dir = "build/test";
+ $env->Install("build/dist", @targets);
-@test_files = map("$test_dir/$project-$version/$_", @files);
+ #
+ # Unpack the .tar.gz created by the distutils into build/unpack.
+ #
+ my $unpack = "build/unpack";
-Command $env [@test_files], $tar_gz, qq(
- rm -rf $test_dir/$project-$version
- tar zxf %< -C $test_dir
-);
+ my @unpack_files = map("$unpack/$pkg-$version/$_", @files);
-Export qw( env test_dir );
+ Command $env [@unpack_files], $tar_gz, qq(
+ rm -rf $unpack/$pkg-$version
+ tar zxf %< -C $unpack
+ );
+
+ #
+ # Run setup.py in the unpacked subdirectory to "install" everything
+ # into our build/test subdirectory. Auxiliary modules that we need
+ # (TestCmd.py, TestSCons.py, unittest.py) will be copied in by
+ # etc/Conscript. The runtest.py script will set PYTHONPATH so that
+ # the tests only look under build/test. This makes sure that our
+ # tests pass with what we really packaged, not because of something
+ # hanging around in the development directory.
+ #
+ my %seen;
+ map($seen{$_}++, "MANIFEST", "setup.py");
+ @test_files = map(File::Spec->catfile($install, $_),
+ grep($_ =~ /\.py$/ && ! $seen{$_}++, @files));
+
+ Command $env [@test_files], @unpack_files, qq(
+ rm -rf $install
+ cd $unpack/$pkg-$version && python setup.py install --prefix=$test_dir
+ );
+}
+
+Export qw( env );
Build "etc/Conscript";
if ($jw) {
Link 'build/doc' => 'doc';
- Export qw( date env revision version );
-
Build 'build/doc/Conscript';
}
chomp(@src_files);
foreach $file (@src_files) {
- $env->Command("build/$project-src/$file", $file, $sed_cmd);
+ $env->Command("build/$project-src/$file", $file, "%SEDCOM");
}
$env->Command("build/dist/$project-src-$version.tar.gz",
- $tar_gz,
+ @src_deps,
map("build/$project-src/$_", @src_files),
qq(
rm -rf build/$project-src-$version
# Conscript file for building SCons documentation.
#
-Import qw(
- date
- env
- revision
- version
-);
+Import qw( env );
#
#
#
-$doc_tar_gz = "#build/dist/scons-doc-$version.tar.gz";
+$doc_tar_gz = "#build/dist/scons-doc-${\$env->{VERSION}}.tar.gz";
#
# We'll only try to build text files (for some documents)
<!--
THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
-->
-<!ENTITY build_date "$date">
-<!ENTITY build_version "$version">
-<!ENTITY build_revision "$revision">
+<!ENTITY build_date "${\$env->{DATE}}">
+<!ENTITY build_version "${\$env->{VERSION}}">
+<!ENTITY build_revision "${\$env->{REVISION}}">
_EOF_
close(FILE);
# of stuff to work on SCons.
#
-Import qw( env test_dir );
+Import qw( env );
@modules = qw(TestCmd.py TestSCons.py unittest.py);
-$env->Install("#$test_dir", @modules);
+$env->Install($env->{TEST_LIB_DIR}, @modules);
print "STDERR ============"
print self.stderr()
raise
+ if self.status:
+ print self.progam + " returned " + (self.status >> 8)
+ print "STDERR ============"
+ print self.stderr()
+ raise TestFailed
if stdout and not self.match(self.stdout(), stdout):
print "Expected STDOUT =========="
print stdout
version = aegis_to_version(version)
- build_test = os.path.join(cwd, "build", "test")
- scons_dir = os.path.join(build_test, "scons-" + version)
+ scons_dir = os.path.join(cwd, 'build', 'test', 'bin')
- os.environ['PYTHONPATH'] = string.join([scons_dir,
- build_test],
- os.pathsep)
+ os.environ['PYTHONPATH'] = os.path.join(cwd,
+ 'build',
+ 'test',
+ 'lib',
+ 'python' + sys.version[0:3],
+ 'site-packages')
else:
- scons_dir = os.path.join(cwd, 'src')
+ scons_dir = os.path.join(cwd, 'src', 'script')
- os.environ['PYTHONPATH'] = string.join([os.path.join(cwd, 'src'),
+ os.environ['PYTHONPATH'] = string.join([os.path.join(cwd, 'src', 'engine'),
os.path.join(cwd, 'etc')],
os.pathsep)
+++ /dev/null
-MANIFEST
-scons/__init__.py
-scons/Builder.py
-scons/Defaults.py
-scons/Environment.py
-scons/Errors.py
-scons/Job.py
-scons/exitfuncs.py
-scons/Node/__init__.py
-scons/Node/FS.py
-scons/Scanner/__init__.py
-scons/Scanner/C.py
-scons/Sig/__init__.py
-scons/Sig/MD5.py
-scons/Sig/TimeStamp.py
-scons.py
-setup.py
--- /dev/null
+MANIFEST
+SCons/__init__.py
+SCons/Builder.py
+SCons/Defaults.py
+SCons/Environment.py
+SCons/Errors.py
+SCons/Job.py
+SCons/exitfuncs.py
+SCons/Node/__init__.py
+SCons/Node/FS.py
+SCons/Scanner/__init__.py
+SCons/Scanner/C.py
+SCons/Sig/__init__.py
+SCons/Sig/MD5.py
+SCons/Sig/TimeStamp.py
+setup.py
-"""scons.Builder
+"""SCons.Builder
XXX
import os
+import SCons.Node.FS
import types
-from scons.Node.FS import Dir, File, lookup
action = None,
input_suffix = None,
output_suffix = None,
- node_class = File):
+ node_class = SCons.Node.FS.File):
self.name = name
self.action = Action(action)
self.insuffix = input_suffix
return cmp(self.__dict__, other.__dict__)
def __call__(self, env, target = None, source = None):
- node = lookup(self.node_class, target)
+ node = SCons.Node.FS.lookup(self.node_class, target)
node.builder_set(self)
node.env_set(self)
node.sources = source # XXX REACHING INTO ANOTHER OBJECT
import unittest
import TestCmd
-from scons.Builder import Builder, CommandAction, FunctionAction
+import SCons.Builder
# Initial setup of the common environment for all tests,
Verify that we can retrieve the supplied action attribute.
"""
- builder = Builder(action = "foo")
+ builder = SCons.Builder.Builder(action = "foo")
assert builder.action.command == "foo"
def test_cmp(self):
"""Test simple comparisons of Builder objects
"""
- b1 = Builder(input_suffix = '.o')
- b2 = Builder(input_suffix = '.o')
+ b1 = SCons.Builder.Builder(input_suffix = '.o')
+ b2 = SCons.Builder.Builder(input_suffix = '.o')
assert b1 == b2
- b3 = Builder(input_suffix = '.x')
+ b3 = SCons.Builder.Builder(input_suffix = '.x')
assert b1 != b3
assert b2 != b3
and one is an internal Python function.
"""
cmd = "python %s %s xyzzy" % (act_py, outfile)
- builder = Builder(action = cmd)
+ builder = SCons.Builder.Builder(action = cmd)
builder.execute()
assert test.read(outfile, 'r') == "act.py: xyzzy\n"
f.close()
return not None
- builder = Builder(action = function)
+ builder = SCons.Builder.Builder(action = function)
builder.execute(out = outfile)
assert test.read(outfile, 'r') == "function\n"
Make sure that the '.' separator is appended to the
beginning if it isn't already present.
"""
- builder = Builder(input_suffix = '.c')
+ builder = SCons.Builder.Builder(input_suffix = '.c')
assert builder.insuffix == '.c'
- builder = Builder(input_suffix = 'c')
+ builder = SCons.Builder.Builder(input_suffix = 'c')
assert builder.insuffix == '.c'
def test_name(self):
"""Test Builder creation with a specified name
"""
- builder = Builder(name = 'foo')
+ builder = SCons.Builder.Builder(name = 'foo')
assert builder.name == 'foo'
def test_node_class(self):
"""
class Foo:
pass
- builder = Builder(node_class = Foo)
+ builder = SCons.Builder.Builder(node_class = Foo)
assert builder.node_class is Foo
def test_outsuffix(self):
Make sure that the '.' separator is appended to the
beginning if it isn't already present.
"""
- builder = Builder(input_suffix = '.o')
+ builder = SCons.Builder.Builder(input_suffix = '.o')
assert builder.insuffix == '.o'
- builder = Builder(input_suffix = 'o')
+ builder = SCons.Builder.Builder(input_suffix = 'o')
assert builder.insuffix == '.o'
-"""scons.Defaults
+"""SCons.Defaults
Builders and other things for the local site. Here's where we'll
duplicate the functionality of autoconf until we move it into the
-from scons.Builder import Builder
+import SCons.Builder
-Object = Builder(name = 'Object', action = 'cc -c -o %(target)s %(source)s')
-Program = Builder(name = 'Program', action = 'cc -o %(target)s %(source)s')
+Object = SCons.Builder.Builder(name = 'Object',
+ action = 'cc -c -o %(target)s %(source)s')
+Program = SCons.Builder.Builder(name = 'Program',
+ action = 'cc -o %(target)s %(source)s')
Builders = [Object, Program]
-"""scons.Environment
+"""SCons.Environment
XXX
if not type(builders) is types.ListType:
kw['BUILDERS'] = [builders]
else:
- import scons.Defaults
- kw['BUILDERS'] = scons.Defaults.Builders[:]
+ import SCons.Defaults
+ kw['BUILDERS'] = SCons.Defaults.Builders[:]
self.Dictionary.update(copy.deepcopy(kw))
class BuilderWrapper:
-__revision__ = "EnivronmentTests.py __REVISION__ __DATE__ __DEVELOPER__"
+__revision__ = "EnvironmentTests.py __REVISION__ __DATE__ __DEVELOPER__"
import sys
import unittest
-from scons.Environment import *
+from SCons.Environment import *
-"""scons.Errors
+"""SCons.Errors
This file contains the exception classes used to handle internal
-and user errors in scons.
+and user errors in SCons.
"""
import sys
import unittest
-from scons.Errors import InternalError, UserError
+import SCons.Errors
class ErrorsTestCase(unittest.TestCase):
def test_InternalError(self):
"""Test the InternalError exception."""
try:
- raise InternalError, "test internal error"
- except InternalError, e:
+ raise SCons.Errors.InternalError, "test internal error"
+ except SCons.Errors.InternalError, e:
assert e.args == "test internal error"
def test_UserError(self):
"""Test the UserError exception."""
try:
- raise UserError, "test user error"
- except UserError, e:
+ raise SCons.Errors.UserError, "test user error"
+ except SCons.Errors.UserError, e:
assert e.args == "test user error"
-"""scons.Job
+"""SCons.Job
This module defines the Serial and Parallel classes that execute tasks to
complete a build. The Jobs class provides a higher level interface to start,
import unittest
import random
import math
-import scons.Job
+import SCons.Job
import sys
# a large number
raise NoThreadsException()
taskmaster = Taskmaster(num_tasks, self, Task)
- jobs = scons.Job.Jobs(num_jobs, taskmaster)
+ jobs = SCons.Job.Jobs(num_jobs, taskmaster)
jobs.start()
jobs.wait()
"test a serial job"
taskmaster = Taskmaster(num_tasks, self, Task)
- jobs = scons.Job.Jobs(1, taskmaster)
+ jobs = SCons.Job.Jobs(1, taskmaster)
jobs.start()
jobs.wait()
"test a serial job with tasks that raise exceptions"
taskmaster = Taskmaster(num_tasks, self, ExceptionTask)
- jobs = scons.Job.Jobs(1, taskmaster)
+ jobs = SCons.Job.Jobs(1, taskmaster)
jobs.start()
jobs.wait()
"test parallel jobs with tasks that raise exceptions"
taskmaster = Taskmaster(num_tasks, self, ExceptionTask)
- jobs = scons.Job.Jobs(num_jobs, taskmaster)
+ jobs = SCons.Job.Jobs(num_jobs, taskmaster)
jobs.start()
jobs.wait()
-"""scons.Node.FS
+"""SCons.Node.FS
File system nodes.
import os
import os.path
-from scons.Node import Node
+import SCons.Node
# linked_targets
# is_accessible
-class Dir(Node):
+class Dir(SCons.Node.Node):
"""A class for directories in a file system.
"""
# is_under
# relpath
-class File(Node):
+class File(SCons.Node.Node):
"""A class for files in a file system.
"""
import sys
import unittest
-from scons.Node.FS import init, lookup, Dir, File
+import SCons.Node.FS
os.chdir(sub_dir)
- init()
+ SCons.Node.FS.init()
def Dir_test(lpath, path, abspath, up_path):
- dir = lookup(Dir, lpath)
+ dir = SCons.Node.FS.lookup(SCons.Node.FS.Dir, lpath)
assert(dir.path == path)
assert(dir.abspath == abspath)
assert(dir.up().path == up_path)
Dir_test('./.', '.', sub_dir, sub)
Dir_test('foo/./bar', 'foo/bar/', sub_dir_foo_bar, 'foo/')
- d1 = lookup(Dir, 'd1')
+ d1 = SCons.Node.FS.lookup(SCons.Node.FS.Dir, 'd1')
- f1 = lookup(File, 'f1', directory = d1)
+ f1 = SCons.Node.FS.lookup(SCons.Node.FS.File, 'f1', directory = d1)
assert(f1.path == 'd1/f1')
try:
- f2 = lookup(File, 'f1/f2', directory = d1)
+ f2 = SCons.Node.FS.lookup(SCons.Node.FS.File, 'f1/f2', directory = d1)
except TypeError, x:
node = x.args[0]
assert(node.path == 'd1/f1')
raise
try:
- dir = lookup(Dir, 'd1/f1')
+ dir = SCons.Node.FS.lookup(SCons.Node.FS.Dir, 'd1/f1')
except TypeError, x:
node = x.args[0]
assert(node.path == 'd1/f1')
import sys
import unittest
-from scons.Node import Node
+import SCons.Node
def test_build(self):
"""Test building a node
"""
- node = Node()
+ node = SCons.Node.Node()
node.builder_set(Builder())
node.path = "xxx" # XXX FAKE SUBCLASS ATTRIBUTE
node.sources = "yyy" # XXX FAKE SUBCLASS ATTRIBUTE
def test_builder_set(self):
"""Test setting a Node's Builder
"""
- node = Node()
+ node = SCons.Node.Node()
b = Builder()
node.builder_set(b)
assert node.builder == b
-"""scons.Node
+"""SCons.Node
-The Node package for the scons software construction utility.
+The Node package for the SCons software construction utility.
"""
-"""scons.Scanner.C
+"""SCons.Scanner.C
This module implements the depenency scanner for C/C++ code.
__revision__ = "Scanner/C.py __REVISION__ __DATE__ __DEVELOPER__"
-import scons.Scanner
+import SCons.Scanner
import re
import os.path
def CScan():
"Return a Scanner instance for scanning C/C++ source files"
- return scons.Scanner.Scanner(scan)
+ return SCons.Scanner.Scanner(scan)
def find_files(filenames, paths):
"""
__revision__ = "Scanner/CTests.py __REVISION__ __DATE__ __DEVELOPER__"
-from TestCmd import TestCmd
-import scons.Scanner.C
+import TestCmd
+import SCons.Scanner.C
import unittest
import sys
-test = TestCmd(workdir = '')
+test = TestCmd.TestCmd(workdir = '')
# create some source files and headers:
class CScannerTestCase1(unittest.TestCase):
def runTest(self):
env = DummyEnvironment
- s = scons.Scanner.C.CScan()
+ s = SCons.Scanner.C.CScan()
deps = s.scan(test.workpath('f1.cpp'), env)
self.failUnless(deps_match(deps, ['f1.h', 'f2.h']))
def runTest(self):
env = DummyEnvironment
env.CPPPATH = [test.workpath("d1")]
- s = scons.Scanner.C.CScan()
+ s = SCons.Scanner.C.CScan()
deps = s.scan(test.workpath('f1.cpp'), env)
headers = ['f1.h', 'd1/f2.h']
self.failUnless(deps_match(deps, headers))
def runTest(self):
env = DummyEnvironment
env.CPPPATH = [test.workpath("d1")]
- s = scons.Scanner.C.CScan()
+ s = SCons.Scanner.C.CScan()
deps = s.scan(test.workpath('f2.cpp'), env)
headers = ['f1.h', 'd1/f2.h', 'd1/d2/f1.h']
self.failUnless(deps_match(deps, headers))
def runTest(self):
env = DummyEnvironment
env.CPPPATH = [test.workpath("d1"), test.workpath("d1/d2")]
- s = scons.Scanner.C.CScan()
+ s = SCons.Scanner.C.CScan()
deps = s.scan(test.workpath('f2.cpp'), env)
headers = ['f1.h', 'd1/f2.h', 'd1/d2/f1.h', 'd1/d2/f4.h']
self.failUnless(deps_match(deps, headers))
class CScannerTestCase5(unittest.TestCase):
def runTest(self):
env = DummyEnvironment
- s = scons.Scanner.C.CScan()
+ s = SCons.Scanner.C.CScan()
deps = s.scan(test.workpath('f3.cpp'), env)
headers = ['f1.h', 'f2.h', 'f3.h', 'd1/f1.h', 'd1/f2.h', 'd1/f3.h']
self.failUnless(deps_match(deps, headers))
__revision__ = "Scanner/ScannerTests.py __REVISION__ __DATE__ __DEVELOPER__"
import unittest
-import scons.Scanner
+import SCons.Scanner
import sys
class ScannerTestBase:
class ScannerPositionalTestCase(ScannerTestBase, unittest.TestCase):
"Test the Scanner class using the position argument"
def runTest(self):
- s = scons.Scanner.Scanner(self.func)
+ s = SCons.Scanner.Scanner(self.func)
env = DummyEnvironment()
env.VARIABLE = "var1"
self.test(s, env, 'f1.cpp', ['f1.h', 'f1.hpp'])
class ScannerKeywordTestCase(ScannerTestBase, unittest.TestCase):
"Test the Scanner class using the keyword argument"
def runTest(self):
- s = scons.Scanner.Scanner(function = self.func)
+ s = SCons.Scanner.Scanner(function = self.func)
env = DummyEnvironment()
env.VARIABLE = "var2"
self.test(s, env, 'f2.cpp', ['f2.h', 'f2.hpp'])
"Test the Scanner class using the position argument and optional argument"
def runTest(self):
arg = "this is the argument"
- s = scons.Scanner.Scanner(self.func, arg)
+ s = SCons.Scanner.Scanner(self.func, arg)
env = DummyEnvironment()
env.VARIABLE = "var3"
self.test(s, env, 'f3.cpp', ['f3.h', 'f3.hpp'], arg)
"Test the Scanner class using the keyword argument and optional argument"
def runTest(self):
arg = "this is another argument"
- s = scons.Scanner.Scanner(function = self.func, argument = arg)
+ s = SCons.Scanner.Scanner(function = self.func, argument = arg)
env = DummyEnvironment()
env.VARIABLE = "var4"
self.test(s, env, 'f4.cpp', ['f4.h', 'f4.hpp'], arg)
-"""scons.Scanner
+"""SCons.Scanner
-The Scanner package for the scons software construction utility.
+The Scanner package for the SCons software construction utility.
"""
-"""scons.Sig.MD5
+"""SCons.Sig.MD5
-The MD5 signature package for the scons software construction
+The MD5 signature package for the SCons software construction
utility.
"""
"""Return a signature as a string of hex characters.
"""
# NOTE: This routine is a method in the Python 2.0 interface
- # of the native md5 module, but we want scons to operate all
+ # of the native md5 module, but we want SCons to operate all
# the way back to at least Python 1.5.2, which doesn't have it.
h = string.hexdigits
r = ''
import sys
import unittest
-import scons.Sig.MD5
+import SCons.Sig.MD5
def signature(self):
if not self.sig:
- self.sig = scons.Sig.MD5.signature(self.value)
+ self.sig = SCons.Sig.MD5.signature(self.value)
return self.sig
def current(self, sig):
- return scons.Sig.MD5.current(self, sig)
+ return SCons.Sig.MD5.current(self, sig)
Simple comparison of different "signature" values.
"""
o111 = my_obj(value = '111')
- assert not o111.current(scons.Sig.MD5.signature('110'))
- assert o111.current(scons.Sig.MD5.signature('111'))
- assert not o111.current(scons.Sig.MD5.signature('112'))
+ assert not o111.current(SCons.Sig.MD5.signature('110'))
+ assert o111.current(SCons.Sig.MD5.signature('111'))
+ assert not o111.current(SCons.Sig.MD5.signature('112'))
def test_set(self):
pass # XXX
o1 = my_obj(value = '111')
o2 = my_obj(value = '222')
o3 = my_obj(value = '333')
- assert '698d51a19d8a121ce581499d7b701668' == scons.Sig.MD5.collect(o1)
- assert '8980c988edc2c78cc43ccb718c06efd5' == scons.Sig.MD5.collect(o1, o2)
- assert '53fd88c84ff8a285eb6e0a687e55b8c7' == scons.Sig.MD5.collect(o1, o2, o3)
+ assert '698d51a19d8a121ce581499d7b701668' == SCons.Sig.MD5.collect(o1)
+ assert '8980c988edc2c78cc43ccb718c06efd5' == SCons.Sig.MD5.collect(o1, o2)
+ assert '53fd88c84ff8a285eb6e0a687e55b8c7' == SCons.Sig.MD5.collect(o1, o2, o3)
def test_signature(self):
pass # XXX
-"""scons.Sig.TimeStamp
+"""SCons.Sig.TimeStamp
-The TimeStamp signature package for the scons software construction
+The TimeStamp signature package for the SCons software construction
utility.
"""
import sys
import unittest
-import scons.Sig.TimeStamp
+import SCons.Sig.TimeStamp
Simple comparison of different timestamp values.
"""
o1 = my_obj(value = 111)
- assert scons.Sig.TimeStamp.current(o1, 110)
- assert scons.Sig.TimeStamp.current(o1, 111)
- assert not scons.Sig.TimeStamp.current(o1, 112)
+ assert SCons.Sig.TimeStamp.current(o1, 110)
+ assert SCons.Sig.TimeStamp.current(o1, 111)
+ assert not SCons.Sig.TimeStamp.current(o1, 112)
def test_set(self):
pass # XXX
o1 = my_obj(value = 111)
o2 = my_obj(value = 222)
o3 = my_obj(value = 333)
- assert 111 == scons.Sig.TimeStamp.collect(o1)
- assert 222 == scons.Sig.TimeStamp.collect(o1, o2)
- assert 333 == scons.Sig.TimeStamp.collect(o1, o2, o3)
+ assert 111 == SCons.Sig.TimeStamp.collect(o1)
+ assert 222 == SCons.Sig.TimeStamp.collect(o1, o2)
+ assert 333 == SCons.Sig.TimeStamp.collect(o1, o2, o3)
def test_signature(self):
pass # XXX
-"""scons.Sig
+"""SCons.Sig
-The Signature package for the scons software construction utility.
+The Signature package for the SCons software construction utility.
"""
-"""scons
+"""SCons
-The main package for the scons software construction utility.
+The main package for the SCons software construction utility.
"""
-"""scons.exitfuncs
+"""SCons.exitfuncs
-Register functions which are executed when scons exits for any reason.
+Register functions which are executed when SCons exits for any reason.
"""
--- /dev/null
+__revision__ = "setup.py __REVISION__ __DATE__ __DEVELOPER__"
+
+from string import join, split
+
+from distutils.core import setup
+
+setup(name = "scons-pylib",
+ version = "__VERSION__",
+ description = "scons",
+ author = "Steven Knight",
+ author_email = "knight@baldmt.com",
+ url = "http://www.scons.org/",
+ packages = ["SCons",
+ "SCons.Node",
+ "SCons.Scanner",
+ "SCons.Sig"])
--- /dev/null
+MANIFEST
+scons.py
+setup.py
import sys
import traceback
-from scons.Node.FS import init, Dir, File, lookup
-from scons.Environment import Environment
-import scons.Job
-from scons.Builder import Builder
-from scons.Errors import *
+import SCons.Node.FS
+import SCons.Job
+from SCons.Errors import *
+
+#
+# Modules and classes that we don't use directly in this script, but
+# which we want available for use in SConstruct and SConscript files.
+#
+from SCons.Environment import Environment
+from SCons.Builder import Builder
class Task:
"XXX: this is here only until the build engine is implemented"
help = "Don't build; list files and where defined.")
def opt_n(opt, arg):
- scons.Builder.execute_actions = None
+ SCons.Builder.execute_actions = None
Option(func = opt_n,
short = 'n', long = ['no-exec', 'just-print', 'dry-run', 'recon'],
help = "Build dependencies in random order.")
def opt_s(opt, arg):
- scons.Builder.print_actions = None
+ SCons.Builder.print_actions = None
Option(func = opt_s,
short = 's', long = ['silent', 'quiet'],
# XXX The commented-out code here adds any "scons" subdirs in anything
# along sys.path to sys.path. This was an attempt at setting up things
- # so we can import "node.FS" instead of "scons.Node.FS". This doesn't
+ # so we can import "node.FS" instead of "SCons.Node.FS". This doesn't
# quite fit our testing methodology, though, so save it for now until
# the right solutions pops up.
#
sys.path = include_dirs + sys.path
# initialize node factory
- init()
+ SCons.Node.FS.init()
while Scripts:
file, Scripts = Scripts[0], Scripts[1:]
PrintUsage()
sys.exit(0)
- taskmaster = Taskmaster(map(lambda x: lookup(File, x), targets))
+ taskmaster = Taskmaster(map(
+ lambda x: SCons.Node.FS.lookup(SCons.Node.FS.File, x),
+ targets))
- jobs = scons.Job.Jobs(num_jobs, taskmaster)
+ jobs = SCons.Job.Jobs(num_jobs, taskmaster)
jobs.start()
jobs.wait()
author = "Steven Knight",
author_email = "knight@baldmt.com",
url = "http://www.baldmt.com/scons",
- packages = ["scons"],
scripts = ["scons.py"])
test = TestSCons.TestSCons(match = TestCmd.match_exact)
sconstruct = """
-from scons.exitfuncs import *
+from SCons.exitfuncs import *
def x1():
print "running x1"