From a38a08f461959eac2f7af9bc39ba6f743e9bf260 Mon Sep 17 00:00:00 2001 From: Leilei Date: Fri, 4 Sep 2020 09:47:04 +0800 Subject: [PATCH] =?UTF-8?q?=E2=98=80=EF=B8=8F=20add=20make=20target=20:=20?= =?UTF-8?q?package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 13 ++++++------- bin/package.sh | 5 +++++ src/AVisitor.cpp | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 bin/package.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 68c3615..282c98e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,21 +2,15 @@ cmake_minimum_required(VERSION 2.8) project("proto2json") -# CMake commands copied by the CMake file for CImg - -# To use PKG_CHECK_MODULES to find some optional packages find_package(PkgConfig) - # ### Search Additional Libraries ########## - + SET(CMAKE_CXX_FLAGS "-std=c++11 -O3") # #### End of additional libraries search ########## - ### Configure Paths according to detected packages - if (NOT APPLE) if(NOT WIN32) @@ -176,6 +170,11 @@ install(PROGRAMS build/proto2json DESTINATION bin) +add_custom_target(package + COMMAND sh ../bin/package.sh + COMMENT "Now Generating tar.gz file..." +) + if(CMAKE_SYSTEM_NAME MATCHES "Linux") add_custom_command(TARGET proto2json POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different diff --git a/bin/package.sh b/bin/package.sh new file mode 100644 index 0000000..cc8895a --- /dev/null +++ b/bin/package.sh @@ -0,0 +1,5 @@ +#!/usr/bin/bash +export protover=`cat ../src/version.h | grep PROTOJSON_VERSION` +ver=`echo $protover | awk '{print $3}' | sed "s/\"//g"` +tar -zcvf proto2json-$ver-macos-brew.tar.gz ../build/proto2json +openssl dgst -sha256 proto2json-$ver-macos-brew.tar.gz \ No newline at end of file diff --git a/src/AVisitor.cpp b/src/AVisitor.cpp index 84e7888..e7acb08 100644 --- a/src/AVisitor.cpp +++ b/src/AVisitor.cpp @@ -691,7 +691,7 @@ Json::Value AVisitor::parseParamBody(std::string parName) { arr["$$ref"] = "#/definitions/" + fieldType; arr["items"]["type"] = "object"; //arr["items"]["properties"] = objTmp["properties"]; - arr["description"] = fieldType;// objTmp["title"]; + arr["description"] = fieldType; body["properties"][pName] = arr; } continue;