Separate C# generator 09/164509/3
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 19 Dec 2017 10:59:46 +0000 (19:59 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 19 Dec 2017 11:36:19 +0000 (20:36 +0900)
Change-Id: I3ad683553caad8adc8163b34f39ed73151332323
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
17 files changed:
idlc/CMakeLists.txt
idlc/code_block/copyright.cb [moved from idlc/copyright.cb with 100% similarity]
idlc/code_block/cs_interop.cb [moved from idlc/cs_interop.cb with 100% similarity]
idlc/code_block/cs_proxy_interop.cb [moved from idlc/cs_proxy_interop.cb with 100% similarity]
idlc/code_block/cs_stub_interop.cb [moved from idlc/cs_stub_interop.cb with 100% similarity]
idlc/cs_gen/cs_gen_base.cc [moved from idlc/cs_gen_base.cc with 98% similarity]
idlc/cs_gen/cs_gen_base.h [moved from idlc/cs_gen_base.h with 91% similarity]
idlc/cs_gen/cs_proxy_gen.cc [moved from idlc/cs_proxy_gen.cc with 97% similarity]
idlc/cs_gen/cs_proxy_gen.h [moved from idlc/cs_proxy_gen.h with 87% similarity]
idlc/cs_gen/cs_stub_gen.cc [moved from idlc/cs_stub_gen.cc with 97% similarity]
idlc/cs_gen/cs_stub_gen.h [moved from idlc/cs_stub_gen.h with 88% similarity]
idlc/generator.cc
idlc/main.cc
packaging/tidl.spec
unit_tests/CMakeLists.txt
unit_tests/cs_gen/cs_proxy_gen_unittest.cc [moved from unit_tests/cs_proxy_gen_unittest.cc with 98% similarity]
unit_tests/cs_gen/cs_stub_gen_unittest.cc [moved from unit_tests/cs_stub_gen_unittest.cc with 98% similarity]

index 0df400f..7425340 100644 (file)
@@ -19,22 +19,8 @@ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Werror")
 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -std=c++11")
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}")
 
-SET(SOURCES
-       parser.cc
-       document.cc
-       declaration.cc
-       interface.cc
-       type.cc
-       parameter.cc
-       element.cc
-       structure.cc
-       block.cc
-       generator.cc
-       cs_gen_base.cc
-       cs_proxy_gen.cc
-       cs_stub_gen.cc
-       main.cc
-)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SOURCES)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/cs_gen CS_GEN_SOURCES)
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../)
 
@@ -43,11 +29,16 @@ bison_target(TIDLC ${CMAKE_CURRENT_SOURCE_DIR}/tidlc.yy ${CMAKE_CURRENT_SOURCE_D
 
 SET(TILDC_deps ${FLEX_TIDLC_OUTPUTS})
 
-ADD_EXECUTABLE(tidlc ${BISON_TIDLC_OUTPUTS} ${FLEX_TIDLC_OUTPUTS} ${SOURCES})
+ADD_EXECUTABLE(tidlc
+       ${BISON_TIDLC_OUTPUTS}
+       ${FLEX_TIDLC_OUTPUTS}
+       ${CS_GEN_SOURCES}
+       ${SOURCES}
+       )
 TARGET_LINK_LIBRARIES(tidlc ${LIBPKGS_LDFLAGS})
 INSTALL(TARGETS tidlc DESTINATION bin)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/copyright.cb DESTINATION share/tidl)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cs_interop.cb DESTINATION share/tidl)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cs_proxy_interop.cb DESTINATION share/tidl)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cs_stub_interop.cb DESTINATION share/tidl)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/code_block/copyright.cb DESTINATION share/tidl/code_block)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/code_block/cs_interop.cb DESTINATION share/tidl/code_block)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/code_block/cs_proxy_interop.cb DESTINATION share/tidl/code_block)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/code_block/cs_stub_interop.cb DESTINATION share/tidl/code_block)
 
similarity index 98%
rename from idlc/cs_gen_base.cc
rename to idlc/cs_gen/cs_gen_base.cc
index f6f3580..724f1e4 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <vector>
 
-#include "idlc/cs_gen_base.h"
+#include "idlc/cs_gen/cs_gen_base.h"
 
 namespace tidl {
 
similarity index 91%
rename from idlc/cs_gen_base.h
rename to idlc/cs_gen/cs_gen_base.h
index 1391ccd..0e9ffd6 100644 (file)
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef IDLC_CS_GEN_BASE_H_
-#define IDLC_CS_GEN_BASE_H_
+#ifndef IDLC_CS_GEN_CS_GEN_BASE_H_
+#define IDLC_CS_GEN_CS_GEN_BASE_H_
 
 #include <memory>
 #include <string>
@@ -44,4 +44,4 @@ class CsGeneratorBase : public Generator {
 
 }  // namespace tidl
 
-#endif  // IDLC_CS_GEN_BASE_H_
+#endif  // IDLC_CS_GEN_CS_GEN_BASE_H_
similarity index 97%
rename from idlc/cs_proxy_gen.cc
rename to idlc/cs_gen/cs_proxy_gen.cc
index 26caaf4..449528b 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "idlc/cs_proxy_gen.h"
+#include "idlc/cs_gen/cs_proxy_gen.h"
 
 namespace tidl {
 
similarity index 87%
rename from idlc/cs_proxy_gen.h
rename to idlc/cs_gen/cs_proxy_gen.h
index 5b6f40a..83dafbd 100644 (file)
  * limitations under the License.
  */
 
-#ifndef IDLC_CS_PROXY_GEN_H_
-#define IDLC_CS_PROXY_GEN_H_
+#ifndef IDLC_CS_GEN_CS_PROXY_GEN_H_
+#define IDLC_CS_GEN_CS_PROXY_GEN_H_
 
 #include <memory>
 #include <string>
 
-#include "idlc/cs_gen_base.h"
+#include "idlc/cs_gen/cs_gen_base.h"
 
 namespace tidl {
 
@@ -40,4 +40,4 @@ class CsProxyGen : public CsGeneratorBase {
 
 }  // namespace tidl
 
-#endif  // IDLC_CS_PROXY_GEN_H_
+#endif  // IDLC_CS_GEN_CS_PROXY_GEN_H_
similarity index 97%
rename from idlc/cs_stub_gen.cc
rename to idlc/cs_gen/cs_stub_gen.cc
index a2fdfd7..afe70ab 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "idlc/cs_stub_gen.h"
+#include "idlc/cs_gen/cs_stub_gen.h"
 
 namespace tidl {
 
similarity index 88%
rename from idlc/cs_stub_gen.h
rename to idlc/cs_gen/cs_stub_gen.h
index b0a274f..3dcc5c8 100644 (file)
  * limitations under the License.
  */
 
-#ifndef IDLC_STUB_GEN_H_
-#define IDLC_STUB_GEN_H_
+#ifndef IDLC_CS_GEN_STUB_GEN_H_
+#define IDLC_CS_GEN_STUB_GEN_H_
 
 #include <memory>
 #include <string>
 
-#include "idlc/cs_gen_base.h"
+#include "idlc/cs_gen/cs_gen_base.h"
 
 namespace tidl {
 
@@ -39,4 +39,4 @@ class CsStubGen : public CsGeneratorBase {
 
 }  // namespace tidl
 
-#endif  // IDLC_STUB_GEN_H_
+#endif  // IDLC_CS_GEN_STUB_GEN_H_
index 7219359..705690f 100644 (file)
@@ -40,9 +40,9 @@ void Generator::GenCodeBlock(std::string filename,
   std::string line;
   int cnt = 1;
 
-  cb_file.open("/usr/share/tidl/" + filename);
+  cb_file.open("/usr/share/tidl/code_block/" + filename);
   if (!cb_file.is_open()) {
-    cb_file.open("../idlc/" + filename);
+    cb_file.open("../idlc/code_block/" + filename);
   }
 
   if (!cb_file.is_open())
index dd3ebae..eb698c4 100644 (file)
@@ -21,8 +21,8 @@
 #include <memory>
 
 #include "idlc/parser.h"
-#include "idlc/cs_proxy_gen.h"
-#include "idlc/cs_stub_gen.h"
+#include "idlc/cs_gen/cs_proxy_gen.h"
+#include "idlc/cs_gen/cs_stub_gen.h"
 
 namespace {
 
index 125df54..c0776ab 100644 (file)
@@ -59,7 +59,7 @@ rm -rf %{buildroot}
 %license LICENSE
 %manifest %{name}.manifest
 %{_bindir}/tidlc
-%{_usr_share_dir}/tidl/*.cb
+%{_usr_share_dir}/tidl/*
 
 %files tests
 %manifest %{name}.manifest
index 8751efa..ced432c 100644 (file)
@@ -26,26 +26,12 @@ SET(TIDLC_SOURCES
        ../idlc/structure.cc
        ../idlc/block.cc
        ../idlc/generator.cc
-       ../idlc/cs_gen_base.cc
-       ../idlc/cs_proxy_gen.cc
-       ../idlc/cs_stub_gen.cc
        ../idlc/parser.cc
        )
 
-SET(UNIT_TESTS_SOURCES
-       document_unittest.cc
-       block_unittest.cc
-       type_unittest.cc
-       element_unittest.cc
-       declaration_unittest.cc
-       interface_unittest.cc
-       structure_unittest.cc
-       generator_unittest.cc
-       cs_proxy_gen_unittest.cc
-       cs_stub_gen_unittest.cc
-       parser_unittest.cc
-       main.cc
-       )
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../idlc/cs_gen CS_GEN_SOURCES)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} UNIT_TESTS_SOURCES)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/cs_gen CS_GEN_UNIT_TESTS_SOURCES)
 
 FLEX_TARGET(TIDLC
        ${CMAKE_CURRENT_SOURCE_DIR}/../idlc/tidlc.ll
@@ -60,7 +46,9 @@ ADD_EXECUTABLE(tidl-unit-tests
        ${BISON_TIDLC_OUTPUTS}
        ${FLEX_TIDLC_OUTPUTS}
        ${TIDLC_SOURCES}
+       ${CS_GEN_SOURCES}
        ${UNIT_TESTS_SOURCES}
+       ${CS_GEN_UNIT_TESTS_SOURCES}
        )
 
 TARGET_LINK_LIBRARIES(tidl-unit-tests ${GTEST_LIBRARIES} pthread)
similarity index 98%
rename from unit_tests/cs_proxy_gen_unittest.cc
rename to unit_tests/cs_gen/cs_proxy_gen_unittest.cc
index fc76852..bef1f70 100644 (file)
@@ -19,7 +19,7 @@
 #include <iostream>
 
 #include "idlc/parser.h"
-#include "idlc/cs_proxy_gen.h"
+#include "idlc/cs_gen/cs_proxy_gen.h"
 
 class CsProxyGenTest : public testing::Test {
  public:
similarity index 98%
rename from unit_tests/cs_stub_gen_unittest.cc
rename to unit_tests/cs_gen/cs_stub_gen_unittest.cc
index 9cbb53d..8d4def5 100644 (file)
@@ -19,7 +19,7 @@
 #include <iostream>
 
 #include "idlc/parser.h"
-#include "idlc/cs_stub_gen.h"
+#include "idlc/cs_gen/cs_stub_gen.h"
 
 class CsStubGenTest : public testing::Test {
  public: