From 8c07d6723162c559710d6bc54ce64a5b7328a2a9 Mon Sep 17 00:00:00 2001 From: Benjamin San Souci Date: Fri, 24 Feb 2017 11:17:52 -0800 Subject: [PATCH 1/3] Update build schema for native compilation. --- docs/docson/build-schema.json | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/docs/docson/build-schema.json b/docs/docson/build-schema.json index 79b8d0153e..6c40a4e2f8 100644 --- a/docs/docson/build-schema.json +++ b/docs/docson/build-schema.json @@ -185,6 +185,31 @@ ], "description": "can be either a single sourceItem or an array of sourceItems, sourceItem can be either a single string(non nested directory) or an detailed object config" }, + "targetItems": { + "type": "object", + "properties": { + "outputName": { + "type": "string", + "description": "The name of the target" + }, + "compilationKind": { + "enum": [ + "js", + "native", + "bytecode" + ], + "description": "The compiler to use for the target" + }, + "entryPoint": { + "type": "string", + "description": "Path to file used as entrypoint for this target" + } + } + }, + "targets": { + "$ref": "#/definitions/targetItems", + "description": "(Not implemented yet)" + }, "bsc-flags": { "oneOf": [ { @@ -196,8 +221,8 @@ }, { "properties": { - "kind" : - { + "kind" : + { "enum": [ "reset", "prefix", @@ -277,6 +302,10 @@ "$ref": "#/definitions/sources", "description": "specication of where source code is " }, + "targets": { + "$ref": "#/definitions/targets", + "description": "specification for compiling to differet targets (native, bytecode, js)" + }, "generate-merlin": { "type": "boolean", "description": "default true (generate .merlin)" @@ -299,4 +328,4 @@ "name", "sources" ] -} \ No newline at end of file +} From 427ccbde74be3a816112b5ffb272ba6732d918bf Mon Sep 17 00:00:00 2001 From: Benjamin San Souci Date: Fri, 24 Feb 2017 23:42:39 -0800 Subject: [PATCH 2/3] Update schema. Remove outputname as it can be simply the target kind. Impose the invariant that JS backend doesn't need an entry point. --- docs/docson/build-schema.json | 53 ++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/docs/docson/build-schema.json b/docs/docson/build-schema.json index 6c40a4e2f8..eb6e4696fb 100644 --- a/docs/docson/build-schema.json +++ b/docs/docson/build-schema.json @@ -185,30 +185,39 @@ ], "description": "can be either a single sourceItem or an array of sourceItems, sourceItem can be either a single string(non nested directory) or an detailed object config" }, - "targetItems": { - "type": "object", - "properties": { - "outputName": { - "type": "string", - "description": "The name of the target" - }, - "compilationKind": { - "enum": [ - "js", - "native", - "bytecode" - ], - "description": "The compiler to use for the target" - }, - "entryPoint": { - "type": "string", - "description": "Path to file used as entrypoint for this target" - } - } + "targetItem": { + "oneOf": [ + { + "type": "string", + "enum": [ + "js" + ], + "description": "JS target compiled using BuckleScript" + }, + { + "type": "object", + "properties": { + "kind": { + "enum": [ + "native", + "bytecode" + ], + "description": "The compiler to use for the target" + }, + "entryPoint": { + "type": "string", + "description": "Path to file used as entrypoint for this target" + } + } + } + ] }, "targets": { - "$ref": "#/definitions/targetItems", - "description": "(Not implemented yet)" + "type": "array", + "items": { + "$ref": "#/definitions/targetItem" + }, + "description": "A list of target items" }, "bsc-flags": { "oneOf": [ From 67c141314114a7caf94e114e78f91a34b502bf2e Mon Sep 17 00:00:00 2001 From: Benjamin San Souci Date: Fri, 24 Feb 2017 23:53:12 -0800 Subject: [PATCH 3/3] Fixing the naming. --- docs/docson/build-schema.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/docson/build-schema.json b/docs/docson/build-schema.json index eb6e4696fb..f9c1d17a0e 100644 --- a/docs/docson/build-schema.json +++ b/docs/docson/build-schema.json @@ -212,12 +212,12 @@ } ] }, - "targets": { + "buildable-targets": { "type": "array", "items": { "$ref": "#/definitions/targetItem" }, - "description": "A list of target items" + "description": "A list of buildable targets" }, "bsc-flags": { "oneOf": [ @@ -311,9 +311,9 @@ "$ref": "#/definitions/sources", "description": "specication of where source code is " }, - "targets": { - "$ref": "#/definitions/targets", - "description": "specification for compiling to differet targets (native, bytecode, js)" + "buildable-targets": { + "$ref": "#/definitions/buildable-targets", + "description": "Used by bsb to build to native/bytecode (instead of the default JS)" }, "generate-merlin": { "type": "boolean",