Permalink
Browse files

Added ChickenEgg, a wannabe egg builder. It still doesn't work, but I…

… get all the files that should be part of the egg.

darcs-hash:20051126044602-71b0c-2b74d63fb22f9d64f948c1bf7c3fd5640525cf8e.gz
  • Loading branch information...
1 parent ead5517 commit 3ca4a37170244986bb6c822a1edeba54a5929287 @pupeno committed Nov 26, 2005
Showing with 32 additions and 14 deletions.
  1. +2 −2 ChangeLog
  2. +1 −2 TODO
  3. +29 −10 chicken.py
View
@@ -1,6 +1,6 @@
0.2.0
- * Change of philosophy: now scons-chicken is more sconish, a bit less automatic, but much more better (supressed lot's of unexpected behaviours).
- * Don't re-compile everything; only what had changed.
+ * Change of philosophy: now scons-chicken is more sconish, a bit less automatic, but much better (supressed lot's of unexpected behaviours).
+ * Don't re-compile everything; only what changed.
* Added scanner (based on chicken-il, provided by scons-chicken as well) to recompile sources that include other files that have changed.
0.1.1
View
3 TODO
@@ -1,3 +1,2 @@
-- Make support for automatic generation of eggs.
-- Add the files to be on the directories, like the free software directory and all that.
+- Clean up for 0.2.0
- Release scons-chicken 0.2.0 when there's nothing else above this line.
View
@@ -36,10 +36,8 @@ def includedFiles(node, env, path):
name = "ChickenScanner",
skeys = [".scm"],
recursive = True)
-
- env.Append(SCANNERS = chickenScanner)
-
+ env.Append(SCANNERS = chickenScanner)
def ChickenSetup(target = None, source = None, env = None):
""" Function that works as a builder action wrapping chickenSetup. """
@@ -61,7 +59,7 @@ def ChickenSetup(target = None, source = None, env = None):
requires = env._dict["REQUIRES"]
else:
requires = []
-
+
# Open the .setup file for writing.
setupFile = open(str(target[0]), "w")
@@ -70,12 +68,12 @@ def ChickenSetup(target = None, source = None, env = None):
# Close it.
setupFile.close()
-
+
return None
env["BUILDERS"]["ChickenSetup"] = SCons.Builder.Builder(action = ChickenSetup,
suffix = ".setup")
-
+
def chickenSetup(files, documentation = None, syntax = False, requires = None):
""" This procedure works like a builder and it builds the .setup files.
Parameters:
@@ -105,16 +103,15 @@ def buildPath(item):
else:
print "Type not recognized to build .setup file."
return ""
-
-
+
l = "(" + head
-
+
if isinstance(items, list):
for i in items:
l += " \"" + buildPath(i) + "\" "
else:
l += " \"" + buildPath(items) + "\""
-
+
l += ")"
return l
@@ -143,6 +140,28 @@ def buildPath(item):
# Return the generated content.
return content
+ def ChickenEgg(target = None, source = None, env = None):
+ """ Build an egg. """
+
+ def getLeafSources(sources):
+ """ Get all the sources that are leafs, not branches. """
+ eggContents = list()
+ for source in sources:
+ if len(source.sources) == 0:
+ eggContents.append(source)
+ eggContents += source.get_found_includes(env, chickenScanner, source.path)
+ else:
+ eggContents += getLeafSources(source.sources)
+ return eggContents
+
+ eggContents = set(getLeafSources(source))
+ for egg in eggContents:
+ print str(egg)
+ return 0
+
+ env["BUILDERS"]["ChickenEgg"] = SCons.Builder.Builder(action = ChickenEgg,
+ suffix = '.egg')
+
def CheckChickenProgram(context):
""" Check if a Chicken program can be built and run. If not, try adding the libraries. """
context.Message("Checking for building Chicken programs... ")

0 comments on commit 3ca4a37

Please sign in to comment.