Browse Source

removed tools : haxedoc outdated, haxelib will be submodule, hxinst deprecated

Nicolas Cannasse 11 years ago
parent
commit
969e366f2b

+ 0 - 600
std/tools/haxedoc/HtmlPrinter.hx

@@ -1,600 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package tools.haxedoc;
-import haxe.rtti.CType;
-
-class HtmlPrinter {
-
-	static function loadTemplate() {
-		var hdata = try
-			// load in current local/web directory
-			sys.io.File.getContent(neko.Web.getCwd()+"template.xml")
-		catch( e : Dynamic ) try {
-			// load in haxe subdirectory (TODO : make it work on linux/osx)
-			var p = ~/[\/\\]/g.split(Sys.executablePath());
-			p.pop();
-			sys.io.File.getContent(p.join("/")+"/std/tools/template.xml");
-		} catch( e : Dynamic )
-			default_template;
-		return Xml.parse(hdata);
-	}
-
-	static var default_template = "<html><body><data/></body></html>";
-	static var template = loadTemplate();
-
-	public var baseUrl : String;
-	var indexUrl : String;
-	var fileExtension : String;
-	var curpackage : String;
-	var filters : List<String>;
-	var typeParams : TypeParams;
-
-	public function new( baseUrl, fileExtension, indexUrl ) {
-		this.baseUrl = baseUrl;
-		this.fileExtension = fileExtension;
-		this.indexUrl = indexUrl;
-		filters = new List();
-		typeParams = new Array();
-	}
-
-	public function find( t : TypeRoot, path : Array<String>, pos : Int ) {
-		var name = path[pos];
-		var pack = (pos != path.length - 1);
-		var def = null;
-		for( c in t )
-			switch( c ) {
-			case TPackage(pname,_,subs):
-				if( name == pname ) {
-					if( pack )
-						return find(subs,path,pos+1);
-					def = c;
-				}
-			default:
-				if( pack ) continue;
-				var inf = TypeApi.typeInfos(c);
-				if( inf.path.toLowerCase() == path.join(".") )
-					return c;
-			}
-		return def;
-	}
-
-
-	public dynamic function output(str) {
-		neko.Lib.print(str);
-	}
-
-	public function addFilter(f) {
-		filters.add(f);
-	}
-
-	public function print(str, ?params : Dynamic ) {
-		if( params != null )
-			for( f in Reflect.fields(params) )
-				str = StringTools.replace(str, "$"+f, Std.string(Reflect.field(params, f)));
-		output(str);
-	}
-
-	public function process(t) {
-		processHtml(t,template);
-	}
-
-	public function filtered( path : Path, isPackage : Bool ) {
-		if( isPackage && path == "Remoting" )
-			return true;
-		if( StringTools.endsWith(path,"__") )
-			return true;
-		if( filters.isEmpty() )
-			return false;
-		for( x in filters )
-			if( StringTools.startsWith(path,x) )
-				return false;
-		return true;
-	}
-
-	function makeUrl( url, text, css ) {
-		return "<a href=\"" + baseUrl + url + fileExtension + "\" class=\""+css+"\">"+text+"</a>";
-	}
-
-	function prefix( arr : Array<String>, path : String ) {
-		var arr = arr.copy();
-		for( i in 0...arr.length )
-			arr[i] = path + "." + arr[i];
-		return arr;
-	}
-
-	function makePathUrl( path : Path, css ) {
-		var p = path.split(".");
-		var name = p.pop();
-		var local = (p.join(".") == curpackage);
-		for( x in typeParams )
-			if( x == path )
-				return name;
-		p.push(name);
-		if( local )
-			return makeUrl(p.join("/"),name,css);
-		return makeUrl(p.join("/"),fmtpath(path),css);
-	}
-
-	function fmtpath(path : String) {
-		if( path.substr(0,7) == "flash8." )
-			return "flash."+path.substr(7);
-		var pack = path.split(".");
-		if( pack.length > 1 && pack[pack.length-2].charAt(0) == "_" ) {
-			pack.splice(-2,1);
-			path = pack.join(".");
-		}
-		return path;
-	}
-
-	public function processHtml(t,html : Xml) {
-		var ht = html.nodeType;
-		if( ht == Xml.Element ) {
-			if( html.nodeName == "data" ) {
-				processPage(t);
-				return;
-			}
-			if( !html.iterator().hasNext() ) {
-				print(html.toString());
-				return;
-			}
-			print("<");
-			print(html.nodeName);
-			for( k in html.attributes() )
-				print(" "+k+"=\""+html.get(k)+"\"");
-			print(">");
-			for( x in html )
-				processHtml(t,x);
-			print("</"+html.nodeName+">");
-		} else if( ht == Xml.Document )
-			for( x in html )
-				processHtml(t,x);
-		else
-			print(html.toString());
-	}
-
-	public function processPage(t) {
-		switch(t) {
-		case TPackage(p,_,list):
-			processPackage(p,list);
-		default:
-			var head = '<a href="#" onclick="javascript:history.back(-1); return false" class="index">Back</a> | '+makeUrl(indexUrl,"Index","index");
-			print(head);
-			var inf = TypeApi.typeInfos(t);
-			typeParams = prefix(inf.params,inf.path);
-			var p = inf.path.split(".");
-			p.pop();
-			curpackage = p.join(".");
-			switch(t) {
-			case TClassdecl(c): processClass(c);
-			case TEnumdecl(e): processEnum(e);
-			case TTypedecl(t): processTypedef(t);
-			case TAbstractdecl(a): processAbstract(a);
-			case TPackage(_,_,_): throw "ASSERT";
-			}
-			print(head);
-		}
-	}
-
-	function processPackage(name,list : Array<TypeTree> ) {
-		print('<ul class="entry">');
-		for( e in list ) {
-			switch e {
-			case TPackage(name,full,list):
-				if( filtered(full,true) )
-					continue;
-				var isPrivate = name.charAt(0) == "_";
-				if( !isPrivate ) {
-					var id = full.split(".").join("_");
-					print('<li><a href="#" class="package" onclick="return toggle(\'$id\')">$name</a><div id="$id" class="package_content">');
-				}
-				var old = curpackage;
-				curpackage = full;
-				processPackage(name,list);
-				curpackage = old;
-				if( !isPrivate )
-					print("</div></li>");
-			default:
-				var i = TypeApi.typeInfos(e);
-				if( i.isPrivate || i.path == "@Main" || filtered(i.path,false) )
-					continue;
-				print("<li>"+makePathUrl(i.path,"entry")+"</li>");
-			}
-		}
-		print("</ul>");
-	}
-
-	function processInfos(t : TypeInfos) {
-		if( t.module != null )
-			print('<div class="importmod">import ${t.module}</div>');
-		if( !t.platforms.isEmpty() ) {
-			print('<div class="platforms">Available in ');
-			display(t.platforms,output,", ");
-			print('</div>');
-		}
-		if( t.doc != null ) {
-			print('<div class="classdoc">');
-			processDoc(t.doc);
-			print('</div>');
-		}
-	}
-
-	function processClass(c : Classdef) {
-		print('<div class="classname">');
-		if( c.isExtern )
-			keyword("extern");
-		if( c.isPrivate )
-			keyword("private");
-		if( c.isInterface )
-			keyword("interface");
-		else
-			keyword("class");
-		print(fmtpath(c.path));
-		if( c.params.length != 0 ) {
-			print("&lt;");
-			print(c.params.join(", "));
-			print("&gt;");
-		}
-		print('</div>');
-		if( c.superClass != null ) {
-			print('<div class="extends">extends ');
-			processPath(c.superClass.path,c.superClass.params);
-			print('</div>');
-		}
-		for( i in c.interfaces ) {
-			print('<div class="implements">implements ');
-			processPath(i.path,i.params);
-			print('</div>');
-		}
-		if( c.tdynamic != null ) {
-			var d = new List();
-			d.add(c.tdynamic);
-			print('<div class="implements">implements ');
-			processPath("Dynamic",d);
-			print('</div>');
-		}
-		processInfos(c);
-		print('<dl>');
-		for( f in c.fields )
-			processClassField(c.platforms,f,false);
-		for( f in c.statics )
-			processClassField(c.platforms,f,true);
-		print('</dl>');
-	}
-
-	function processClassField(platforms : Platforms,f : ClassField,stat) {
-		if( !f.isPublic || f.isOverride )
-			return;
-		var oldParams = typeParams;
-		if( f.params != null )
-			typeParams = typeParams.concat(prefix(f.params,f.name));
-		print('<dt>');
-		if( stat ) keyword("static");
-		var isMethod = false;
-		var isInline = (f.get == RInline && f.set == RNo);
-		switch( f.type ) {
-		case CFunction(args,ret):
-			if( (f.get == RNormal && (f.set == RMethod || f.set == RDynamic)) || isInline ) {
-				isMethod = true;
-				if( f.set == RDynamic )
-					keyword("dynamic");
-				if( isInline )
-					keyword("inline");
-				keyword("function");
-				print(f.name);
-				if( f.params != null )
-					print("&lt;"+f.params.join(", ")+"&gt;");
-				print("(");
-				display(args,function(a) {
-					if( a.opt )
-						print("?");
-					if( a.name != null && a.name != "" ) {
-						print(a.name);
-						print(" : ");
-					}
-					processType(a.t);
-				},", ");
-				print(") : ");
-				processType(ret);
-			}
-		default:
-		}
-		if( !isMethod ) {
-			if( isInline )
-				keyword("inline");
-			keyword("var");
-			print(f.name);
-			if( !isInline && (f.get != RNormal || f.set != RNormal) )
-				print("("+rightsStr(f,true,f.get)+","+rightsStr(f,false,f.set)+")");
-			print(" : ");
-			processType(f.type);
-		}
-		if( f.platforms.length != platforms.length && f.platforms.length > 0 ) {
-			print('<div class="platforms">Available in ');
-			display(f.platforms,output,", ");
-			print('</div>');
-		}
-		print('</dt>');
-		print('<dd>');
-		processDoc(f.doc);
-		print('</dd>');
-		if( f.params != null )
-			typeParams = oldParams;
-	}
-
-	function processEnum(e : Enumdef) {
-		print('<div class="classname">');
-		if( e.isExtern )
-			keyword("extern");
-		if( e.isPrivate )
-			keyword("private");
-		keyword("enum");
-		print(fmtpath(e.path));
-		if( e.params.length != 0 ) {
-			print("&lt;");
-			print(e.params.join(", "));
-			print("&gt;");
-		}
-		print('</div>');
-		processInfos(e);
-		print('<dl>');
-		for( c in e.constructors ) {
-			print('<dt>');
-			print(c.name);
-			if( c.args != null ) {
-				print("(");
-				display(c.args,function(a) {
-					if( a.opt )
-						print("?");
-					print(a.name);
-					print(" : ");
-					processType(a.t);
-				},",");
-				print(")");
-			}
-			print("</dt>");
-			print("<dd>");
-			processDoc(c.doc);
-			print("</dd>");
-		}
-		print('</dl>');
-	}
-
-	function processAbstract( a : Abstractdef ) {
-		print('<div class="classname">');
-		if( a.isPrivate )
-			keyword("private");
-		keyword("abstract");
-		print(fmtpath(a.path));
-		if( a.params.length != 0 ) {
-			print("&lt;");
-			print(a.params.join(", "));
-			print("&gt;");
-		}
-		print('</div>');
-		processInfos(a);
-	}
-	
-	function processTypedef(t : Typedef) {
-		print('<div class="classname">');
-		if( t.isPrivate )
-			keyword("private");
-		keyword("typedef");
-		print(fmtpath(t.path));
-		if( t.params.length != 0 ) {
-			print("&lt;");
-			print(t.params.join(", "));
-			print("&gt;");
-		}
-		print('</div>');
-		processInfos(t);
-		if( t.platforms.length == 0 ) {
-			processTypedefType(t.type,t.platforms,t.platforms);
-			return;
-		}
-		var platforms = new List();
-		for( p in t.platforms )
-			platforms.add(p);
-		for( p in t.types.keys() ) {
-			var td = t.types.get(p);
-			var support = new List();
-			for( p2 in platforms )
-				if( TypeApi.typeEq(td,t.types.get(p2)) ) {
-					platforms.remove(p2);
-					support.add(p2);
-				}
-			if( support.length == 0 )
-				continue;
-			processTypedefType(td,t.platforms,support);
-		}
-	}
-
-	function processTypedefType(t,all:Platforms,platforms:Platforms) {
-		switch( t ) {
-		case CAnonymous(fields):
-			print('<dl>');
-			for( f in fields )
-				processClassField(all,f,false);
-			print('</dl>');
-		default:
-			if( all.length != platforms.length ) {
-				print('<div class="platforms">Defined in ');
-				display(platforms,output,", ");
-				print('</div>');
-			}
-			print('<div class="typedef">= ');
-			processType(t);
-			print('</div>');
-		}
-	}
-
-	function processPath( path : Path, ?params : List<CType> ) {
-		print(makePathUrl(path,"type"));
-		if( params != null && !params.isEmpty() ) {
-			print("&lt;");
-			var first = true;
-			for( t in params ) {
-				if( first ) first = false else print(", ");
-				processType(t);
-			}
-			print("&gt;");
-		}
-	}
-
-	function processType( t : CType ) {
-		switch( t ) {
-		case CUnknown:
-			print("Unknown");
-		case CEnum(path,params):
-			processPath(path,params);
-		case CClass(path,params):
-			processPath(path,params);
-		case CTypedef(path,params):
-			processPath(path,params);
-		case CAbstract(path,params):
-			processPath(path,params);
-		case CFunction(args,ret):
-			if( args.isEmpty() ) {
-				processPath("Void");
-				print(" -> ");
-			}
-			for( a in args ) {
-				if( a.opt )
-					print("?");
-				if( a.name != null && a.name != "" )
-					print(a.name+" : ");
-				processTypeFun(a.t,true);
-				print(" -> ");
-			}
-			processTypeFun(ret,false);
-		case CAnonymous(fields):
-			print("{ ");
-			display(fields,function(f) {
-				print(f.name+" : ");
-				processType(f.type);
-			},", ");
-			print("}");
-		case CDynamic(t):
-			if( t == null )
-				processPath("Dynamic");
-			else {
-				var l = new List();
-				l.add(t);
-				processPath("Dynamic",l);
-			}
-		}
-	}
-
-	function processTypeFun( t : CType, isArg ) {
-		var parent =  switch( t ) { case CFunction(_,_): true; case CEnum(n,_): isArg && n == "Void"; default : false; };
-		if( parent )
-			print("(");
-		processType(t);
-		if( parent )
-			print(")");
-	}
-
-	function rightsStr(f:ClassField,get,r) {
-		return switch(r) {
-		case RNormal: "default";
-		case RNo: "null";
-		case RCall(m): if( m == ((get?"get_":"set_")+f.name) ) "dynamic" else m;
-		case RMethod, RDynamic, RInline: throw "assert";
-		}
-	}
-
-	function keyword(w) {
-		print('<span class="kwd">'+w+' </span>');
-	}
-
-	function processDoc(doc : String) {
-		if( doc == null )
-			return;
-
-		// unixify line endings
-		doc = doc.split("\r\n").join("\n").split("\r").join("\n");
-
-		// trim stars
-		doc = ~/^([ \t]*)\*+/gm.replace(doc, "$1");
-		doc = ~/\**[ \t]*$/gm.replace(doc, "");
-
-		// process [] blocks
-		var rx = ~/\[/;
-		var tmp = new StringBuf();
-		var codes = new List();
-		while (rx.match(doc)) {
-			tmp.add( rx.matchedLeft() );
-
-			var code = rx.matchedRight();
-			var brackets = 1;
-			var i = 0;
-			while( i < code.length && brackets > 0 ) {
-				switch( code.charCodeAt(i++) ) {
-				case 91: brackets++;
-				case 93: brackets--;
-				}
-			}
-			doc = code.substr(i);
-			code = code.substr(0, i-1);
-			code = ~/&/g.replace(code, "&amp;");
-			code = ~/</g.replace(code, "&lt;");
-			code = ~/>/g.replace(code, "&gt;");
-			var tag = "##__code__"+codes.length+"##";
-			if( code.indexOf('\n') != -1 ) {
-				tmp.add("<pre>");
-				tmp.add(tag);
-				tmp.add("</pre>");
-				codes.add(code.split("\t").join("    "));
-			} else {
-				tmp.add("<code>");
-				tmp.add(tag);
-				tmp.add("</code>");
-				codes.add(code);
-			}
-		}
-		tmp.add(doc);
-
-		// separate into paragraphs
-		var parts = ~/\n[ \t]*\n/g.split(tmp.toString());
-		if( parts.length == 1 )
-			doc = parts[0];
-		else
-			doc = Lambda.map(parts,function(x) { return "<p>"+StringTools.trim(x)+"</p>"; }).join("\n");
-
-		// put back code parts
-		var i = 0;
-		for( c in codes )
-			doc = doc.split("##__code__"+(i++)+"##").join(c);
-		print(doc);
-	}
-
-	function display<T>( l : List<T>, f : T -> Void, sep : String ) {
-		var first = true;
-		for( x in l ) {
-			if( first )
-				first = false;
-			else
-				print(sep);
-			f(x);
-		}
-	}
-
-}

+ 0 - 153
std/tools/haxedoc/Main.hx

@@ -1,153 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package tools.haxedoc;
-import haxe.rtti.CType;
-
-class Main {
-
-	static var parser = new haxe.rtti.XmlParser();
-
-	static function loadFile(file,platform,?remap) {
-		var data = sys.io.File.getContent(neko.Web.getCwd()+file);
-		var x = Xml.parse(data).firstElement();
-		if( remap != null )
-			transformPackage(x,remap,platform);
-		parser.process(x,platform);
-	}
-
-	static function transformPackage( x : Xml, p1, p2 ) {
-		switch( x.nodeType ) {
-		case Xml.Element:
-			var p = x.get("path");
-			if( p != null && p.substr(0,6) == p1 + "." )
-				x.set("path",p2 + "." + p.substr(6));
-			for( x in x.elements() )
-				transformPackage(x,p1,p2);
-		default:
-		}
-	}
-
-	static function save(html : HtmlPrinter,x,file) {
-		var f = sys.io.File.write(file,true);
-		html.output = f.writeString;
-		html.process(x);
-		f.close();
-		neko.Lib.print(".");
-	}
-
-	static function generateEntry(html : HtmlPrinter,e,path) {
-		switch( e ) {
-		case TPackage(name,full,entries):
-			if( html.filtered(full,true) )
-				return;
-			var old = html.baseUrl;
-			html.baseUrl = "../"+html.baseUrl;
-			path += name + "/";
-			try sys.FileSystem.createDirectory(path) catch( e : Dynamic ) { }
-			for( e in entries )
-				generateEntry(html,e,path);
-			html.baseUrl = old;
-		default:
-			var inf = TypeApi.typeInfos(e);
-			if( html.filtered(inf.path,false) )
-				return;
-			var pack = inf.path.split(".");
-			var name = pack.pop();
-			save(html,e,path+name+".html");
-		}
-	}
-
-	static function generateAll(filters : List<String>) {
-		var html = new HtmlPrinter("content/",".html","../index");
-		for( f in filters )
-			html.addFilter(f);
-		save(html,TPackage("root","root",parser.root),"index.html");
-		html.baseUrl = "";
-		try sys.FileSystem.createDirectory("content") catch( e : Dynamic ) { }
-		for( e in parser.root )
-			generateEntry(html,e,"content/");
-	}
-
-	public static function main() {
-		if( neko.Web.isModNeko ) {
-			var h = neko.Web.getParams();
-			var dataFile = neko.Web.getCwd()+".data";
-			var data : TypeRoot = try neko.Lib.unserialize(sys.io.File.getBytes(dataFile)) catch( e : Dynamic ) null;
-			if( h.get("reload") != null || data == null ) {
-				var baseDir = "../data/media/";
-				loadFile(baseDir+"flash.xml","flash");
-				loadFile(baseDir+"flash9.xml","flash9","flash");
-				loadFile(baseDir+"neko.xml","neko");
-				loadFile(baseDir+"js.xml","js");
-				loadFile(baseDir+"php.xml","php");
-				parser.sort();
-				data = parser.root;
-				var bytes = neko.Lib.serialize(data);
-				var f = sys.io.File.write(dataFile,true);
-				f.write(bytes);
-				f.close();
-			}
-			var html = new HtmlPrinter("/api/","","");
-			var clname = h.get("class");
-			if( clname == "index" )
-				clname = null;
-			if( clname == null )
-				html.process(TPackage("root","root",data));
-			else {
-				var clpath = clname.toLowerCase().split("/").join(".").split(".");
-				var f = html.find(data,clpath,0);
-				if( f == null )
-					throw "Class not found : "+clpath.join(".");
-				html.process(f);
-			}
-		} else {
-			var filter = false;
-			var filters = new List();
-			var pf = null;
-			for( x in Sys.args() ) {
-				if( x == "-f" )
-					filter = true;
-				else if( x == "-v" )
-					parser.newField = function(c,f) {
-						if( f.isPublic && !f.isOverride && !c.isPrivate )
-							Sys.println("[API INCOMPATIBILITY] "+c.path+"."+f.name+" ["+pf+"]");
-					};
-				else if( filter ) {
-					filters.add(x);
-					filter = false;
-				} else {
-					var f = x.split(";");
-					pf = f[1];
-					loadFile(f[0],f[1],f[2]);
-				}
-			}
-			parser.sort();
-			if( parser.root.length == 0 ) {
-				Sys.println("Haxe Doc Generator 2.0 - (c)2006-2012 Haxe Foundation");
-				Sys.println(" Usage : haxedoc [xml files] [-f filter]");
-				Sys.exit(1);
-			}
-			generateAll(filters);
-		}
-	}
-
-}

+ 0 - 3
std/tools/haxedoc/haxedoc.hxml

@@ -1,3 +0,0 @@
--neko haxedoc.n
--main tools.haxedoc.Main
--cmd "nekotools boot haxedoc.n"

+ 0 - 51
std/tools/haxedoc/haxedoc.hxproj

@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="haxedoc.n" />
-    <movie fps="30" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="1" />
-    <movie minorVersion="0" />
-    <movie platform="Neko" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option mainClass="tools.haxedoc.Main" />
-    <option enabledebug="False" />
-    <option additional="-D haxe3&#xA;-cmd nekotools boot haxedoc.n" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <!-- example: <hidden path="..." /> -->
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="Unknown" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 2
std/tools/haxedoc/haxedoc.sh

@@ -1,2 +0,0 @@
-#!/bin/sh
-exec haxe --run tools.haxedoc.Main "$@"

+ 0 - 121
std/tools/haxedoc/template.xml

@@ -1,121 +0,0 @@
-<html>
-
-<head>
-<title>Haxe API Documentation</title>
-
-<script type="text/javascript">
-<!--
-	function toggle(id) {
-		var e = document.getElementById(id);
-		e.isopen = !e.isopen;
-		e.style.display = e.isopen?"block":"none";
-		return false;
-	}
--->
-</script>
-
-<style type="text/css">
-body {
-	text-align: center;
-	font-family: Trebuchet MS, sans-serif;
-	background-color : #7D7E86;
-}
-
-.document {
-	width : 800px;
-	position : relative;
-	margin : 10px auto 5px auto;
-	border : solid 2px #CFD0D4;
-	text-align : justify;
-	background-color: #F6FAFD;
-}
-
-.title {
-	font-size: 35;
-	font-weight: bold;
-	text-align: center;
-	background-color : #FFD473;
-	color : white;
-}
-
-ul.entry {
-	list-style-type: circle;
-	font-weight : bold;
-	margin-left : 30px;
-}
-
-.package_content {
-	display : none;
-}
-
-a {
-	color : #FFBB00;
-	font-weight : bold;
-	text-decoration : none;
-}
-
-a:hover {
-	color : #FFAE00;
-	text-decoration : underline;
-}
-
-a.package {
-	color : black;
-}
-
-.index {
-	margin-left : 10px;
-}
-
-.kwd {
-	color : #00A;
-}
-
-.classname {
-	font-size : 30;
-	font-weight : bold;
-	margin-left : 10px;
-	margin-bottom : 20px;
-}
-
-.classdoc {
-	border : 1px dashed #666;
-	margin-left : 20px;
-	margin-right : 20px;
-	padding : 5 5 5 5;
-}
-
-.importmod, .extends, .implements, .typedef, .platforms {
-	margin-left: 20px;
-	color : #777;
-}
-
-dd {
-	margin : 0 20 20 40;
-	font-size : 12pt;
-	color : #444;
-}
-
-dt {
-	margin-left : 20px;
-	margin-bottom : 5px;
-	text-align : left;
-	font-size : 10pt;
-	font-family: Courier New, monospace;
-}
-
-</style>
-
-</head>
-
-<body>
-
-<div class="document">
-<div class="title">Haxe API Documentation</div>
-
-<data/>
-
-</div>
-
-</body>
-</html>

+ 0 - 190
std/tools/haxelib/Data.hx

@@ -1,190 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package tools.haxelib;
-import haxe.zip.Reader;
-import haxe.zip.Entry;
-import haxe.Json;
-using StringTools;
-
-typedef UserInfos = {
-	var name : String;
-	var fullname : String;
-	var email : String;
-	var projects : Array<String>;
-}
-
-typedef VersionInfos = {
-	var date : String;
-	var name : String;
-	var comments : String;
-}
-
-typedef ProjectInfos = {
-	var name : String;
-	var desc : String;
-	var website : String;
-	var owner : String;
-	var license : String;
-	var curversion : String;
-	var versions : Array<VersionInfos>;
-	var tags : List<String>;
-}
-
-typedef Infos = {
-	var project : String;
-	var website : String;
-	var desc : String;
-	var license : String;
-	var version : String;
-	var versionComments : String;
-	var developers : List<String>;
-	var tags : List<String>;
-	var dependencies : List<{ project : String, version : String }>;
-}
-
-class Data {
-
-	public static var JSON = "haxelib.json";
-	public static var DOCXML = "haxedoc.xml";
-	public static var REPOSITORY = "files/3.0";
-	public static var alphanum = ~/^[A-Za-z0-9_.-]+$/;
-	static var LICENSES = ["GPL","LGPL","BSD","Public","MIT"];
-	static var RESERVED_NAMES = ["haxe","all"];
-
-	public static function safe( name : String ) {
-		if( !alphanum.match(name) )
-			throw "Invalid parameter : "+name;
-		return name.split(".").join(",");
-	}
-
-	public static function unsafe( name : String ) {
-		return name.split(",").join(".");
-	}
-
-	public static function fileName( lib : String, ver : String ) {
-		return safe(lib)+"-"+safe(ver)+".zip";
-	}
-
-	public static function locateBasePath( zip : List<Entry> ) {
-		for( f in zip ) {
-			if( StringTools.endsWith(f.fileName,JSON) ) {
-				return f.fileName.substr(0,f.fileName.length - JSON.length);
-			}
-		}
-		throw "No "+JSON+" found";
-	}
-
-	public static function readDoc( zip : List<Entry> ) : String {
-		for( f in zip )
-			if( StringTools.endsWith(f.fileName,DOCXML) )
-				return Reader.unzip(f).toString();
-		return null;
-	}
-
-	public static function readInfos( zip : List<Entry>, check : Bool ) : Infos {
-		var infodata = null;
-		for( f in zip )
-			if( StringTools.endsWith(f.fileName,JSON) ) {
-				infodata = Reader.unzip(f).toString();
-				break;
-			}
-		if( infodata == null )
-			throw JSON + " not found in package";
-		
-		return readData(infodata,check);
-	}
-
-	static function doCheck( doc : Dynamic ) {
-		var libName = doc.name.toLowerCase();
-		if ( Lambda.indexOf(RESERVED_NAMES, libName) > -1 )
-			throw 'Library name "${doc.name}" is reserved.  Please choose another name';
-		if ( libName.endsWith(".zip") )
-			throw 'Library name cannot end in ".zip".  Please choose another name';
-		if ( libName.endsWith(".hxml") )
-			throw 'Library name cannot end in ".hxml".  Please choose another name';
-		if( Lambda.indexOf(LICENSES, doc.license) == -1 )
-			throw "License must be one of the following: " + LICENSES;
-		switch Type.typeof(doc.contributors) {
-			case TNull: throw "At least one contributor must be included";
-			//case TClass(String): doc.contributors = [doc.contributors];
-			case TClass(Array):
-			default: throw 'invalid type for contributors';
-		}
-		switch Type.typeof(doc.version) {
-			case TClass(String):
-				SemVer.ofString(doc.version);
-			default: throw 'version must be defined as string';
-		}
-		switch Type.typeof(doc.tags) {
-			case TClass(Array), TNull:
-			default: throw 'tags must be defined as array';
-		}
-		switch Type.typeof(doc.dependencies) {
-			case TObject, TNull:
-			default: throw 'dependencies must be defined as object';
-		}
-		switch Type.typeof(doc.releasenote) {
-			case TClass(String):
-			case TNull: throw 'no releasenote specified';
-			default: throw 'releasenote should be string';
-		}
-	}
-
-	public static function readData( jsondata: String, check : Bool ) : Infos {
-		var doc = try Json.parse(jsondata) catch( e : Dynamic ) throw "Error in JSON data : " + e;
-		if( check )
-			doCheck(doc);
-		var project:String = doc.name;
-		if( project.length < 3 )
-			throw "Project name must contain at least 3 characters";
-		var tags = new List();
-		if( doc.tags != null) {
-			var tagsArray:Array<String> = doc.tags;
-			for( t in tagsArray )
-				tags.add(t);
-		}
-		var devs = new List();
-		var developers:Array<String> = doc.contributors;
-		
-		for( d in developers )
-			devs.add(d);
-		var deps = new List();
-		if( doc.dependencies != null ) {
-			for( d in Reflect.fields(doc.dependencies) ) {
-				deps.add({ project: d, version: Std.string(Reflect.field(doc.dependencies, d)) });
-			}
-		}
-		
-		return {
-			project : project,
-			website : doc.url,
-			desc : doc.description,
-			version : doc.version,
-			versionComments : doc.releasenote,
-			license : doc.license,
-			tags : tags,
-			developers : devs,
-			dependencies : deps
-		};
-	}
-
-}

+ 0 - 1295
std/tools/haxelib/Main.hx

@@ -1,1295 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package tools.haxelib;
-
-import haxe.crypto.Md5;
-import haxe.*;
-import haxe.io.Path;
-import haxe.zip.Reader;
-import tools.haxelib.Data;
-import sys.FileSystem;
-import sys.io.*;
-import haxe.ds.Option;
-
-using StringTools;
-
-enum Answer {
-	Yes;
-	No;
-	Always;
-}
-
-class SiteProxy extends haxe.remoting.Proxy<tools.haxelib.SiteApi> {
-}
-
-class Progress extends haxe.io.Output {
-
-	var o : haxe.io.Output;
-	var cur : Int;
-	var max : Int;
-	var start : Float;
-
-	public function new(o) {
-		this.o = o;
-		cur = 0;
-		start = Timer.stamp();
-	}
-
-	function bytes(n) {
-		cur += n;
-		if( max == null )
-			Sys.print(cur+" bytes\r");
-		else
-			Sys.print(cur+"/"+max+" ("+Std.int((cur*100.0)/max)+"%)\r");
-	}
-
-	public override function writeByte(c) {
-		o.writeByte(c);
-		bytes(1);
-	}
-
-	public override function writeBytes(s,p,l) {
-		var r = o.writeBytes(s,p,l);
-		bytes(r);
-		return r;
-	}
-
-	public override function close() {
-		super.close();
-		o.close();
-		var time = Timer.stamp() - start;
-		var speed = (cur / time) / 1024;
-		time = Std.int(time * 10) / 10;
-		speed = Std.int(speed * 10) / 10;
-		Sys.print("Download complete : "+cur+" bytes in "+time+"s ("+speed+"KB/s)\n");
-	}
-
-	public override function prepare(m) {
-		max = m;
-	}
-
-}
-
-class ProgressIn extends haxe.io.Input {
-
-	var i : haxe.io.Input;
-	var pos : Int;
-	var tot : Int;
-
-	public function new( i, tot ) {
-		this.i = i;
-		this.pos = 0;
-		this.tot = tot;
-	}
-
-	public override function readByte() {
-		var c = i.readByte();
-		doRead(1);
-		return c;
-	}
-
-	public override function readBytes(buf,pos,len) {
-		var k = i.readBytes(buf,pos,len);
-		doRead(k);
-		return k;
-	}
-
-	function doRead( nbytes : Int ) {
-		pos += nbytes;
-		Sys.print( Std.int((pos * 100.0) / tot) + "%\r" );
-	}
-
-}
-
-class Main {
-
-	static var VERSION = SemVer.ofString('3.0.0');
-	static var REPNAME = "lib";
-	static var SERVER = {
-		host : "lib.haxe.org",
-		port : 80,
-		dir : "",
-		url : "index.n",
-		apiVersion : VERSION.major+"."+VERSION.minor,
-	};
-
-	var argcur : Int;
-	var args : Array<String>;
-	var commands : List<{ name : String, doc : String, f : Void -> Void, net : Bool }>;
-	var siteUrl : String;
-	var site : SiteProxy;
-
-	function new() {
-		args = Sys.args();
-		commands = new List();
-		addCommand("install", install, "install a given library, or all libraries from a hxml file");
-		addCommand("list", list, "list all installed libraries", false);
-		addCommand("upgrade", upgrade, "upgrade all installed libraries");
-		addCommand("update", update, "update a single library");
-		addCommand("selfupdate", updateSelf, "update haxelib itself");
-		addCommand("remove", remove, "remove a given library/version", false);
-		addCommand("set", set, "set the current version for a library", false);
-		addCommand("search", search, "list libraries matching a word");
-		addCommand("info", info, "list informations on a given library");
-		addCommand("user", user, "list informations on a given user");
-		addCommand("register", register, "register a new user");
-		addCommand("submit", submit, "submit or update a library package");
-		addCommand("setup", setup, "set the haxelib repository path", false);
-		addCommand("convertxml", convertXml, "convert haxelib.xml file to haxelib.json");
-		addCommand("config", config, "print the repository path", false);
-		addCommand("path", path, "give paths to libraries", false);
-		addCommand("run", run, "run the specified library with parameters", false);
-		addCommand("local", local, "install the specified package locally", false);
-		addCommand("dev", dev, "set the development directory for a given library", false);
-		addCommand("git", git, "uses git repository as library");
-		addCommand("proxy", proxy, "setup the Http proxy");
-		initSite();
-	}
-	
-	
-
-	function initSite() {
-		siteUrl = "http://" + SERVER.host + ":" + SERVER.port + "/" + SERVER.dir;
-		site = new SiteProxy(haxe.remoting.HttpConnection.urlConnect(siteUrl + "api/" + SERVER.apiVersion + "/" + SERVER.url).api);
-	}
-
-	function param( name, ?passwd ) {
-		if( args.length > argcur )
-			return args[argcur++];
-		Sys.print(name+" : ");
-		if( passwd ) {
-			var s = new StringBuf();
-			do switch Sys.getChar(false) {
-				case 10, 13: break;
-				case c: s.addChar(c);
-			}
-			while (true);
-			print("");
-			return s.toString();
-		}
-		return Sys.stdin().readLine();
-	}
-
-	function ask( question ) {
-		while( true ) {
-			Sys.print(question+" [y/n/a] ? ");
-			switch( Sys.stdin().readLine() ) {
-			case "n": return No;
-			case "y": return Yes;
-			case "a": return Always;
-			}
-		}
-		return null;
-	}
-
-	function paramOpt() {
-		if( args.length > argcur )
-			return args[argcur++];
-		return null;
-	}
-
-	function addCommand( name, f, doc, ?net = true ) {
-		commands.add({ name : name, doc : doc, f : f, net : net });
-	}
-
-	function usage() {
-		print("Haxe Library Manager " + VERSION + " - (c)2006-2013 Haxe Foundation");
-		print(" Usage : haxelib [command] [options]");
-		print(" Commands :");
-		for( c in commands )
-			print("  "+c.name+" : "+c.doc);
-		Sys.exit(1);
-	}
-
-	function process() {
-		var debug = false;
-		argcur = 0;
-		while( true ) {
-			var a = args[argcur++];
-			if( a == null )
-				break;
-			switch( a ) {
-			case "-debug":
-				debug = true;
-			case "-notimeout":
-				haxe.remoting.HttpConnection.TIMEOUT = 0;
-			case "-R":
-				var path = args[argcur++];
-				var r = ~/^(http:\/\/)?([^:\/]+)(:[0-9]+)?\/?(.*)$/;
-				if( !r.match(path) )
-					throw "Invalid repository format '"+path+"'";
-				SERVER.host = r.matched(2);
-				if( r.matched(3) != null )
-					SERVER.port = Std.parseInt(r.matched(3).substr(1));
-				SERVER.dir = r.matched(4);
-				initSite();
-			default:
-				argcur--;
-				break;
-			}
-		}
-		var cmd = args[argcur++];
-		if( cmd == null )
-			usage();
-		for( c in commands )
-			if( c.name == cmd ) {
-				try {
-					if( c.net ) loadProxy();
-					c.f();
-				} catch( e : Dynamic ) {
-					if( e == "std@host_resolve" ) {
-						print("Host "+SERVER.host+" was not found");
-						print("Please ensure that your internet connection is on");
-						print("If you don't have an internet connection or if you are behing a proxy");
-						print("please download manually the file from http://lib.haxe.org/files/3.0/");
-						print("and run 'haxelib local <file>' to install the Library.");
-						print("You can also setup the proxy with 'haxelib proxy'.");
-						Sys.exit(1);
-					}
-					if( e == "Blocked" ) {
-						print("Http connection timeout. Try running haxelib -notimeout <command> to disable timeout");
-						Sys.exit(1);
-					}
-					if( debug )
-						neko.Lib.rethrow(e);
-					print(Std.string(e));
-					Sys.exit(1);
-				}
-				return;
-			}
-		print("Unknown command "+cmd);
-		usage();
-	}
-
-	// ---- COMMANDS --------------------
-
- 	function search() {
-		var word = param("Search word");
-		var l = site.search(word);
-		for( s in l )
-			print(s.name);
-		print(l.length+" libraries found");
-	}
-
-	function info() {
-		var prj = param("Library name");
-		var inf = site.infos(prj);
-		print("Name: "+inf.name);
-		print("Tags: "+inf.tags.join(", "));
-		print("Desc: "+inf.desc);
-		print("Website: "+inf.website);
-		print("License: "+inf.license);
-		print("Owner: "+inf.owner);
-		print("Version: "+inf.curversion);
-		print("Releases: ");
-		if( inf.versions.length == 0 )
-			print("  (no version released yet)");
-		for( v in inf.versions )
-			print("   "+v.date+" "+v.name+" : "+v.comments);
-	}
-
-	function user() {
-		var uname = param("User name");
-		var inf = site.user(uname);
-		print("Id: "+inf.name);
-		print("Name: "+inf.fullname);
-		print("Mail: "+inf.email);
-		print("Libraries: ");
-		if( inf.projects.length == 0 )
-			print("  (no libraries)");
-		for( p in inf.projects )
-			print("  "+p);
-	}
-
-	function register() {
-		doRegister(param("User"));
-		print("Registration successful");
-	}
-
-	function doRegister(name) {
-		var email = param("Email");
-		var fullname = param("Fullname");
-		var pass = param("Password",true);
-		var pass2 = param("Confirm",true);
-		if( pass != pass2 )
-			throw "Password does not match";
-		pass = Md5.encode(pass);
-		site.register(name,pass,email,fullname);
-		return pass;
-	}
-
-	function submit() {
-		var file = param("Package");
-		var data = File.getBytes(file);
-		var zip = Reader.readZip(new haxe.io.BytesInput(data));
-		var infos = Data.readInfos(zip,true);
-		var user = infos.developers.first();
-		var password;
-		if( site.isNewUser(user) ) {
-			print("This is your first submission as '"+user+"'");
-			print("Please enter the following informations for registration");
-			password = doRegister(user);
-		} else {
-			if( infos.developers.length > 1 )
-				user = param("User");
-			password = Md5.encode(param("Password",true));
-			if( !site.checkPassword(user,password) )
-				throw "Invalid password for "+user;
-		}
-		site.checkDeveloper(infos.project,user);
-
-		// check dependencies validity
-		for( d in infos.dependencies ) {
-			var infos = site.infos(d.project);
-			if( d.version == "" )
-				continue;
-			var found = false;
-			for( v in infos.versions )
-				if( v.name == d.version ) {
-					found = true;
-					break;
-				}
-			if( !found )
-				throw "Library "+d.project+" does not have version "+d.version;
-		}
-
-		// check if this version already exists
-
-		var sinfos = try site.infos(infos.project) catch( _ : Dynamic ) null;
-		if( sinfos != null )
-			for( v in sinfos.versions )
-				if( v.name == infos.version.toString() && ask("You're about to overwrite existing version '"+v.name+"', please confirm") == No )
-					throw "Aborted";
-
-		// query a submit id that will identify the file
-		var id = site.getSubmitId();
-
-		// directly send the file data over Http
-		var h = new Http("http://"+SERVER.host+":"+SERVER.port+"/"+SERVER.url);
-		h.onError = function(e) { throw e; };
-		h.onData = print;
-		h.fileTransfert("file",id,new ProgressIn(new haxe.io.BytesInput(data),data.length),data.length);
-		print("Sending data.... ");
-		h.request(true);
-
-		// processing might take some time, make sure we wait
-		print("Processing file.... ");
-		haxe.remoting.HttpConnection.TIMEOUT = 1000;
-		// ask the server to register the sent file
-		var msg = site.processSubmit(id,user,password);
-		print(msg);
-	}
-
-	function install() {
-		var prj = param("Library name or hxml file:");
-
-		// No library given, install libraries listed in *.hxml in given directory
-		if( prj == "all")
-		{
-			installFromAllHxml();
-			return;
-		}
-
-		if( sys.FileSystem.exists(prj) && !sys.FileSystem.isDirectory(prj) ) {
-			// *.hxml provided, install all libraries/versions in this hxml file
-			if( prj.endsWith(".hxml") )
-			{
-				installFromHxml(prj);
-				return;
-			}
-			// *.zip provided, install zip as haxe library
-			if( prj.endsWith(".zip") )
-			{
-				doInstallFile(prj,true,true);
-				return;
-			}
-		}
-
-		// Name provided that wasn't a local hxml or zip, so try to install it from server
-		var inf = site.infos(prj);
-		var reqversion = paramOpt();
-		var version = getVersion(inf, reqversion);
-		doInstall(inf.name,version,version == inf.curversion);
-	}
-
-	function getVersion( inf:ProjectInfos, ?reqversion:String )
-	{
-		if( inf.curversion == null )
-			throw "The library "+inf.name+" has not yet released a version";
-		var version = if( reqversion != null ) reqversion else inf.curversion;
-		var found = false;
-		for( v in inf.versions )
-			if( v.name == version ) {
-				found = true;
-				break;
-			}
-		if( !found )
-			throw "No such version "+version+" for library "+inf.name;
-		
-		return version;
-	}
-
-	function installFromHxml( path )
-	{
-		var hxml = sys.io.File.getContent(path);
-		var lines = hxml.split("\n");
-
-		var libsToInstall = new Map<String, {name:String,version:String}>();
-		for (l in lines)
-		{
-			l = l.trim();
-			if (l.startsWith("-lib"))
-			{
-				var key = l.substr(5);
-				var parts = key.split(":");
-				var libName = parts[0].trim();
-				var libVersion = if (parts.length > 1) parts[1].trim() else null;
-
-				if (libsToInstall.exists(key) == false)
-				{
-					libsToInstall.set(key, { name:libName, version:libVersion });
-				}
-			}
-		}
-		installMany(libsToInstall);
-	}
-
-	function installFromAllHxml()
-	{
-		var hxmlFiles = sys.FileSystem.readDirectory(Sys.getCwd()).filter(function (f) return f.endsWith(".hxml"));
-		if (hxmlFiles.length > 0)
-		{
-			for (file in hxmlFiles)
-			{
-				if (file.endsWith(".hxml"))
-				{
-					print('Installing all libraries from $file:');
-					installFromHxml(Sys.getCwd()+file);
-				}
-			}
-		}
-		else 
-		{
-			print ("No hxml files found in the current directory.");
-		}
-	}
-
-	function installMany( libs:Iterable<{name:String,version:String}>, ?setCurrent=true )
-	{
-		if (Lambda.count(libs) == 0) return;
-
-		// Check the version numbers are all good
-		// TODO: can we collapse this into a single API call?  It's getting too slow otherwise.
-		print("Loading info about the required libraries");
-		for (l in libs)
-		{
-			var inf = site.infos(l.name);
-			l.version = getVersion(inf, l.version);
-		}
-
-		// Print a list with all the info
-		print("Haxelib is going to install these libraries:");
-		for (l in libs)
-		{
-			var vString = (l.version == null) ? "" : " - " + l.version;
-			print("  " + l.name + vString);
-		}
-
-		// Install if they confirm
-		if (ask("Continue?") != No)
-		{
-			for (l in libs)
-			{
-				doInstall(l.name, l.version, setCurrent);
-			}
-		}
-	}
-
-	function doInstall( project, version, setcurrent ) {
-		var rep = getRepository();
-
-		// check if exists already
-		if( FileSystem.exists(rep+Data.safe(project)+"/"+Data.safe(version)) ) {
-			print("You already have "+project+" version "+version+" installed");
-			setCurrent(project,version,true);
-			return;
-		}
-
-		// download to temporary file
-		var filename = Data.fileName(project,version);
-		var filepath = rep+filename;
-		var out = File.write(filepath,true);
-		var progress = new Progress(out);
-		var h = new Http(siteUrl+Data.REPOSITORY+"/"+filename);
-		h.onError = function(e) {
-			progress.close();
-			FileSystem.deleteFile(filepath);
-			throw e;
-		};
-		print("Downloading "+filename+"...");
-		h.customRequest(false,progress);
-
-		doInstallFile(filepath, setcurrent);
-		site.postInstall(project, version);
-	}
-
-	function doInstallFile(filepath,setcurrent,?nodelete) {
-		// read zip content
-		var f = File.read(filepath,true);
-		var zip = Reader.readZip(f);
-		f.close();
-		var infos = Data.readInfos(zip,false);
-		// create directories
-		var pdir = getRepository() + Data.safe(infos.project);
-		safeDir(pdir);
-		pdir += "/";
-		var target = pdir + Data.safe(infos.version.toString());
-		safeDir(target);
-		target += "/";
-
-		// locate haxelib.json base path
-		var basepath = Data.locateBasePath(zip);
-
-		// unzip content
-		for( zipfile in zip ) {
-			var n = zipfile.fileName;
-			if( n.startsWith(basepath) ) {
-				// remove basepath
-				n = n.substr(basepath.length,n.length-basepath.length);
-				if( n.charAt(0) == "/" || n.charAt(0) == "\\" || n.split("..").length > 1 )
-					throw "Invalid filename : "+n;
-				var dirs = ~/[\/\\]/g.split(n);
-				var path = "";
-				var file = dirs.pop();
-				for( d in dirs ) {
-					path += d;
-					safeDir(target+path);
-					path += "/";
-				}
-				if( file == "" ) {
-					if( path != "" ) print("  Created "+path);
-					continue; // was just a directory
-				}
-				path += file;
-				print("  Install "+path);
-				var data = Reader.unzip(zipfile);
-				File.saveBytes(target+path,data);
-			}
-		}
-
-		// set current version
-		if( setcurrent || !FileSystem.exists(pdir+".current") ) {
-			File.saveContent(pdir + ".current", infos.version.toString());
-			print("  Current version is now "+infos.version);
-		}
-
-		// end
-		if( !nodelete )
-			FileSystem.deleteFile(filepath);
-		print("Done");
-
-		// process dependencies
-		doInstallDependencies(infos.dependencies);
-	}
-
-	function doInstallDependencies( dependencies:List<{ project: String, version : String }> )
-	{
-		for( d in dependencies ) {
-			print("Installing dependency "+d.project+" "+d.version);
-			if( d.version == "" )
-				d.version = site.infos(d.project).curversion;
-			doInstall(d.project,d.version,false);
-		}
-	}
-
-	function safeDir( dir ) {
-		if( FileSystem.exists(dir) ) {
-			if( !FileSystem.isDirectory(dir) )
-				throw ("A file is preventing "+dir+" to be created");
-		}
-		try {
-			FileSystem.createDirectory(dir);
-		} catch( e : Dynamic ) {
-			throw "You don't have enough user rights to create the directory "+dir;
-		}
-		return true;
-	}
-
-	function safeDelete( file ) {
-		try {
-			FileSystem.deleteFile(file);
-			return true;
-		} catch (e:Dynamic) {
-			if( Sys.systemName() == "Windows") {
-				try {
-					Sys.command("attrib -R \"" +file+ "\"");
-					FileSystem.deleteFile(file);
-					return true;
-				} catch (e:Dynamic) {
-				}
-			}
-			return false;
-		}
-	}
-
-	function getRepository( ?setup : Bool ) {
-		var win = Sys.systemName() == "Windows";
-		var haxepath = Sys.getEnv("HAXEPATH");
-		if( haxepath != null ) {
-			var last = haxepath.charAt(haxepath.length - 1);
-			if( last != "/" && last != "\\" )
-				haxepath += "/";
-		}
-		var config_file;
-		if( win )
-			config_file = Sys.getEnv("HOMEDRIVE") + Sys.getEnv("HOMEPATH");
-		else
-			config_file = Sys.getEnv("HOME");
-		config_file += "/.haxelib";
-		var rep = try
-			File.getContent(config_file)
-		catch( e : Dynamic ) try
-			File.getContent("/etc/.haxelib")
-		catch( e : Dynamic ) {
-			if( setup ) {
-				(win ? haxepath : "/usr/lib/haxe/")+REPNAME;
-			} else if( win ) {
-				// Windows have a default directory (no need for setup)
-				if( haxepath == null )
-					throw "HAXEPATH environment variable not defined, please run haxesetup.exe first";
-				var rep = haxepath+REPNAME;
-				try {
-					safeDir(rep);
-				} catch( e : String ) {
-					throw "Error accessing Haxelib repository: $e";
-				}
-				return rep+"\\";
-			} else
-				throw "This is the first time you are runing haxelib. Please run `haxelib setup` first";
-		}
-		rep = rep.trim();
-		if( setup ) {
-			if( args.length <= argcur ) {
-				print("Please enter haxelib repository path with write access");
-				print("Hit enter for default (" + rep + ")");
-			}
-			var line = param("Path");
-			if( line != "" )
-				rep = line;
-			if( !FileSystem.exists(rep) ) {
-				try {
-					FileSystem.createDirectory(rep);
-				} catch( e : Dynamic ) {
-					print("Failed to create directory '"+rep+"' ("+Std.string(e)+"), maybe you need appropriate user rights");
-					print("Check also that the parent directory exists");
-					Sys.exit(1);
-				}
-			}
-			rep = try FileSystem.fullPath(rep) catch( e : Dynamic ) rep;
-			File.saveContent(config_file, rep);
-		} else if( !FileSystem.exists(rep) ) {
-			throw "haxelib Repository "+rep+" does not exists. Please run `haxelib setup` again";
-		} else if ( !FileSystem.isDirectory(rep) ) {
-			throw "haxelib Repository "+rep+" exists, but was a file, not a directory.  Please remove it and run `haxelib setup` again.";
-		}
-		return rep+"/";
-	}
-
-	function setup() {
-		var path = getRepository(true);
-		print("haxelib repository is now "+path);
-	}
-
-	function config() {
-		print(getRepository());
-	}
-
-	function getCurrent( dir ) {
-		return (FileSystem.exists(dir+"/.dev")) ? "dev" : File.getContent(dir + "/.current").trim();
-	}
-
-	function getDev( dir ) {
-		return File.getContent(dir + "/.dev").trim();
-	}
-
-	function list() {
-		var rep = getRepository();
-		var folders = FileSystem.readDirectory(rep);
-		var filter = paramOpt();
-		if ( filter != null )
-			folders = folders.filter( function (f) return f.toLowerCase().indexOf(filter.toLowerCase()) > -1 );
-		for( p in folders ) {
-			if( p.charAt(0) == "." )
-				continue;
-			var versions = new Array();
-			var current = getCurrent(rep + p);
-			var dev = try File.getContent(rep+p+"/.dev").trim() catch( e : Dynamic ) null;
-			for( v in FileSystem.readDirectory(rep+p) ) {
-				if( v.charAt(0) == "." )
-					continue;
-				v = Data.unsafe(v);
-				if( dev == null && v == current )
-					v = "["+v+"]";
-				versions.push(v);
-			}
-			if( dev != null )
-				versions.push("[dev:"+dev+"]");
-			print(Data.unsafe(p) + ": "+versions.join(" "));
-		}
-	}
-
-	function upgrade() {
-		var state = { rep : getRepository(), prompt : true, updated : false };
-		for( p in FileSystem.readDirectory(state.rep) ) {
-			if( p.charAt(0) == "." || !FileSystem.isDirectory(state.rep+"/"+p) )
-				continue;
-			var p = Data.unsafe(p);
-			print("Checking " + p);
-			doUpdate(p,state);
-		}
-		if( state.updated )
-			print("Done");
-		else
-			print("All libraries are up-to-date");
-	}
-
-	function doUpdate( p : String, state ) {
-		var rep = state.rep;
-		if( FileSystem.exists(rep + "/" + p + "/git") && FileSystem.isDirectory(rep + "/" + p + "/git") ) {
-			checkGit();
-			var oldCwd = Sys.getCwd();
-			Sys.setCwd(rep + "/" + p + "/git");
-			Sys.command("git pull");
-			Sys.setCwd(oldCwd);
-			state.updated = true;
-		} else {
-			var inf = try site.infos(p) catch( e : Dynamic ) { Sys.println(e); return; };
-			if( !FileSystem.exists(rep+Data.safe(p)+"/"+Data.safe(inf.curversion)) ) {
-				if( state.prompt )
-					switch ask("Upgrade "+p+" to "+inf.curversion) {
-					case Yes:
-					case Always: state.prompt = false;
-					case No:
-						return;
-					}
-				doInstall(p,inf.curversion,true);
-				state.updated = true;
-			} else
-				setCurrent(p, inf.curversion, true);
-		}
-	}
-	function updateByName(prj:String) {
-		var state = { rep : getRepository(), prompt : false, updated : false };
-		doUpdate(prj,state);
-		return state.updated;
-	}
-	function update() {
-		var prj = param('Library');
-		if (!updateByName(prj))
-			print(prj + " is up to date");
-	}	
-	
-	function updateSelf() {
-		function tryBuild() {
-			var p = new Process('haxe', ['-neko', 'test.n', '-lib', 'haxelib_client', '-main', 'tools.haxelib.Main', '--no-output']);
-			return 
-				if (p.exitCode() == 0) None;
-				else Some(p.stderr.readAll().toString());
-		}
-		if (!updateByName('haxelib_client'))
-			print("haxelib is up to date");
-		switch tryBuild() {
-			case None:
-				var win = Sys.systemName() == "Windows";
-				var haxepath = 
-					if (win) Sys.getEnv("HAXEPATH");
-					else new Path(new Process('which', ['haxelib']).stdout.readAll().toString()).dir + '/';
-					
-				if (haxepath == null) 
-					throw (win ? 'HAXEPATH environment variable not defined' : 'unable to locate haxelib through `which haxelib`');
-				else 
-					haxepath += 
-						switch (haxepath.charAt(haxepath.length - 1)) {
-							case '/', '\\': '';
-							default: '/';
-						}
-				
-				if (win) {
-					File.saveContent('update.hxml', '-lib haxelib_client\n--run tools.haxelib.Rebuild');
-					Sys.println('Please run haxe update.hxml');
-				}
-				else {
-					var p = new Process('haxelib', ['path', 'haxelib_client']);
-					if (p.exitCode() == 0) {
-						var args = [];
-						for (arg in p.stdout.readAll().toString().split('\n')) {
-							arg = arg.trim();
-							if (arg.charAt(0) == '-') 
-								args.push(arg);
-							else if (arg.length > 0) 
-								args.push('-cp "$arg"');
-						};
-						
-						var file = haxepath+'haxelib';
-						try File.saveContent(
-							file,
-							'#!/bin/sh\nexec haxe '+args.join(' ')+' --run tools.haxelib.Main "$@"'
-						)
-						catch (e:Dynamic) 
-							throw 'Error writing file $file. Please ensure you have write permissions. \n  ' + Std.string(e);
-					}
-					else throw p.stdout.readAll();
-				}
-			case Some(error):
-				throw 'Error compiling haxelib client: $error';
-		}
-	}
-
-	function deleteRec(dir) {
-		for( p in FileSystem.readDirectory(dir) ) {
-			var path = dir+"/"+p;
-			if( FileSystem.isDirectory(path) )
-				deleteRec(path);
-			else
-				safeDelete(path);
-		}
-		FileSystem.deleteDirectory(dir);
-	}
-
-	function remove() {
-		var prj = param("Library");
-		var version = paramOpt();
-		var rep = getRepository();
-		var pdir = rep + Data.safe(prj);
-		if( version == null ) {
-			if( !FileSystem.exists(pdir) )
-				throw "Library "+prj+" is not installed";
-			deleteRec(pdir);
-			print("Library "+prj+" removed");
-			return;
-		}
-
-		var vdir = pdir + "/" + Data.safe(version);
-		if( !FileSystem.exists(vdir) )
-			throw "Library "+prj+" does not have version "+version+" installed";
-
-		var cur = getCurrent(pdir);
-		if( cur == version )
-			throw "Can't remove current version of library "+prj;
-		deleteRec(vdir);
-		print("Library "+prj+" version "+version+" removed");
-	}
-
-	function set() {
-		var prj = param("Library");
-		var version = param("Version");
-		setCurrent(prj,version,false);
-	}
-
-	function setCurrent( prj : String, version : String, doAsk : Bool ) {
-		var pdir = getRepository() + Data.safe(prj);
-		var vdir = pdir + "/" + Data.safe(version);
-		if( !FileSystem.exists(vdir) )
-			throw "Library "+prj+" version "+version+" is not installed";
-		if( getCurrent(pdir) == version )
-			return;
-		if( doAsk && ask("Set "+prj+" to version "+version) == No )
-			return;
-		File.saveContent(pdir+"/.current",version);
-		print("Library "+prj+" current version is now "+version);
-	}
-
-	function checkRec( prj : String, version : String, l : List<{ project : String, version : String }> ) {
-		var pdir = getRepository() + Data.safe(prj);
-		if( !FileSystem.exists(pdir) )
-			throw "Library "+prj+" is not installed : run 'haxelib install "+prj+"'";
-		var version = if( version != null ) version else getCurrent(pdir);
-		var vdir = pdir + "/" + Data.safe(version);
-		if( vdir.endsWith("dev") )
-			vdir = getDev(pdir);
-		if( !FileSystem.exists(vdir) )
-			throw "Library "+prj+" version "+version+" is not installed";
-		for( p in l )
-			if( p.project == prj ) {
-				if( p.version == version )
-					return;
-				throw "Library "+prj+" has two version included "+version+" and "+p.version;
-			}
-		l.add({ project : prj, version : version });
-		var json = try File.getContent(vdir+"/"+Data.JSON) catch( e : Dynamic ) null;
-		if( json == null )
-			return; // ignore missing haxelib.json, assume no dependencies
-		var inf = Data.readData(json,false);
-		for( d in inf.dependencies )
-			checkRec(d.project,if( d.version == "" ) null else d.version,l);
-	}
-
-	function path() {
-		var list = new List();
-		while( argcur < args.length ) {
-			var a = args[argcur++].split(":");
-			checkRec(a[0],a[1],list);
-		}
-		var rep = getRepository();
-		for( d in list ) {
-			var pdir = Data.safe(d.project)+"/"+Data.safe(d.version)+"/";
-			var dir = rep + pdir;
-			try {
-				dir = getDev(rep+Data.safe(d.project));
-				if( dir.length == 0 || (dir.charAt(dir.length-1) != '/' && dir.charAt(dir.length-1) != '\\') )
-					dir += "/";
-				pdir = dir;
-			} catch( e : Dynamic ) {
-			}
-			var ndir = dir + "ndll";
-			if( FileSystem.exists(ndir) ) {
-				var sysdir = ndir+"/"+Sys.systemName();
-				var is64 = neko.Lib.load("std", "sys_is64", 0)();
-				if( is64 ) sysdir += "64";
-				if( !FileSystem.exists(sysdir) )
-					throw "Library "+d.project+" version "+d.version+" does not have a neko dll for your system";
-				Sys.println("-L "+pdir+"ndll/");
-			}
-			try {
-				var f = File.getContent(dir + "extraParams.hxml");
-				Sys.println(f.trim());
-			} catch( e : Dynamic ) {
-			}
-			Sys.println(dir);
-			Sys.println("-D "+d.project);
-		}
-	}
-
-	function dev() {
-		var rep = getRepository();
-		var project = param("Library");
-		var dir = paramOpt();
-		var proj = rep + Data.safe(project);
-		if( !FileSystem.exists(proj) ) {
-			FileSystem.createDirectory(proj);
-			File.saveContent(proj + "/.current", "dev");
-		}
-		var devfile = proj+"/.dev";
-		if( dir == null ) {
-			if( FileSystem.exists(devfile) )
-				FileSystem.deleteFile(devfile);
-			print("Development directory disabled");
-		} else {
-			dir = try FileSystem.fullPath(dir)+"/" catch( e : Dynamic ) rep;
-			try {
-				File.saveContent(devfile, dir);
-				print("Development directory set to "+dir);
-				
-				try {
-					// Check for haxelib.json, install dependencies
-					var haxelibJsonPath = dir + "haxelib.json";
-					if (FileSystem.exists(haxelibJsonPath))
-					{
-						var haxelibJson = File.getContent(haxelibJsonPath);
-						var infos = Data.readData(haxelibJson,true);
-						doInstallDependencies(infos.dependencies);
-					}
-				}
-				catch (e:Dynamic) {
-					print('Error installing dependencies for $project:\n  $e');
-				}
-			}
-			catch (e:Dynamic) {
-				print("Could not write to " +proj + "/.dev");
-			}
-
-		}
-	}
-
-	function checkGit() {
-		var gitExists = function()
-			try { command("git", []); return true; } catch (e:Dynamic) return false;
-		if( gitExists() )
-			return;
-		// if we have already msys git/cmd in our PATH
-		var match = ~/(.*)git([\\|\/])cmd$/ ;
-		for (path in Sys.getEnv("PATH").split(";"))	{
-			if (match.match(path.toLowerCase()))
-			{
-				var newPath = match.matched(1) + "git" +match.matched(2) + "bin";
-				Sys.putEnv("PATH", Sys.getEnv("PATH") + ";" +newPath);
-			}
-		}
-		if( gitExists() )
-			return;
-		// look at a few default paths
-		for( path in ["C:\\Program Files (x86)\\Git\\bin","C:\\Progra~1\\Git\\bin"] )
-			if( FileSystem.exists(path) ) {
-				Sys.putEnv("PATH", Sys.getEnv("PATH") + ";" +path);
-				if( gitExists() )
-					return;
-			}
-		print("Could not execute git, please make sure it is installed and available in your PATH.");
-	}
-
-	function git() {
-		var libName = param("Library name");
-		var rep = getRepository();
-		var libPath = rep + Data.safe(libName) + "/git";
-
-		if( FileSystem.exists(libPath) ) {
-			var state = { rep : rep, prompt : false, updated : false };
-			doUpdate(libName,state);
-			if( !state.updated )
-				print("You already have a git version of "+libName+" installed");
-			return;
-		}
-
-		var gitPath = param("Git path");
-		var branch = paramOpt();
-		var subDir = paramOpt();
-
-		print("Installing " +libName + " from " +gitPath);
-		checkGit();
-
-		if( Sys.command("git clone \"" +gitPath + "\" \"" +libPath + "\"") != 0 ) {
-			print("Could not clone git repository");
-			return;
-		}
-		Sys.setCwd(libPath);
-		if (branch != null) {
-			var ret = command("git", ["checkout", branch]);
-			if (ret.code != 0)
-			{
-				print("Could not checkout branch, tag or path: " +ret.out);
-				// TODO: We might have to get rid of the cloned repository here
-				return;
-			}
-		}
-		var revision = command("git", ["rev-parse", "HEAD"]).out;
-
-		var devPath = libPath + (subDir == null ? "" : "/" + subDir);
-		var haxelibJsonPath = devPath + "/haxelib.json";
-		var haxelibJson:String;
-		if (FileSystem.exists(haxelibJsonPath))
-		{
-			haxelibJson = File.getContent(haxelibJsonPath);
-		}
-		else
-		{
-			haxelibJson = '{
-  "name": "$libName",
-  "url" : "$gitPath",
-  "license": "",
-  "tags": [],
-  "description": "",
-  "version": "0.0.0",
-  "releasenote": "Updated from git.",
-  "contributors": [],
-  "dependencies": {}
-}';
-			File.saveContent(haxelibJsonPath, haxelibJson);
-		}
-
-		var infos = Data.readData(haxelibJson,true);
-		doInstallDependencies(infos.dependencies);
-
-		Sys.setCwd(libPath + "/../");
-		File.saveContent(".current", "dev");
-		File.saveContent(".dev", devPath);
-		print("Done");
-	}
-
-	function run() {
-		var rep = getRepository();
-		var project = param("Library");
-		var temp = project.split(":");
-		project = temp[0];
-		var pdir = rep + Data.safe(project);
-		if( !FileSystem.exists(pdir) )
-			throw "Library "+project+" is not installed";
-		pdir += "/";
-		var version = temp[1] != null ? temp[1] : getCurrent(pdir);
-		var dev = try getDev(pdir) catch ( e : Dynamic ) null;
-		var vdir = dev!=null ? dev : pdir + Data.safe(version);
-		var rdir = vdir + "/run.n";
-		if( !FileSystem.exists(rdir) )
-			throw "Library "+project+" version "+version+" does not have a run script";
-		args.push(Sys.getCwd());
-		Sys.setCwd(vdir);
-		var cmd = "neko run.n";
-		for( i in argcur...args.length )
-			cmd += " "+escapeArg(args[i]);
-		Sys.exit(Sys.command(cmd));
-	}
-
-	function escapeArg( a : String ) {
-		if( a.indexOf(" ") == -1 )
-			return a;
-		return '"'+a+'"';
-	}
-
-	function local() {
-		var file = param("Package");
-		doInstallFile(file,true,true);
-	}
-
-	function command( cmd:String, args:Array<String> ) {
-		var p = new sys.io.Process(cmd, args);
-		var code = p.exitCode();
-		return { code:code, out: code == 0 ? p.stdout.readAll().toString() : p.stderr.readAll().toString() };
-	}
-
-	function proxy() {
-		var rep = getRepository();
-		var host = param("Proxy host");
-		if( host == "" ) {
-			if( FileSystem.exists(rep + "/.proxy") ) {
-				FileSystem.deleteFile(rep + "/.proxy");
-				print("Proxy disabled");
-			} else
-				print("No proxy specified");
-			return;
-		}
-		var port = Std.parseInt(param("Proxy port"));
-		var authName = param("Proxy user login");
-		var authPass = authName == "" ? "" : param("Proxy user pass");
-		var proxy = {
-			host : host,
-			port : port,
-			auth : authName == "" ? null : { user : authName, pass : authPass },
-		};
-		Http.PROXY = proxy;
-		print("Testing proxy...");
-		try Http.requestUrl("http://www.google.com") catch( e : Dynamic ) {
-			print("Proxy connection failed");
-			return;
-		}
-		File.saveContent(rep + "/.proxy", haxe.Serializer.run(proxy));
-		print("Proxy setup done");
-	}
-
-	function loadProxy() {
-		var rep = getRepository();
-		try Http.PROXY = haxe.Unserializer.run(File.getContent(rep + "/.proxy")) catch( e : Dynamic ) { };
-	}
-
-	function convertXml() {
-		var cwd = Sys.getCwd();
-		var xmlFile = cwd + "haxelib.xml";
-		var jsonFile = cwd + "haxelib.json";
-
-		if (!FileSystem.exists(xmlFile))
-		{
-			print('No `haxelib.xml` file was found in the current directory.');
-			Sys.exit(0);
-		}
-
-		var xmlString = File.getContent(xmlFile);
-		var json = convert(xmlString);
-		var jsonString = prettyPrint(json);
-
-		File.saveContent(jsonFile, jsonString);
-		print('Saved to $jsonFile');
-	}
-
-	function convert(inXml:String) {
-		// Set up the default JSON structure
-		var json = {
-			"name": "",
-			"url" : "",
-			"license": "",
-			"tags": [],
-			"description": "",
-			"version": "0.0.1",
-			"releasenote": "",
-			"contributors": [],
-			"dependencies": {}
-		};
-
-		// Parse the XML and set the JSON
-		var xml = Xml.parse(inXml);
-		var project = xml.firstChild();
-		json.name = project.get("name");
-		json.license = project.get("license");
-		json.url = project.get("url");
-		for (node in project)
-		{
-			switch (node.nodeType)
-			{
-				case Xml.Element:
-					switch (node.nodeName)
-					{
-						case "tag": 
-							json.tags.push(node.get("v"));
-						case "user":
-							json.contributors.push(node.get("name"));
-						case "version":
-							json.version = node.get("name");
-							json.releasenote = node.firstChild().toString();
-						case "description":
-							json.description = node.firstChild().toString();
-						case "depends":
-							var name = node.get("name");
-							var version = node.get("version");
-							if (version == null) version = "";
-							Reflect.setField(json.dependencies, name, version);
-						default: 
-					}
-				default: 
-			}
-		}
-
-		return json;
-	}
-
-	function prettyPrint(json:Dynamic, indent="")
-	{
-		var sb = new StringBuf();
-		sb.add("{\n");
-
-		var firstRun = true;
-		for (f in Reflect.fields(json))
-		{
-			if (!firstRun) sb.add(",\n");
-			firstRun = false;
-
-			var value = switch (f) {
-				case "dependencies":
-					var d = Reflect.field(json, f);
-					prettyPrint(d, indent + "  ");
-				default: 
-					Json.stringify(Reflect.field(json, f));
-			}
-			sb.add(indent+'  "$f": $value');
-		}
-
-		sb.add('\n$indent}');
-		return sb.toString();
-	}
-
-	// ----------------------------------
-
-	static function print(str) {
-		Sys.print(str+"\n");
-	}
-
-	static function main() {
-		new Main().process();
-	}
-
-}

+ 0 - 35
std/tools/haxelib/Rebuild.hx

@@ -1,35 +0,0 @@
-package tools.haxelib;
-
-import sys.FileSystem;
-import sys.io.Process;
-
-class Rebuild {
-	static function run(cmd:String, ?msg:String = '', ?args:Array<String>) {
-		if (args == null) args = [];
-		var p = new Process(cmd, args);
-		if (p.exitCode() != 0) 
-			throw 'Error $msg:' + p.stderr.readAll().toString();
-	}
-	static function main() try {
-		switch Sys.systemName() {
-			case 'Windows':
-			case os: throw 'Wrong OS. Expected Windows but detected $os';
-		}
-		var haxepath = Sys.getEnv("HAXEPATH");
-		var file = '$haxepath/haxelib.n';
-		
-		run('haxe', 'rebuilding haxelib', [
-			'-neko', file, 
-			'-lib', 'haxelib_client', 
-			'-main', 'tools.haxelib.Main', 
-		]);
-		
-		run('nekotools', 'booting haxe', ['boot', file]);
-		FileSystem.deleteFile(file);
-		FileSystem.deleteFile('update.hxml');
-		Sys.println('Update successful');
-	}
-	catch (e:Dynamic) {
-		Sys.println(Std.string(e));
-	}
-}

+ 0 - 58
std/tools/haxelib/SemVer.hx

@@ -1,58 +0,0 @@
-package tools.haxelib;
-
-using Std;
-
-enum Preview {
-	ALPHA;
-	BETA;
-	RC;	
-}
-
-
-class SemVer {
-	public var major:Int;
-	public var minor:Int;	
-	public var patch:Int;
-	public var preview:Null<Preview>;
-	public var previewNum:Null<Int>;
-	public function new(major, minor, patch, ?preview, ?previewNum) {
-		this.major = major;
-		this.minor = minor;
-		this.patch = patch;
-		this.preview = preview;
-		this.previewNum = previewNum;
-	}
-	
-	public function toString():String {
-		var ret = '$major.$minor.$patch';
-		if (preview != null) {
-			ret += '-' + preview.getName().toLowerCase();
-			if (previewNum != null) 
-				ret += '.' + previewNum;
-		}
-		return ret;
-	}
-	static var parse = ~/^([0-9]+)\.([0-9]+)\.([0-9]+)(-(alpha|beta|rc)(\.([0-9]+))?)?$/;
-	
-	static public function ofString(s:String):SemVer 
-		return
-			if (parse.match(s)) 
-				new SemVer(
-					parse.matched(1).parseInt(),
-					parse.matched(2).parseInt(),
-					parse.matched(3).parseInt(),
-					switch parse.matched(5) {
-						case 'alpha': ALPHA;
-						case 'beta': BETA;
-						case 'rc': RC;
-						case v if (v == null): null;
-						case v: throw 'unrecognized preview tag $v';
-					},
-					switch parse.matched(7) {
-						case v if (v == null): null;
-						case v: v.parseInt();
-					}
-				)
-			else 
-				throw '$s is not a valid version string';//TODO: include some URL for reference
-}

+ 0 - 40
std/tools/haxelib/SiteApi.hx

@@ -1,40 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package tools.haxelib;
-
-import tools.haxelib.Data;
-
-interface SiteApi {
-	public function search( word : String ) : List<{ id : Int, name : String }>;
-	public function infos( project : String ) : ProjectInfos;
-	public function user( name : String ) : UserInfos;
-	public function register( name : String, pass : String, mail : String, fullname : String ) : Bool;
-	public function isNewUser( name : String ) : Bool;
-	public function checkDeveloper( prj : String, user : String ) : Void;
-	public function checkPassword( user : String, pass : String ) : Bool;
-	public function getSubmitId() : String;
-	
-	public function processSubmit( id : String, user : String, pass : String ) : String;
-
-	public function postInstall( project : String, version : String):Void;
-}
-

+ 0 - 3
std/tools/haxelib/haxelib.hxml

@@ -1,3 +0,0 @@
--neko haxelib.n
--main tools.haxelib.Main
--cmd "nekotools boot haxelib.n"

+ 0 - 57
std/tools/haxelib/haxelib.hxproj

@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="CustomBuild" />
-    <movie input="" />
-    <movie path="index.n" />
-    <movie fps="30" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="1" />
-    <movie minorVersion="0" />
-    <movie platform="Neko" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option mainClass="tools.haxelib.Site" />
-    <option enabledebug="False" />
-    <option additional="" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="haxelib.n" />
-    <hidden path="haxelib.sh" />
-    <hidden path="index.n" />
-    <hidden path="files" />
-    <hidden path="tmp" />
-    <hidden path="haxelib.exe" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand>haxe haxelib.hxml</preBuildCommand>
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="Custom" />
-    <option testMovieCommand="" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 2
std/tools/haxelib/haxelib.sh

@@ -1,2 +0,0 @@
-#!/bin/sh
-exec haxe --run tools.haxelib.Main "$@"

+ 0 - 508
std/tools/hxinst/Main.hx

@@ -1,508 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package tools.hxinst;
-
-class Main {
-
-	static var SYS = Sys.systemName();
-	static var NULL = if( SYS == "Windows" ) "NUL" else "/dev/null";
-	#if xcross
-	static var wnd : xcross.Winlog;
-	#end
-
-	var baseDir : String;
-	var binDir : String;
-	var libDir : String;
-	var debug : Bool;
-
-	function new(dbg) {
-		debug = dbg;
-		if( debug ) {
-			libDir = "/usr/local/lib";
-			binDir = "/usr/local/bin";
-		} else {
-			libDir = "/usr/lib";
-			binDir = "/usr/bin";
-		}
-		baseDir = if( SYS == "Windows" ) {
-			// use C:/ for Vista, Win7
-			var baseDir = (Sys.getEnv("ALLUSERSPROFILE") == "C:\\ProgramData") ? "C:" : Sys.getEnv("ProgramFiles");
-			baseDir + "/HaxeFoundation";
-		} else
-			libDir;
-	}
-
-	function newVersion(v1,v2) {
-		if( v1 == null )
-			return true;
-		return (v1.major * 10000 + v1.minor * 100 + v1.build < v2.major * 10000 + v2.minor * 100 + v2.build);
-	}
-
-	function ask( txt ) {
-		#if xcross
-		return xcross.Api.confirm("Question",txt);
-		#else
-		var answer = null;
-		while( true ) {
-			Sys.print(txt+" [y/n] ");
-			switch( Sys.stdin().readLine() ) {
-			case "n": answer = false; break;
-			case "y": answer = true; break;
-			}
-		}
-		return answer;
-		#end
-	}
-
-	function error( txt ) {
-		#if xcross
-		xcross.Api.error("Error",txt);
-		#else
-		Sys.stderr().writeString(txt+"\n");
-		#end
-		throw "Installation aborted";
-	}
-
-	function display( txt ) {
-		#if xcross
-		wnd.log(txt);
-		#else
-		Sys.println(txt);
-		#end
-		Sys.sleep(0.03);
-	}
-
-	function version(v : { major : Int, minor : Int, build : Int }, twoDigitMinor ) {
-		var min = twoDigitMinor && v.minor < 10 ? "0"+v.minor : Std.string(v.minor);
-		return v.major+"."+min+if( v.build > 0 ) "."+v.build else "";
-	}
-
-	function command( cmd ) {
-		display("Execute "+cmd);
-		if( Sys.command(cmd) != 0 )
-			error("Command '"+cmd+"' failed !");
-	}
-
-	function commandOutput( cmd ) {
-		var p = try new sys.io.Process(cmd,[]) catch( e : Dynamic ) return "";
-		return p.stderr.readAll().toString() + p.stdout.readAll().toString();
-	}
-
-	function run() {
-		try {
-			install();
-			display("Installation Completed");
-			#if xcross
-			xcross.Api.message("Done","Installation Completed");
-			#end
-		} catch( e : Dynamic ) {
-			display("");
-			display("");
-			display("ERROR = "+Std.string(e));
-			display(haxe.CallStack.toString(haxe.CallStack.exceptionStack()));
-			#if xcross
-			xcross.Api.error("Error","Installation aborted");
-			#end
-		}
-		#if xcross
-		wnd.enabled = true;
-		#end
-	}
-
-	function checkRights() {
-		try {
-			if( !sys.FileSystem.exists(baseDir) )
-				sys.FileSystem.createDirectory(baseDir);
-			var tmp = baseDir + "/.tmp.haxe.inst";
-			var f = sys.io.File.write(tmp,true);
-			f.close();
-			sys.FileSystem.deleteFile(tmp);
-			return true;
-		} catch( e : Dynamic ) {
-			#if xcross
-			if( xcross.Api.authorize() )
-				return false;
-			#end
-			var msg;
-			if( SYS == "Windows" )
-				msg = "You don't have administrative access on this computer,\nplease login on an administrator account.\nOnce haxe is installed, execute '"+baseDir+"\\haxesetup' on your own account.";
-			else
-				msg = "You don't have the rights to write in "+baseDir+", please run the installer using 'sudo'";
-			try error(msg) catch( e : Dynamic ) {};
-			return false;
-		}
-	}
-
-	var cacheResult : Null<Bool>;
-	function is64() {
-		if( cacheResult != null )
-			return cacheResult;
-		var p = new sys.io.Process("uname", ["-m"]);
-		var ret = p.stdout.readAll().toString();
-		p.exitCode();
-		cacheResult = ret.indexOf("x86_64") != -1;
-		return cacheResult;
-	}
-
-	function install() {
-		// CLEANUP
-		var dirs = [
-			"/usr/local/lib/neko",
-			"/usr/local/lib/haxe",
-			"/opt/neko",
-			"/opt/haxe",
-			"c:/motion-twin",
-			"c:/program files/motion-twin",
-		];
-		for( d in dirs )
-			if( !debug && sys.FileSystem.exists(d) )
-				error("A previous Haxe/Neko version seems to be installed in '"+d+"', please remove it first");
-		if( debug )
-			display("DEBUG MODE ON");
-
-		// PROXY
-		var p = neko.net.ProxyDetect.detect();
-		if( p != null ) {
-			display("Testing proxy "+p.host+":"+p.port);
-			haxe.Http.PROXY = p;
-			try {
-				haxe.Http.requestUrl("http://google.com");
-			} catch( e : Dynamic ) {
-				display("Could not connect on Google, trying with no proxy");
-				haxe.Http.PROXY = null;
-			}
-		}
-
-		// GET haxe Version
-		display("Getting Local Haxe Version");
-		var content = commandOutput("haxe");
-		var r = ~/^Haxe Compiler ([0-9]+)\.([0-9]+)(\.([0-9]+))?/;
-		var haxeVersion = null;
-		if( r.match(content) ) {
-			haxeVersion = {
-				major : Std.parseInt(r.matched(1)),
-				minor : Std.parseInt(r.matched(2)),
-				build : Std.parseInt(r.matched(4))
-			};
-			if( haxeVersion.build == null ) haxeVersion.build = 0;
-		}
-
-
-		// GET Neko Version
-		display("Getting Local Neko Version");
-		var content = commandOutput("neko");
-		var r = ~/^NekoVM ([0-9]+)\.([0-9]+)(\.([0-9]+))?/;
-		var nekoVersion = null;
-		if( r.match(content) )
-			nekoVersion = {
-				major : Std.parseInt(r.matched(1)),
-				minor : Std.parseInt(r.matched(2)),
-				build : Std.parseInt(r.matched(4))
-			};
-
-		// GET Haxe files list
-		display("Getting Latest Haxe Version");
-		var haxeFile = null;
-		var r = ~/^haxe-([0-9]+)\.([0-9]+)(-win|-linux|-osx)(\.zip|\.tar\.gz)$/;
-		for( f in haxe.Http.requestUrl("http://haxe.org/wiki/latest").split("\n") )
-			if( r.match(f) ) {
-				var pf = r.matched(3);
-				switch( SYS ) {
-				case "Windows": if( pf != "-win" ) continue;
-				case "Linux": if( pf != "-linux" ) continue;
-				case "Mac": if( pf != "-osx" ) continue;
-				default: continue;
-				}
-				haxeFile = {
-					file : f,
-					version : {
-						major : Std.parseInt(r.matched(1)),
-						minor : Std.parseInt(r.matched(2)),
-						build : 0,
-					},
-				};
-				break;
-			}
-		if( haxeFile == null )
-			error("No Haxe File found for your plaform");
-
-		// GET Neko files list
-		display("Getting Latest Neko Version");
-		var nekoFile = null;
-		var r = ~/^neko-([0-9]+)\.([0-9]+)(\.([0-9]+))?(-win|-linux|-osx|-linux64)(\.zip|\.tar\.gz)$/;
-		for( f in haxe.Http.requestUrl("http://nekovm.org/latest.n").split("\n") )
-			if( r.match(f) ) {
-				var pf = r.matched(5);
-				switch( SYS ) {
-				case "Windows": if( pf != "-win" ) continue;
-				case "Linux": if( pf != "-linux"+(is64() ? "64":"") ) continue;
-				case "Mac": if( pf != "-osx" ) continue;
-				default: continue;
-				}
-				nekoFile = {
-					file : f,
-					version : {
-						major : Std.parseInt(r.matched(1)),
-						minor : Std.parseInt(r.matched(2)),
-						build : Std.parseInt(r.matched(4)),
-					}
-				};
-				break;
-			}
-		if( nekoFile == null )
-			error("No Haxe File found for your plaform");
-
-		// ASK QUESTIONS IF OK TO INSTALL
-		var needHaxe = newVersion(haxeVersion,haxeFile.version);
-		var needNeko = newVersion(nekoVersion,nekoFile.version);
-		if( !needHaxe && !needNeko ) {
-			if( !ask("Both your Haxe and Neko versions are up-to-date, do you want to reinstall everything ?") )
-				throw "Installation Aborted";
-			needHaxe = true;
-			needNeko = true;
-		} else {
-			var txt = "";
-			if( needNeko ) {
-				txt += "Neko "+version(nekoFile.version,false);
-				if( needHaxe )
-					txt += " and ";
-			}
-			if( needHaxe )
-				txt += "Haxe "+version(haxeFile.version,true);
-			if( !ask("Do you want to install "+txt+" ?") )
-				error("Installation Aborted");
-		}
-
-		// DOWNLOAD
-		if( needNeko )
-			download("http://nekovm.org/_media",nekoFile.file);
-		if( needHaxe )
-			download("http://haxe.org/file",haxeFile.file);
-
-		// INSTALL
-		if( needNeko ) {
-			copy(nekoFile.file,true);
-			installNeko();
-		}
-		if( needHaxe ) {
-			copy(haxeFile.file,false);
-			installHaxe();
-		}
-	}
-
-	static function logProgress( txt ) {
-		#if xcross
-		wnd.logProgress(txt);
-		#else
-		Sys.print(txt+"\r");
-		#end
-	}
-
-	function download( url, file ) {
-		if( sys.FileSystem.exists(file) ) {
-			display("Using local version of "+file+", skipping download");
-			return;
-		}
-
-		var str = new haxe.io.BytesOutput();
-		var progress = new Progress(str);
-		progress.update = function() {
-			var p = progress.cur * 100 / progress.max;
-			p = Std.int(p * 10) / 10;
-			logProgress("Downloading "+file+" ("+p+"%)");
-		};
-		var h = new haxe.Http(url+"/"+file);
-		var me = this;
-		h.onError = function(e) {
-			me.error(Std.string(e));
-		};
-		logProgress("Downloading "+file+"...");
-		h.customRequest(false,progress);
-		#if xcross
-		wnd.log("");
-		#else
-		Sys.print("\n");
-		#end
-
-		var f = sys.io.File.write(file,true);
-		f.write(str.getBytes());
-		f.close();
-	}
-
-	function unzip( file ) {
-		var ch = sys.io.File.read(file,true);
-		var entries;
-		if( haxe.io.Path.extension(file) == "zip" )
-			entries = haxe.zip.Reader.readZip(ch);
-		else {
-			entries = new List();
-			for( f in new format.tgz.Reader(ch).read() )
-				entries.add({
-					fileName : f.fileName,
-					fileTime : f.fileTime,
-					fileSize : f.fileSize,
-					data : f.data,
-					dataSize : f.data.length,
-					compressed : false,
-					crc32 : null,
-				});
-		}
-		ch.close();
-		return entries;
-	}
-
-	function copy( file, isNeko ) {
-		var data = unzip(file);
-		var dir = baseDir + "/" + if( isNeko ) "neko" else "haxe";
-		if( !sys.FileSystem.exists(dir) )
-			sys.FileSystem.createDirectory(dir);
-		if( !isNeko ) {
-			try {
-				removeRec(dir+"/std");
-			} catch( e : Dynamic ) {
-			}
-		}
-		for( f in data ) {
-			var path = f.fileName.split("/");
-			path.shift(); // base directory
-			if( path[path.length-1] == "" ) {
-				path.pop();
-				if( path.length == 0 )
-					continue;
-				var ddir = dir+"/"+path.join("/");
-				display("Installing directory "+path.join("/"));
-				if( !sys.FileSystem.exists(ddir) )
-					sys.FileSystem.createDirectory(ddir);
-				continue;
-			}
-			var filename = dir + "/" + path.join("/");
-			var ch = sys.io.File.write(filename,true);
-			ch.write(haxe.zip.Reader.unzip(f));
-			ch.close();
-			if( SYS != "Windows" ) {
-				var exe = haxe.io.Path.extension(filename) == "";
-				Sys.command("chmod "+(if( exe ) 755 else 644)+" "+filename);
-			}
-		}
-	}
-
-	function link( dir, file, dest ) {
-		command("rm -rf "+dest+"/"+file);
-		command("ln -s "+baseDir+"/"+dir+"/"+file+" "+dest+"/"+file);
-	}
-
-	function installNeko() {
-		if( SYS == "Windows" )
-			return;
-		var so = if( SYS == "Mac" ) ".dylib" else ".so";
-		link("neko","neko",binDir);
-		link("neko","nekoc",binDir);
-		link("neko","nekotools",binDir);
-		link("neko","libneko"+so,libDir);
-	}
-
-	function installHaxe() {
-		if( SYS == "Windows" ) {
-			command('"'+baseDir+'/haxe/haxesetup" -silent');
-			return;
-		}
-		link("haxe","haxe",binDir);
-		link("haxe","haxelib",binDir);
-		link("haxe","haxedoc",binDir);
-		// HAXELIB setup
-		var haxelib = baseDir + "/haxe/lib";
-		if( !sys.FileSystem.exists(haxelib) ) {
-			sys.FileSystem.createDirectory(haxelib);
-			Sys.command("chmod 777 "+haxelib);
-		}
-	}
-
-	function removeRec( file ) {
-		if( !sys.FileSystem.isDirectory(file) ) {
-			sys.FileSystem.deleteFile(file);
-			return;
-		}
-		for( f in sys.FileSystem.readDirectory(file) )
-			removeRec(file+"/"+f);
-		sys.FileSystem.deleteDirectory(file);
-	}
-
-	static function main() {
-		var debug = Sys.getEnv("INST_DEBUG") != null;
-		var i = new Main(debug);
-		if( !i.checkRights() )
-			return;
-		#if xcross
-		wnd = new xcross.Winlog("Haxe Installer");
-		wnd.button = "Exit";
-		wnd.enabled = false;
-		wnd.onClick = function() {
-			neko.vm.Ui.stopLoop();
-		};
-		neko.vm.Thread.create(i.run);
-		neko.vm.Ui.loop();
-		#else
-		i.run();
-		#end
-	}
-
-}
-
-// --------- TOOLS --------------
-
-class Progress extends haxe.io.Output {
-
-	var o : haxe.io.Output;
-	public var cur : Int;
-	public var max : Int;
-
-	public function new(o) {
-		this.o = o;
-		cur = 0;
-	}
-
-	public dynamic function update() {
-	}
-
-	public override function writeByte(c) {
-		o.writeByte(c);
-		cur++;
-		update();
-	}
-
-	public override function writeBytes(s,p,l) {
-		var r = o.writeBytes(s,p,l);
-		cur += r;
-		update();
-		return r;
-	}
-
-	public override function close() {
-		super.close();
-		o.close();
-	}
-
-	public override function prepare(m) {
-		max = m;
-	}
-
-}

+ 0 - 1
std/tools/hxinst/hxinst-dmg.sh

@@ -1 +0,0 @@
-hdiutil create -srcfolder "Haxe Installer.app" -volname "Haxe Installer" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDZO -imagekey zlib-level=9 hxinst.dmg

+ 0 - 10
std/tools/hxinst/hxinst.hxml

@@ -1,10 +0,0 @@
--neko hxinst.n
--main tools.hxinst.Main
--lib format
--lib xcross
--cmd "haxelib run xcross -bundle HaxeInstaller hxinst.n"
---next
--neko hxinst.n
--main tools.hxinst.Main
--lib format
--cmd "haxelib run xcross -console -linux hxinst.n"

+ 0 - 51
std/tools/hxinst/hxinst.hxproj

@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="hxinst.n" />
-    <movie fps="30" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="1" />
-    <movie minorVersion="0" />
-    <movie platform="Neko" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option mainClass="tools.hxinst.Main" />
-    <option enabledebug="False" />
-    <option additional="-lib format&#xA;-lib xcross&#xA;-cmd haxelib run xcross -bundle HaxeInstaller hxinst.n&#xA;--next&#xA;-neko hxinst.n&#xA;-main tools.hxinst.Main&#xA;-lib format&#xA;-cmd haxelib run xcross -console -linux hxinst.n" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <!-- example: <hidden path="..." /> -->
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="Unknown" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>