@@ -580,51 +580,10 @@ private boolean isIncludePathDuplicated(String pathToCheck)
580580 {
581581 // path operations failed, just returning false
582582 }
583- <<<<<<< HEAD
584-
585- return false ;
586- }
587- =======
583+
588584 return false ;
589585 }
590586
591- /*
592- * ----------------------------------------------------------------------------------------
593- * Arguments
594- */
595- private static final String case_sensitive_arg = "-cs" ;
596- private static final String output_path_arg = "-d" ;
597- private static final String default_container_prealloc_size = "-default-container-prealloc-size" ;
598- private static final String default_extensibility_arg = "-default_extensibility" ;
599- private static final String default_extensibility_short_arg = "-de" ;
600- private static final String specific_platform_arg = "-example" ;
601- private static final String extra_template_arg = "-extrastg" ;
602- private static final String flat_output_directory_arg = "-flat-output-dir" ;
603- private static final String fusion_arg = "-fusion" ;
604- private static final String help_arg = "-help" ;
605- private static final String include_path_arg = "-I" ;
606- private static final String language_arg = "-language" ;
607- private static final String no_typesupport_arg = "-no-typesupport" ;
608- private static final String no_typeobjectsupport_arg = "-no-typeobjectsupport" ;
609- private static final String no_dependencies_arg = "-no-dependencies" ;
610- private static final String package_arg = "-package" ;
611- private static final String disable_preprocessor_arg = "-ppDisable" ;
612- private static final String preprocessor_path_arg = "-ppPath" ;
613- private static final String python_bindings_arg = "-python" ;
614- private static final String replace_arg = "-replace" ;
615- private static final String temp_dir_arg = "-t" ;
616- private static final String ros2_names_arg = "-typeros2" ;
617- private static final String cnames_arg = "-typesc" ;
618- private static final String version_arg = "-version" ;
619-
620- /*
621- * ----------------------------------------------------------------------------------------
622- * Developer Arguments
623- */
624- private static final String generate_api_arg = "-genapi" ;
625- private static final String execute_test_arg = "-test" ;
626- >>>>>>> fbb0672 (Apply user template to included IDL files (#472 ) (#474 ))
627-
628587 public static void printHelp ()
629588 {
630589 System .out .println (m_appName + " usage:" );
@@ -824,11 +783,6 @@ private Project parseIDL(
824783 for (Map .Entry <String , String > entry : m_customStgOutput .entrySet ())
825784 {
826785 System .out .println ("Loading custom template " + entry .getKey () + "..." );
827- <<<<<<< HEAD
828- Path path = Paths .get (entry .getKey ());
829- String templateName = path .getFileName ().toString ().substring (0 , path .getFileName ().toString ().lastIndexOf ('.' ));
830- tmanager .addGroup (templateName );
831- =======
832786 loadAndAddTemplate (entry .getKey (), tmanager );
833787 }
834788 }
@@ -843,7 +797,6 @@ private Project parseIDL(
843797 entry .getKey () + " for included IDL file " + idlFilename + "..." );
844798 loadAndAddTemplate (entry .getKey (), tmanager );
845799 }
846- >>>>>>> fbb0672 (Apply user template to included IDL files (#472 ) (#474 ))
847800 }
848801 }
849802
@@ -886,29 +839,9 @@ >>>>>>> fbb0672 (Apply user template to included IDL files (#472) (#474))
886839 {
887840 for (Map .Entry <String , String > entry : m_customStgOutput .entrySet ())
888841 {
889- <<<<<<< HEAD
890- Path path = Paths .get (entry .getKey ());
891- String templateName = path .getFileName ().toString ().substring (0 , path .getFileName ().toString ().lastIndexOf ('.' ));
892- System .out .println ("Generating from custom " + templateName + " to " + entry .getValue ());
893-
894- if (returnedValue = Utils .writeFile (m_outputDir + entry .getValue (), maintemplates .getTemplate (templateName ), m_replace ))
895- {
896- // Try to determine if the file is a header file.
897- if (entry .getValue ().contains (".hpp" ) || entry .getValue ().contains (".h" ))
898- {
899- project .addCommonIncludeFile (entry .getValue ());
900- }
901- else
902- {
903- project .addCommonSrcFile (ctx .getFilename () + entry .getValue ());
904- }
905- }
906- else
907- =======
908842 if (! (returnedValue = createOutputCustomTemplate (
909- entry , idlFilename , output_dir , relative_dir , ctx .getFilename (),
843+ entry , idlFilename , m_outputDir , ctx .getFilename (),
910844 maintemplates , m_replace , project )))
911- >>>>>>> fbb0672 (Apply user template to included IDL files (#472 ) (#474 ))
912845 {
913846 break ;
914847 }
@@ -922,7 +855,7 @@ >>>>>>> fbb0672 (Apply user template to included IDL files (#472) (#474))
922855 if (entry .getValue ().contains ("@" ))
923856 {
924857 if (! (returnedValue = createOutputCustomTemplate (
925- entry , idlFilename , output_dir , relative_dir , ctx .getFilename (),
858+ entry , idlFilename , m_outputDir , ctx .getFilename (),
926859 maintemplates , m_replace , project )))
927860 {
928861 break ;
@@ -1132,25 +1065,16 @@ private void loadAndAddTemplate(
11321065 String templatePath ,
11331066 TemplateManager tmanager )
11341067 {
1135- try
1136- {
1137- Path path = Paths .get (templatePath );
1138- String templateName = path .getFileName ().toString ();
1139- templateName = templateName .substring (0 , templateName .lastIndexOf ('.' ));
1140- String content = new String (Files .readAllBytes (path ));
1141- tmanager .addGroupFromString (templateName , content );
1142- }
1143- catch (IOException e )
1144- {
1145- System .out .println (ColorMessage .error ("IOException" ) + "Cannot read content from " + templatePath );
1146- }
1068+ Path path = Paths .get (templatePath );
1069+ String templateName = path .getFileName ().toString ();
1070+ templateName = templateName .substring (0 , templateName .lastIndexOf ('.' ));
1071+ tmanager .addGroup (templateName );
11471072 }
11481073
11491074 private boolean createOutputCustomTemplate (
11501075 Map .Entry <String , String > entry ,
11511076 String idlFilename ,
11521077 String outputDir ,
1153- String relativeDir ,
11541078 String contextFilename ,
11551079 TemplateGroup maintemplates ,
11561080 boolean replace ,
@@ -1167,11 +1091,11 @@ private boolean createOutputCustomTemplate(
11671091 {
11681092 if (outputName .contains (".hpp" ) || outputName .contains (".h" ))
11691093 {
1170- project .addCommonIncludeFile (relativeDir + outputName );
1094+ project .addCommonIncludeFile (outputName );
11711095 }
11721096 else
11731097 {
1174- project .addCommonSrcFile (relativeDir + contextFilename + outputName );
1098+ project .addCommonSrcFile (contextFilename + outputName );
11751099 }
11761100 }
11771101 return ret_val ;
0 commit comments