From b22d1837becee59566e5ec27b9554f08027ae8b1 Mon Sep 17 00:00:00 2001 From: Francisco Tolmasky Date: Sun, 15 Mar 2009 02:54:09 -0700 Subject: [PATCH] Added cplutil to rake. Reviewed by me. --- Objective-J/Tools/rakefile | 2 +- Tools/cplutil/build.xml | 46 ----------------- Tools/cplutil/cplutil | 34 ------------ Tools/cplutil/cplutil.js | 103 ------------------------------------- 4 files changed, 1 insertion(+), 184 deletions(-) delete mode 100644 Tools/cplutil/build.xml delete mode 100644 Tools/cplutil/cplutil delete mode 100644 Tools/cplutil/cplutil.js diff --git a/Objective-J/Tools/rakefile b/Objective-J/Tools/rakefile index 9c0540866..caa3700a6 100644 --- a/Objective-J/Tools/rakefile +++ b/Objective-J/Tools/rakefile @@ -4,7 +4,7 @@ require 'rake' require '../../common' -subprojects = %w{objj objjc} +subprojects = %w{cplutil objj objjc} %w(build clean).each do |task_name| task task_name do diff --git a/Tools/cplutil/build.xml b/Tools/cplutil/build.xml deleted file mode 100644 index 39463c3d1..000000000 --- a/Tools/cplutil/build.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Tools/cplutil/cplutil b/Tools/cplutil/cplutil deleted file mode 100644 index db0767b56..000000000 --- a/Tools/cplutil/cplutil +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -# if OBJJ_HOME isn't set, try to determine it -if [ -z $OBJJ_HOME ]; then - # get path of the executable - SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && SELF_PATH=$SELF_PATH/$(basename -- "$0") - - # resolve symlinks - if [ -h $SELF_PATH ]; then - SELF_PATH=`readlink $SELF_PATH` - fi - - # get second ancestor directory - SELF_DIR=`dirname $SELF_PATH` - export OBJJ_HOME=`dirname $SELF_DIR` - - # check to ensure it exists, print message - if [ -d $OBJJ_HOME ]; then - echo "OBJJ_HOME not set, defaulting to $OBJJ_HOME" 1>&2 - else - echo "OBJJ_HOME not set, default at $OBJJ_HOME doesn't exist, exiting" 1>&2 - exit 2 - fi -fi - -OBJJ_LIB="$OBJJ_HOME/lib" -CLASSPATH="$OBJJ_LIB:$OBJJ_LIB/js.jar" - -# convert paths for Cygwin -if [[ `uname` == CYGWIN* ]]; then - CLASSPATH=`cygpath -wp "$CLASSPATH"` -fi - -java -classpath $CLASSPATH cplutil $@ diff --git a/Tools/cplutil/cplutil.js b/Tools/cplutil/cplutil.js deleted file mode 100644 index 455df7a0f..000000000 --- a/Tools/cplutil/cplutil.js +++ /dev/null @@ -1,103 +0,0 @@ - -importPackage(java.lang); - -importClass(java.io.File); -importClass(java.io.BufferedReader); -importClass(java.io.FileReader); -importClass(java.io.BufferedWriter); -importClass(java.io.FileWriter); - - -function printUsage() -{ - print("this is where you say the usage"); -} - -function main() -{ - if (arguments.length < 1) - return printUsage(); - - var allFiles = NO, - format = nil, - filePaths = [], - outPath = nil, - outExtension = nil; - - index = 0, - count = arguments.length; - - for (; index < count; ++index) - { - var argument = arguments[index]; - - if (argument.charAt(0) === '-' && !allFiles) - { - if (filePaths.length > 0) - return printUsage(); - - else if (argument === "-convert") - format = arguments[++index]; - - else if (argument === "-o") - outPath = arguments[++index]; - - else if (argument === "-e") - outExtension = arguments[++index]; - - else if (argument === "--") - allFiles = YES; - - else if (argument === "-help") - return printUsage(); - } - else - filePaths.push(arguments[index]); - } - - index = 0; - count = filePaths.length; - - for (; index < count; ++index) - { - // Read the plist file - var file = new File(filePaths[index]), - reader = new BufferedReader(new FileReader(file)), - fileContents = ""; - - // Get contents of the file - while (reader.ready()) - fileContents += reader.readLine() + '\n'; - - reader.close(); - - var data = new objj_data(); - - data.string = fileContents; - - var plistObject = new CPPropertyListCreateFromData(data); - - if (format === "280north1") - data = CPPropertyListCreate280NorthData(plistObject); - - else if (format === "xml1") - data = CPPropertyListCreateXMLData(plistObject); - - var outFile = file; - - if (outPath) - outFile = new File(outPath); - -// else if (outExtension) - - - // Write out file - var writer = new BufferedWriter(new FileWriter(outFile)); - - writer.write(data.string); - - writer.close(); - } -} - -main.apply(main, arguments);