ソースを参照

review samples generation and vscode integration: allow to switch JS/HL/SWF launch

ncannasse 7 年 前
コミット
df7c4c719a

+ 2 - 0
samples/Generator.hx

@@ -84,6 +84,8 @@ class Generator {
 			#if !silent
 			Sys.println(name);
 			#end
+			
+			sys.io.File.saveContent('build/$name/$f', sys.io.File.getContent(f));
 
 			var interp = new hscript.Interp();
 			for( f in Reflect.fields(context) )

+ 17 - 2
samples/templates/.vscode/launch.json

@@ -4,13 +4,28 @@
 	// Pour plus d'informations, visitez : https://go.microsoft.com/fwlink/?linkid=830387
 	"version": "0.2.0",
 	"configurations": [
+		{
+			"type": "chrome",
+			"request": "launch",
+			"name": "Chrome WebGL",
+			"url": "file://${workspaceFolder}/index.html",
+			"webRoot": "${workspaceFolder}",
+			"preLaunchTask": "HeapsJS"
+		},
 		{
 			"name": "HashLink",
 			"request": "launch",
 			"type": "hl",
 			"hxml": "::name::_hl.hxml",
 			"cwd": "${workspaceRoot}",
-			"preLaunchTask": "Build"
-		}
+			"preLaunchTask": "HeapsHL"
+		},
+		{
+            "name": "Flash",
+            "type": "fdb",
+            "request": "launch",
+			"program": "${workspaceRoot}/::name::.swf",
+			"preLaunchTask": "HeapsSWF"
+        }
 	]
 }

+ 20 - 7
samples/templates/.vscode/tasks.json

@@ -1,17 +1,30 @@
 {
+	// See https://go.microsoft.com/fwlink/?LinkId=733558
+	// for the documentation about the tasks.json format
 	"version": "2.0.0",
 	"tasks": [
 		{
-			"type": "hxml",
-			"label": "Build",
-			"file": "::name::_hl.hxml",
-			"presentation": {
-				"reveal": "never"
-			},
+			"type": "haxe",
+			"args": "active configuration",
 			"group": {
 				"kind": "build",
 				"isDefault": true
 			}
+		},
+		{
+			"label": "HeapsJS",
+			"type": "hxml",
+			"file": "::name::_js.hxml"
+		},
+		{
+			"label": "HeapsHL",
+			"type": "hxml",
+			"file": "::name::_hl.hxml"
+		},
+		{
+			"label": "HeapsSWF",
+			"type": "hxml",
+			"file": "::name::_swf.hxml"
 		}
 	]
-}
+}

+ 2 - 1
samples/templates/__name_hl.hxml

@@ -1,7 +1,8 @@
 -lib heaps
 -lib hlsdl
--cp ../..
 -hl ::name::.hl
 -main ::main::
 -D windowSize=1024x768
+-cp ../..
+-cp .
 ::params::

+ 3 - 1
samples/templates/__name_js.hxml

@@ -1,5 +1,7 @@
 -lib heaps
--cp ../..
 -js ::name::.js
 -main ::main::
+-cp ../..
+-cp .
+-debug
 ::params::

+ 2 - 1
samples/templates/__name_swf.hxml

@@ -1,7 +1,8 @@
 -lib heaps
--cp ../..
 -swf ::name::.swf
 -swf-header 1280:800:60:FFFFFF
 -swf-version 15.0
 -main ::main::
+-cp ../..
+-cp .
 ::params::