From 5babf3708ef7ab6bfece65bb9d230511075c083c Mon Sep 17 00:00:00 2001 From: Francisco Tolmasky Date: Sat, 6 Dec 2008 15:12:05 -0800 Subject: [PATCH] Fix for broken steam with new build system. Reviewed by me. --- Tools/nib2cib/build.xml | 4 ++-- Tools/steam/steam.js | 51 ++++++++++++++++++++++++++++------------- build.xml | 35 ++++++++++++++-------------- 3 files changed, 55 insertions(+), 35 deletions(-) diff --git a/Tools/nib2cib/build.xml b/Tools/nib2cib/build.xml index a0ee2ac25..81901c28a 100644 --- a/Tools/nib2cib/build.xml +++ b/Tools/nib2cib/build.xml @@ -20,8 +20,8 @@ - - + + diff --git a/Tools/steam/steam.js b/Tools/steam/steam.js index bf611542e..2792ebc14 100644 --- a/Tools/steam/steam.js +++ b/Tools/steam/steam.js @@ -382,30 +382,49 @@ function mainCreate() { if (arguments.length < 1) printUsage("create"); - - var dst = arguments[0], - link = arguments[1] == "-l"; + + var link = false, + index = 0, + count = arguments.length; - var srcNewApp = new File(OBJJ_HOME+"/lib/NewApplication"), - srcFrameworks = new File(OBJJ_HOME+"/lib/Frameworks"), - dstNewApp = new File(dst), - dstFrameworks = new File(dst+"/Frameworks"); - - System.out.println(srcNewApp.getCanonicalPath() + "," + dstNewApp.getCanonicalPath() + "," + srcFrameworks.getCanonicalPath() + "," + dstFrameworks.getCanonicalPath()); - - if (!dstNewApp.exists()) + for (; index < count; ++index) { - exec(["cp", "-vR", srcNewApp.getCanonicalPath(), dstNewApp.getCanonicalPath()], true); + var argument = arguments[index]; + + switch (arguments[index]) + { + case "-l": link = true; + break; + default: destination = argument; + } + } + + var sourceNewApplication = new File(OBJJ_HOME + "/lib/NewApplication"), + destinationNewApplication = new File(destination), + sourceFrameworks = new File(OBJJ_HOME + "/lib/Frameworks"), + sourceDebugFrameworks = new File(OBJJ_HOME + "/lib/Frameworks-Debug"), + destinationFrameworks = new File(destination + "/Frameworks"), + destinationDebugFrameworks = new File(destination + "/Frameworks-Debug"); + + System.out.println(sourceNewApplication.getCanonicalPath() + "," + destinationNewApplication.getCanonicalPath() + "," + sourceFrameworks.getCanonicalPath() + "," + destinationFrameworks.getCanonicalPath()); + + if (!destinationNewApplication.exists()) + { + exec(["cp", "-vR", sourceNewApplication.getCanonicalPath(), destinationNewApplication.getCanonicalPath()], true); if (!link) - exec(["cp", "-vR", srcFrameworks.getCanonicalPath(), dstFrameworks.getCanonicalPath()], true); + { + exec(["cp", "-vR", sourceDebugFrameworks.getCanonicalPath(), destinationDebugFrameworks.getCanonicalPath()], true); + exec(["cp", "-vR", sourceFrameworks.getCanonicalPath(), destinationFrameworks.getCanonicalPath()], true); + } else - exec(["ln", "-s", new File(System.getenv("STEAM_BUILD")+"/Release").getCanonicalPath(), dstFrameworks.getCanonicalPath()], true); + { + exec(["ln", "-s", new File(System.getenv("STEAM_BUILD") + "/Debug").getCanonicalPath(), destinationDebugFrameworks.getCanonicalPath()], true); + exec(["ln", "-s", new File(System.getenv("STEAM_BUILD") + "/Release").getCanonicalPath(), destinationFrameworks.getCanonicalPath()], true); + } } else - { System.out.println("Directory already exists"); - } } function mainBuild() diff --git a/build.xml b/build.xml index 5cc0a7925..c09eba2ad 100644 --- a/build.xml +++ b/build.xml @@ -194,22 +194,6 @@ - - - - - - - - - - - - - - - - @@ -267,9 +251,26 @@ - + + + + + + + + + + + + + + + + + +