From 2f202a634f41cca643c14e6486a0de8123baa444 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Wed, 26 Dec 2018 14:17:12 +0100 Subject: [PATCH] Fixed build scripts and building tools --- scripts/build_declarations.sh | 8 +++----- scripts/web_build.sh | 8 ++++++++ tools/build_dtsgen.sh | 13 +++++++++++++ tools/build_trgen.sh | 13 +++++++++++++ tools/trgen/tsconfig.json | 6 +++++- 5 files changed, 42 insertions(+), 6 deletions(-) create mode 100755 tools/build_dtsgen.sh create mode 100755 tools/build_trgen.sh diff --git a/scripts/build_declarations.sh b/scripts/build_declarations.sh index 05d75c1c..23700fdb 100755 --- a/scripts/build_declarations.sh +++ b/scripts/build_declarations.sh @@ -2,6 +2,7 @@ BASEDIR=$(dirname "$0") source "${BASEDIR}/resolve_commands.sh" +cd "$BASEDIR/../" function generate_link() { if [ ! -L $2 ] || [ "${BASH_ARGV[0]}" == "force" ]; then @@ -16,17 +17,14 @@ function replace_tribble() { #${1} => file name echo "$(cat ${1} | sed -E 's/\/\/\/[ ]+.*/\n/')" > ${1} } -BASEDIR=$(dirname "$0") -cd "$BASEDIR/../" + #Building the generator -cd tools/dtsgen -execute_tsc -p tsconfig.json +./tools/build_dtsgen.sh if [ $? -ne 0 ]; then echo "Failed to build typescript declaration generator" exit 1 fi -cd ../../ #Easy going: Each "module" has it's exports and imports #So lets first build the exports and ignore any errors diff --git a/scripts/web_build.sh b/scripts/web_build.sh index 0c925086..a6d7fc58 100755 --- a/scripts/web_build.sh +++ b/scripts/web_build.sh @@ -34,6 +34,14 @@ if [ $? -ne 0 ]; then exit 1 fi +#Lets build some tools +#dtsgen should be already build by build_declarations.sh +./tools/build_trsgen.sh +if [ $? -ne 0 ]; then + echo "Failed to build typescript translation generator" + exit 1 +fi + #Now lets build the declarations echo "Building declarations" ./scripts/build_declarations.sh diff --git a/tools/build_dtsgen.sh b/tools/build_dtsgen.sh new file mode 100755 index 00000000..0da061f3 --- /dev/null +++ b/tools/build_dtsgen.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +BASEDIR=$(dirname "$0") +source "${BASEDIR}/../scripts/resolve_commands.sh" +cd "$BASEDIR/dtsgen" + +execute_tsc -p tsconfig.json +if [ $? -ne 0 ]; then + echo "Failed to build typescript declaration generator" + exit 1 +fi + +exit 0 \ No newline at end of file diff --git a/tools/build_trgen.sh b/tools/build_trgen.sh new file mode 100755 index 00000000..b6ebc528 --- /dev/null +++ b/tools/build_trgen.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +BASEDIR=$(dirname "$0") +source "${BASEDIR}/../scripts/resolve_commands.sh" +cd "$BASEDIR/trgen" + +execute_tsc -p tsconfig.json +if [ $? -ne 0 ]; then + echo "Failed to build typescript translation generator" + exit 1 +fi + +exit 0 \ No newline at end of file diff --git a/tools/trgen/tsconfig.json b/tools/trgen/tsconfig.json index 35468e62..1c724691 100644 --- a/tools/trgen/tsconfig.json +++ b/tools/trgen/tsconfig.json @@ -10,6 +10,10 @@ }, "files": [ "generator.ts", - "index.ts" + "index.ts", + "compiler.ts", + "jsrender_generator.ts", + "ts_generator.ts", + "ttsc_transformer.ts" ] } \ No newline at end of file