浏览代码

reactivated cs/java targets

Nicolas Cannasse 13 年之前
父节点
当前提交
5bfe9c3a4f
共有 3 个文件被更改,包括 29 次插入6 次删除
  1. 1 1
      doc/release.neko
  2. 9 0
      haxe.vcproj
  3. 19 5
      main.ml

+ 1 - 1
doc/release.neko

@@ -65,7 +65,7 @@ chdir("..");
 chdir("..");
 
 cmd("rm -rf .svn */.svn */*/.svn */*/*/.svn");
-cmd("rm -rf all.n all.js *.swf *.xml jvm cs");
+cmd("rm -rf all.n all.js *.swf *.xml");
 
 chdir("tools");
 chdir("haxedoc");

+ 9 - 0
haxe.vcproj

@@ -70,9 +70,18 @@
 			<File
 				RelativePath=".\genas3.ml">
 			</File>
+			<File
+				RelativePath=".\gencommon.ml">
+			</File>
 			<File
 				RelativePath=".\gencpp.ml">
 			</File>
+			<File
+				RelativePath=".\gencs.ml">
+			</File>
+			<File
+				RelativePath=".\genjava.ml">
+			</File>
 			<File
 				RelativePath=".\genjs.ml">
 			</File>

+ 19 - 5
main.ml

@@ -623,7 +623,7 @@ and do_connect host port args =
 
 and init ctx =
 	let usage = Printf.sprintf
-		"haXe Compiler %d.%.2d - (c)2005-2012 Motion-Twin\n Usage : haxe%s -main <class> [-swf|-js|-neko|-php|-cpp|-as3] <output> [options]\n Options :"
+		"haXe Compiler %d.%.2d - (c)2005-2012 Motion-Twin\n Usage : haxe%s -main <class> [-swf|-js|-neko|-php|-cpp|-cs|-java|-as3] <output> [options]\n Options :"
 		(version / 100) (version mod 100) (if Sys.os_type = "Win32" then ".exe" else "")
 	in
 	let com = ctx.com in
@@ -695,6 +695,12 @@ try
 		("-cpp",Arg.String (fun dir ->
 			set_platform Cpp dir;
 		),"<directory> : generate C++ code into target directory");
+		("-cs",Arg.String (fun dir ->
+			set_platform Cs dir;
+		),"<directory> : generate C# code into target directory");
+		("-java",Arg.String (fun dir ->
+			set_platform Java dir;
+		),"<directory> : generate Java code into target directory");
 		("-xml",Arg.String (fun file ->
 			Parser.use_doc := true;
 			xml_out := Some file
@@ -920,8 +926,12 @@ try
 		| Cpp ->
 			add_std "cpp";
 			"cpp"
-		| Cs | Java -> 
-			assert false
+		| Cs -> 
+			Gencs.before_generate com;
+			add_std "cs"; "cs"
+		| Java -> 
+			Genjava.before_generate com;
+			add_std "jvm"; "jvm"
 	) in
 	(* if we are at the last compilation step, allow all packages accesses - in case of macros or opening another project file *)
 	if com.display && not ctx.has_next then com.package_rules <- PMap.foldi (fun p r acc -> match r with Forbidden -> acc | _ -> PMap.add p r acc) com.package_rules PMap.empty;
@@ -997,8 +1007,12 @@ try
 		| Cpp ->
 			Common.log com ("Generating Cpp in : " ^ com.file);
 			Gencpp.generate com;
-		| Cs | Java ->
-			assert false
+		| Cs ->
+			if com.verbose then print_endline ("Generating C# in : " ^ com.file);
+			Gencs.generate com;
+		| Java ->
+			if com.verbose then print_endline ("Generating Java in : " ^ com.file);
+			Genjava.generate com;
 		);
 	end;
 	Sys.catch_break false;