From 4fa284ed5d91126d86b7fb496c4428c684f30bef Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 6 May 2019 22:19:59 +0800 Subject: [PATCH] Add Elm petstore scripts to ensure-uptodate script (#2823) * update elm petstore samples * add elm to ensure uptodate script * add elm-format * add symlink to elm-format --- CI/circle_parallel.sh | 7 +++++++ bin/elm-0.18-petstore.sh | 5 ++++- bin/elm-petstore.sh | 5 ++++- bin/utils/ensure-up-to-date | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 9bcb34a73ad..9b780d2f195 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -18,6 +18,13 @@ elif [ "$NODE_INDEX" = "2" ]; then if [[ $project_version == *"-SNAPSHOT" ]]; then echo "Running node $NODE_INDEX to test ensure-up-to-date" java -version + + # install elm-format for formatting elm code + npm install -g elm-format + + # symlink elm-format + sudo ln -s /opt/circleci/.nvm/versions/node/v12.1.0/bin/elm-format /usr/local/bin/elm-format + ./bin/utils/ensure-up-to-date fi #elif [ "$NODE_INDEX" = "3" ]; then diff --git a/bin/elm-0.18-petstore.sh b/bin/elm-0.18-petstore.sh index aa0bbb52448..9d5bcb53bc0 100755 --- a/bin/elm-0.18-petstore.sh +++ b/bin/elm-0.18-petstore.sh @@ -25,8 +25,11 @@ then mvn -B clean package fi +# auto format elm code using elm-format +export ELM_POST_PROCESS_FILE="/usr/local/bin/elm-format --elm-version=0.18 --yes" + # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g elm -t modules/openapi-generator/src/main/resources/elm -o samples/client/petstore/elm-0.18 --additional-properties elmVersion=0.18 $@" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g elm -t modules/openapi-generator/src/main/resources/elm -o samples/client/petstore/elm-0.18 --additional-properties elmVersion=0.18 --enable-post-process-file $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/elm-petstore.sh b/bin/elm-petstore.sh index 1d0cc6d3f39..f2dae6d27e5 100755 --- a/bin/elm-petstore.sh +++ b/bin/elm-petstore.sh @@ -25,8 +25,11 @@ then mvn -B clean package fi +# auto format elm code using elm-format +export ELM_POST_PROCESS_FILE="/usr/local/bin/elm-format --elm-version=0.19 --yes" + # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g elm -t modules/openapi-generator/src/main/resources/elm -o samples/client/petstore/elm $@" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g elm -t modules/openapi-generator/src/main/resources/elm -o samples/client/petstore/elm --enable-post-process-file $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date index d8c7f9d8136..23870eb63a4 100755 --- a/bin/utils/ensure-up-to-date +++ b/bin/utils/ensure-up-to-date @@ -52,6 +52,7 @@ declare -a scripts=( "./bin/elixir-petstore.sh" "./bin/go-petstore.sh" "./bin/go-gin-petstore-server.sh" +"./bin/elm-petstore-all.sh" "./bin/meta-codegen.sh" # OTHERS "./bin/utils/export_docs_generators.sh"