diff --git a/default-package-info.json b/default-package-info.json deleted file mode 100644 index 12a03c45..00000000 --- a/default-package-info.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "author" : "CNMAT", - "authors" : ["John MacCallum", "Adrian Freed", "Rama Gottfried", "Ilya Rostovtsev" ], - "description" : "A library for OSC processing created by researchers at CNMAT in Berkeley, CA.", - "homepatcher" : "o.overview.maxpat", - "max_version_max" : "none", - "max_version_min" : "6.0", - "name" : "odot", - "os" : { - "macintosh" : { - "platform" : [ "x64" ], - "min_version" : "10.10.x" - } - , - "windows" : { - "platform" : [ "x64" ], - "min_version" : "7" - } - - }, - "package_extra" : { - "reverse_domain" : "edu.berkeley.cnmat", - "copyright" : "Copyright (c) 2007-21 UC Regents" - }, - "tags" : ["Open Sound Control (OSC)", "Dynamic Programming", "CNMAT" ], - "version" : "1.0.1....", - "website" : "https://github.com/CNMAT/CNMAT-odot", -} diff --git a/make-package-info.py b/make-package-info.py deleted file mode 100755 index ed3a7809..00000000 --- a/make-package-info.py +++ /dev/null @@ -1,40 +0,0 @@ -import json, os, subprocess, platform - -print "************************************************" - -#packagedirs=(clippings code default-definitions default-settings docs examples extensions externals extras help init interfaces java-classes java-doc javascript jsextensions jsui license.txt media misc patchers object-prototypes queries readme.txt source support templates) - - -def filesinfolder(n): - return [f for f in os.listdir(n) if not f.startswith('.')] - -with open('default-package-info.json', 'r') as f: - pinfo = json.load(f) - - # update the package listings - if (platform.system() == 'Darwin'): - pinfo['filelist']['externals'] = filesinfolder("externals") - else: - pinfo['filelist']['externals'] = os.listdir("src/build/Release") - - pinfo['filelist']['help'] = filesinfolder("help") - pinfo['filelist']['default-definitions'] = filesinfolder("default-definitions") - pinfo['filelist']['docs'] = filesinfolder("docs/refpages/odot_ref") - pinfo['filelist']['examples'] = filesinfolder("examples") - pinfo['filelist']['extras'] = filesinfolder("extras/odot-extras") - pinfo['filelist']['init'] = filesinfolder("init") - pinfo['filelist']['interfaces'] = filesinfolder("interfaces") - pinfo['filelist']['patchers'] = filesinfolder("patchers") - - pinfo['filelist']['dev'] = filesinfolder("dev") - - -#pinfo['filelist']['clippings'] = filesinfolder("clippings") -#pinfo['filelist']['misc'] = filesinfolder("misc") - - version = subprocess.check_output("git describe --tags --long", shell=True).strip() - branch = subprocess.check_output("git branch | egrep '^\*' | awk '{print $2}'", shell=True).strip() - pinfo['version'] = version+"-"+branch - - with open('package-info.json', 'w') as outf: - json.dump(pinfo, outf, indent=4) diff --git a/make-release.sh b/make-release.sh index aed871e2..1f65a19e 100755 --- a/make-release.sh +++ b/make-release.sh @@ -160,7 +160,7 @@ then fi echo "cleaning up release" -filestodelete=(".git" "src" "make-release.sh" "make-package-info.py" "dev-internal") +filestodelete=(".git" "src" "make-release.sh" "dev-internal") if [ $pd = 0 ] then filestodelete+=( "pd" ) @@ -171,3 +171,109 @@ do echo rm -rf "../${filename}/${filestodelete[$i]}" rm -rf "../${filename}/${filestodelete[$i]}" done + +openobj() { + echo "{" >> "$1" +} + +closeobj() { + echo "}" >> "$1" +} + +openlist() { + echo -n "[" >> "$1" +} + +closelist() { + echo -n "]" >> "$1" +} + +writelist() { + f="$1" + shift + n=$# + for ((i = 0; i < $n - 1; i++)) + do + echo -n "\"$1\"," >> "$f" + shift + done + echo -n "\"$1\"" >> "$f" +} + +writekey() { + echo -n "\"$2\" : " >> "$1" +} + +writesingleval() { + echo -n "\"$2\"" >> "$1" +} + +endentry() { + echo "," >> "$1" +} + +writesimpleentry() { + writekey "$1" "$2" + writesingleval "$1" "$3" + endentry "$1" +} + +writefinalentry() { + writekey "$1" "$2" + writesingleval "$1" "$3" + echo "" >> "$1" +} + +writelistentry() { + f="$1" + shift + writekey "$f" "$1" + shift + openlist "$f" + writelist "$f" "$@" + closelist "$f" + endentry "$f" +} + +writepackageinfo() { + f="package-info.json" + cd ../$filename + touch "$f" + openobj "$f" + writesimpleentry "$f" "author" "CNMAT" + writelistentry "$f" "authors" "John MacCallum" "Adrian Freed" "Rama Gottfried" "Ilya Rostovtsev" + writesimpleentry "$f" "description" "Dynamic programming environment for OSC in Max" + writesimpleentry "$f" "homepatcher" "o.overview.maxpat" + writesimpleentry "$f" "max_version_max" "none" + writesimpleentry "$f" "max_version_min" "6.0" + writesimpleentry "$f" "name" "odot" + + writekey "$f" "os" + openobj "$f" + writekey "$f" "macintosh" + openobj "$f" + writesimpleentry "$f" "platform" "x64" + writefinalentry "$f" "min_version" "10.10.0" + closeobj "$f" + endentry "$f" + writekey "$f" "windows" + openobj "$f" + writesimpleentry "$f" "platform" "x64" + writefinalentry "$f" "min_version" "7" + closeobj "$f" + closeobj "$f" + endentry "$f" + + writekey "$f" "package_extras" + openobj "$f" + writesimpleentry "$f" "reverse_domain" "edu.berkeley.cnmat" + writefinalentry "$f" "copyright" "Copyright (c) 2007-21 UC Regents" + closeobj "$f" + endentry "$f" + + writelistentry "$f" "tags" "Open Sound Control (OSC)" "Dynamic Programming" "CNMAT" + writesimpleentry "$f" "version" "$version" + writefinalentry "$f" "website" "https://github.com/CNMAT/CNMAT-odot" + closeobj "$f" +} +writepackageinfo