Skip to content

Commit

Permalink
KAA-1320 Remove avrogen.sh(bat)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyGamov committed Jan 13, 2017
1 parent 70c1ef0 commit ea8428c
Show file tree
Hide file tree
Showing 10 changed files with 143 additions and 206 deletions.
22 changes: 3 additions & 19 deletions client/client-multi/client-cpp/CMakeLists.txt
Expand Up @@ -178,25 +178,9 @@ set(CMAKE_MODULE_PATH
#Checks whether avrogen script exists #Checks whether avrogen script exists
set(WORKDIR ${CMAKE_CURRENT_SOURCE_DIR}) set(WORKDIR ${CMAKE_CURRENT_SOURCE_DIR})
message("==================================") message("==================================")
if(WIN32)
set(AVROGEN "avrogen.bat") # Generate structures according to avro schemas.
if(NOT EXISTS "${WORKDIR}/${AVROGEN}") include(${CMAKE_CURRENT_SOURCE_DIR}/Modules/AvroStructGenerator.cmake)
message("Error: avrogen.bat hasn't been found.")
else()
execute_process(COMMAND "${AVROGEN}"
WORKING_DIRECTORY ${WORKDIR})
endif()
else()
set(AVROGEN "avrogen.sh")
if(NOT EXISTS "${WORKDIR}/${AVROGEN}")
message("Error: avrogen.sh hasn't been found.")
else()
execute_process(COMMAND chmod +x ./${AVROGEN}
WORKING_DIRECTORY ${WORKDIR})
execute_process(COMMAND "./${AVROGEN}"
WORKING_DIRECTORY ${WORKDIR})
endif()
endif()


# #
# Sets common compilation flags. # Sets common compilation flags.
Expand Down
65 changes: 65 additions & 0 deletions client/client-multi/client-cpp/Modules/AvroStructGenerator.cmake
@@ -0,0 +1,65 @@
#
# Copyright 2014-2016 CyberVision, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This file is generated by CppEventSourcesGenerator.java
# from client-cpp/templates/event/AvroStructGenerator.cmake.template

find_program(avrogen avrogencpp)

if (${avrogen} STREQUAL "avrogen-NOTFOUND")
message(FATAL_ERROR "avrogen is NOT found")
else()
message("Generating necessary files according to Avro schemas")
endif()

if (WIN32)
set(directory_separator "\\")
else()
set(directory_separator "/")
endif()

set(avro_schemas ${CMAKE_CURRENT_SOURCE_DIR}${directory_separator}avro${directory_separator})
set(kaa_headers ${CMAKE_CURRENT_SOURCE_DIR}${directory_separator}kaa${directory_separator})

file(MAKE_DIRECTORY ${avro_schemas}event ${kaa_headers}gen)

execute_process(COMMAND ${avrogen}
-i ${avro_schemas}endpoint.avsc
-o ${kaa_headers}gen${directory_separator}EndpointGen.hpp
-n kaa)
execute_process(COMMAND ${avrogen}
-i ${avro_schemas}profile.avsc
-o ${kaa_headers}profile${directory_separator}gen${directory_separator}ProfileGen.hpp
-n kaa_profile)
execute_process(COMMAND ${avrogen}
-i ${avro_schemas}notification.avsc
-o ${kaa_headers}notification${directory_separator}gen${directory_separator}NotificationGen.hpp
-n kaa_notification)
execute_process(COMMAND ${avrogen}
-i ${avro_schemas}log.avsc
-o ${kaa_headers}log${directory_separator}gen${directory_separator}LogGen.hpp -n kaa_log)
execute_process(COMMAND ${avrogen}
-i ${avro_schemas}configuration.avsc
-o ${kaa_headers}configuration${directory_separator}gen${directory_separator}ConfigurationGen.hpp
-n kaa_configuration)

set(event_family_classes "")

foreach(family ${event_family_classes})
execute_process(COMMAND ${avrogen}
-i ${avro_schemas}event${directory_separator}${family}.avsc
-o ${kaa_headers}event${directory_separator}gen${directory_separator}${family}Gen.hpp
-n ns${family})
endforeach(family)
2 changes: 0 additions & 2 deletions client/client-multi/client-cpp/assembly/client-cpp-sdk.xml
Expand Up @@ -51,8 +51,6 @@
<directory>${project.basedir}</directory> <directory>${project.basedir}</directory>
<outputDirectory>/</outputDirectory> <outputDirectory>/</outputDirectory>
<includes> <includes>
<include>avrogen.bat</include>
<include>avrogen.sh</include>
<include>CMakeLists.txt</include> <include>CMakeLists.txt</include>
<include>README</include> <include>README</include>
</includes> </includes>
Expand Down
39 changes: 0 additions & 39 deletions client/client-multi/client-cpp/avrogen.bat

This file was deleted.

39 changes: 0 additions & 39 deletions client/client-multi/client-cpp/avrogen.sh

This file was deleted.

@@ -0,0 +1,66 @@
#
# Copyright 2014-2016 CyberVision, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This file is generated by CppEventSourcesGenerator.java
# from client-cpp/templates/event/AvroStructGenerator.cmake.template

find_program(avrogen avrogencpp)

if (${avrogen} STREQUAL "avrogen-NOTFOUND")
message(FATAL_ERROR "avrogen is NOT found")
else()
message("Generating necessary files according to Avro schemas")
endif()

if (WIN32)
set(directory_separator "\\")
else()
set(directory_separator "/")
endif()

set(avro_schemas ${CMAKE_CURRENT_SOURCE_DIR}${directory_separator}avro${directory_separator})
set(kaa_headers ${CMAKE_CURRENT_SOURCE_DIR}${directory_separator}kaa${directory_separator})

file(MAKE_DIRECTORY ${avro_schemas}event ${kaa_headers}gen)

execute_process(COMMAND ${avrogen}
-i ${avro_schemas}endpoint.avsc
-o ${kaa_headers}gen${directory_separator}EndpointGen.hpp
-n kaa)
execute_process(COMMAND ${avrogen}
-i ${avro_schemas}profile.avsc
-o ${kaa_headers}profile${directory_separator}gen${directory_separator}ProfileGen.hpp
-n kaa_profile)
execute_process(COMMAND ${avrogen}
-i ${avro_schemas}notification.avsc
-o ${kaa_headers}notification${directory_separator}gen${directory_separator}NotificationGen.hpp
-n kaa_notification)
execute_process(COMMAND ${avrogen}
-i ${avro_schemas}log.avsc
-o ${kaa_headers}log${directory_separator}gen${directory_separator}LogGen.hpp -n kaa_log)
execute_process(COMMAND ${avrogen}
-i ${avro_schemas}configuration.avsc
-o ${kaa_headers}configuration${directory_separator}gen${directory_separator}ConfigurationGen.hpp
-n kaa_configuration)

# [event_family_class_list] is substituted with a real list of event families during sdk generation.
set(event_family_classes [event_family_class_list])

foreach(family ${event_family_classes})
execute_process(COMMAND ${avrogen}
-i ${avro_schemas}event${directory_separator}${family}.avsc
-o ${kaa_headers}event${directory_separator}gen${directory_separator}${family}Gen.hpp
-n ns${family})
endforeach(family)

This file was deleted.

39 changes: 0 additions & 39 deletions client/client-multi/client-cpp/templates/event/avrogen.sh_template

This file was deleted.

4 changes: 0 additions & 4 deletions pom.xml
Expand Up @@ -322,8 +322,6 @@ Copyright 2014-2016 CyberVision, Inc.
<cvm>PHP</cvm> <cvm>PHP</cvm>
<hvm>PHP</hvm> <hvm>PHP</hvm>
<java>PHP</java> <java>PHP</java>
<bat_template>BATCH</bat_template>
<sh_template>SCRIPT_STYLE</sh_template>
<template>PHP</template> <template>PHP</template>
</mapping> </mapping>
<includes> <includes>
Expand All @@ -347,8 +345,6 @@ Copyright 2014-2016 CyberVision, Inc.
<include>**/*.cvm</include> <include>**/*.cvm</include>
<include>**/*.hvm</include> <include>**/*.hvm</include>
<include>**/*.template</include> <include>**/*.template</include>
<include>**/*.sh_template</include>
<include>**/*.bat_template</include>
<include>**/sonar-project.properties</include> <include>**/sonar-project.properties</include>
</includes> </includes>
<excludes> <excludes>
Expand Down

0 comments on commit ea8428c

Please sign in to comment.