Mercurial > projects > doodle
changeset 131:5920bb2ddd0f
Update configure/builder to dmd-2.059
author | David Bryant <bagnose@gmail.com> |
---|---|
date | Tue, 24 Apr 2012 21:44:20 +0930 |
parents | 1bc3475624d3 |
children | 9e1a313d8003 |
files | builder.d configure.d |
diffstat | 2 files changed, 39 insertions(+), 39 deletions(-) [+] |
line wrap: on
line diff
--- a/builder.d Thu Jan 12 18:20:58 2012 +1030 +++ b/builder.d Tue Apr 24 21:44:20 2012 +0930 @@ -125,8 +125,8 @@ if (!exists(path)) { return 0; } - getTimesPosix(path, fileStatusChangeTime, fileAccessTime, fileModificationTime); - return fileStatusChangeTime.stdTime; + getTimes(path, fileAccessTime, fileModificationTime); + return fileModificationTime.stdTime; } @@ -191,7 +191,7 @@ void parseForImport(char[] line) { static string[] leaders = ["private ", "public ", "static ", "import "]; bool found; - auto stripped = stripl(line); + auto stripped = stripLeft(line); if (stripped.length > 8) { foreach (i, leader ; leaders) { if (stripped[0..leader.length] == leader) { @@ -328,7 +328,7 @@ mTime = mPath.exists ? 1 : 0; // this directory depends on its parent directory chain - string parent_path = path.dirname; + string parent_path = path.dirName; if (parent_path.length > 0 && parent_path[0] != '.' && parent_path != "/") { Item* parent = parent_path in mItems; if (parent) { @@ -387,7 +387,7 @@ } // and all other group's higher-level groups until common ancestor - string other_parent_path = other.mPath.dirname; + string other_parent_path = other.mPath.dirName; if (other_parent_path != "." && other_parent_path.length < mPath.length && mPath[0..other_parent_path.length] != other_parent_path) @@ -420,7 +420,7 @@ group.addMember(this); // this file depends on on its parent directory - string parent_path = path.dirname; + string parent_path = path.dirName; Item* parent = parent_path in mItems; if (parent) { assert(cast(DirectoryItem *)parent); @@ -443,7 +443,7 @@ this(string path, GroupItem group) { super("source", path, group); - if (!isfile(path)) error(format("source file %s not found", path)); + if (!isFile(path)) error(format("source file %s not found", path)); } // set the object item @@ -519,7 +519,7 @@ foreach (path; Global.bundlePaths) { cmd.format(" -I%s", path); } - cmd.format(" -od%s %s", dirname(mPath), mSource.mPath); + cmd.format(" -od%s %s", dirName(mPath), mSource.mPath); cmd.format(" @%s", Global.optionsPath); if (std.process.system(cmd.str)) { @@ -601,7 +601,7 @@ writefln("Program %s", mPath); scope cmd = new StringFormatter(); - cmd.format("dmd -m32 -L-L%s", std.path.join(Global.buildPath, "lib")); + cmd.format("dmd -m32 -L-L%s", std.path.buildPath(Global.buildPath, "lib")); cmd.format(" -of%s %s", mPath, mObject.mPath); // add the libraries we need @@ -694,7 +694,7 @@ mParent = parent; if (parent.mName.length) { // child of non-root - mSlashName = parent.mSlashName ~ sep ~ mName; + mSlashName = parent.mSlashName ~ dirSeparator ~ mName; mDotName = parent.mDotName ~ "." ~ mName; } else { @@ -745,7 +745,7 @@ this(string name, string path, Node parent, GroupItem group) { super(name, parent); - string obj_path = std.path.join(Global.buildPath, "obj", mSlashName ~ ".o"); + string obj_path = buildPath(Global.buildPath, "obj", mSlashName ~ ".o"); mSource = new SourceItem(path, group); mObject = new ObjectItem(obj_path, mSource, group); mSource.set_object(mObject); @@ -812,11 +812,11 @@ this(string name, string path, Node parent, bool test, GroupItem group) { super(name, path, parent, group); if (test) { - mProgram = new ProgramItem(std.path.join(Global.buildPath, "test", mSlashName), mObject, group); - mResult = new ResultItem(std.path.join(Global.buildPath, "test", mSlashName ~ ".result"), mProgram, group); + mProgram = new ProgramItem(buildPath(Global.buildPath, "test", mSlashName), mObject, group); + mResult = new ResultItem(buildPath(Global.buildPath, "test", mSlashName ~ ".result"), mProgram, group); } else { - mProgram = new ProgramItem(std.path.join(Global.buildPath, "bin", mName), mObject, group); + mProgram = new ProgramItem(buildPath(Global.buildPath, "bin", mName), mObject, group); } setClump(mProgram); //writefln("loaded Program %s", mProgram.mPath); @@ -840,23 +840,23 @@ // examine all the children of the package's directory foreach (string child; listdir(path)) { - string p = std.path.join(path, child); + string p = buildPath(path, child); if (child[0] != '.') { - if (isfile(p)) { + if (isFile(p)) { if (child.length > 2 && child[$-2..$] == ".d") { // a library module if (!mLibrary) { - mLibrary = new LibraryItem(std.path.join(Global.buildPath, "lib", "lib" ~ lib_name ~ ".a"), + mLibrary = new LibraryItem(buildPath(Global.buildPath, "lib", "lib" ~ lib_name ~ ".a"), lib_name, mGroup); } - Module m = new Module(getName(child), p, this, mGroup); + Module m = new Module(stripExtension(child), p, this, mGroup); m.setClump(mLibrary); } } - else if (isdir(p)) { + else if (isDir(p)) { if (child == "build-tool") { // reserved for build-tool @@ -870,26 +870,26 @@ else if (child == "test") { // test programs foreach (string grandchild; listdir(p)) { - string p2 = std.path.join(p, grandchild); + string p2 = buildPath(p, grandchild); if (grandchild[0] != '.' && - isfile(p2) && + isFile(p2) && grandchild.length > 2 && grandchild[$-2..$] == ".d") { - Exe exe = new Exe(getName(grandchild), p2, this, true, mGroup); + Exe exe = new Exe(stripExtension(grandchild), p2, this, true, mGroup); } } } else if (child == "prog") { // deliverable programs foreach (string grandchild; listdir(p)) { - string p2 = std.path.join(p, grandchild); + string p2 = buildPath(p, grandchild); if (child[0] != '.' && - isfile(p2) && + isFile(p2) && grandchild.length > 2 && grandchild[$-2..$] == ".d") { - Exe exe = new Exe(getName(grandchild), p2, this, false, mGroup); + Exe exe = new Exe(stripExtension(grandchild), p2, this, false, mGroup); } } } @@ -950,17 +950,17 @@ // add path to Global for use when compiling Global.bundlePaths ~= path; - Global.optionsPath = std.path.join(path, "options"); + Global.optionsPath = buildPath(path, "options"); // // load bundles specified in the uses file - lines are bundle paths relative to path // - string uses_path = std.path.join(path, "uses"); - if (exists(uses_path) && isfile(uses_path)) { + string uses_path = buildPath(path, "uses"); + if (exists(uses_path) && isFile(uses_path)) { //writefln("reading uses file: %s", uses_path); scope file = new BufferedFile(uses_path); foreach (char[] line; file) { - load(std.path.join(path, line.idup)); + load(buildPath(path, line.idup)); } } @@ -969,8 +969,8 @@ // foreach (string name; listdir(path)) { if (name[0] != '.' && name != "nobuild") { - string p = std.path.join(path, name); - if (isdir(p)) { + string p = buildPath(path, name); + if (isDir(p)) { foreach (node; mChildren) { Product existing = cast(Product)node; if (existing && existing.mName == name) {
--- a/configure.d Thu Jan 12 18:20:58 2012 +1030 +++ b/configure.d Tue Apr 24 21:44:20 2012 +0930 @@ -46,7 +46,7 @@ // check that source_path looks like a source tree by making sure // that a README and options file are present writefln("Examining source"); - if (!std.path.join(sourcePath, "README").exists || !std.path.join(sourcePath, "options").exists) { + if (!std.path.buildPath(sourcePath, "README").exists || !std.path.buildPath(sourcePath, "options").exists) { writefln("Error - current directory must contain README and options"); return -1; } @@ -58,26 +58,26 @@ return -1; } targetPath.mkdirRecurse; - string binPath = std.path.join(targetPath, "bin"); + string binPath = std.path.buildPath(targetPath, "bin"); binPath.mkdir; // compile builder into bin_path writefln("Building the builder"); - int ret = system(format("dmd -m32 -w -wi %s -O -of%s", - std.path.join(sourcePath, "builder.d"), std.path.join(binPath, "builder"))); + int ret = system(format("dmd -m64 -w -wi %s -O -of%s", + std.path.buildPath(sourcePath, "builder.d"), std.path.buildPath(binPath, "builder"))); if (ret) { writefln("Error - builder failed to compile"); return -1; } - std.path.join(binPath, "builder.o").remove; + std.path.buildPath(binPath, "builder.o").remove; // set up scripts { - auto file = File(std.path.join(targetPath, "build"), "w"); + auto file = File(std.path.buildPath(targetPath, "build"), "w"); file.writefln("#!/bin/bash"); - file.writefln("%s %s %s", std.path.join(binPath, "builder"), sourcePath, targetPath); + file.writefln("%s %s %s", std.path.buildPath(binPath, "builder"), sourcePath, targetPath); } - system("chmod +x " ~ std.path.join(targetPath, "build")); + system("chmod +x " ~ std.path.buildPath(targetPath, "build")); writefln("All done"); return 0;