@@ -580,51 +580,10 @@ private boolean isIncludePathDuplicated(String pathToCheck)
580
580
{
581
581
// path operations failed, just returning false
582
582
}
583
- <<<<<<< HEAD
584
-
585
- return false ;
586
- }
587
- =======
583
+
588
584
return false ;
589
585
}
590
586
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
-
628
587
public static void printHelp ()
629
588
{
630
589
System .out .println (m_appName + " usage:" );
@@ -824,11 +783,6 @@ private Project parseIDL(
824
783
for (Map .Entry <String , String > entry : m_customStgOutput .entrySet ())
825
784
{
826
785
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
- =======
832
786
loadAndAddTemplate (entry .getKey (), tmanager );
833
787
}
834
788
}
@@ -843,7 +797,6 @@ private Project parseIDL(
843
797
entry .getKey () + " for included IDL file " + idlFilename + "..." );
844
798
loadAndAddTemplate (entry .getKey (), tmanager );
845
799
}
846
- >>>>>>> fbb0672 (Apply user template to included IDL files (#472 ) (#474 ))
847
800
}
848
801
}
849
802
@@ -886,29 +839,9 @@ >>>>>>> fbb0672 (Apply user template to included IDL files (#472) (#474))
886
839
{
887
840
for (Map .Entry <String , String > entry : m_customStgOutput .entrySet ())
888
841
{
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
- =======
908
842
if (! (returnedValue = createOutputCustomTemplate (
909
- entry , idlFilename , output_dir , relative_dir , ctx .getFilename (),
843
+ entry , idlFilename , m_outputDir , ctx .getFilename (),
910
844
maintemplates , m_replace , project )))
911
- >>>>>>> fbb0672 (Apply user template to included IDL files (#472 ) (#474 ))
912
845
{
913
846
break ;
914
847
}
@@ -922,7 +855,7 @@ >>>>>>> fbb0672 (Apply user template to included IDL files (#472) (#474))
922
855
if (entry .getValue ().contains ("@" ))
923
856
{
924
857
if (! (returnedValue = createOutputCustomTemplate (
925
- entry , idlFilename , output_dir , relative_dir , ctx .getFilename (),
858
+ entry , idlFilename , m_outputDir , ctx .getFilename (),
926
859
maintemplates , m_replace , project )))
927
860
{
928
861
break ;
@@ -1137,8 +1070,7 @@ private void loadAndAddTemplate(
1137
1070
Path path = Paths .get (templatePath );
1138
1071
String templateName = path .getFileName ().toString ();
1139
1072
templateName = templateName .substring (0 , templateName .lastIndexOf ('.' ));
1140
- String content = new String (Files .readAllBytes (path ));
1141
- tmanager .addGroupFromString (templateName , content );
1073
+ tmanager .addGroup (templateName );
1142
1074
}
1143
1075
catch (IOException e )
1144
1076
{
@@ -1150,7 +1082,6 @@ private boolean createOutputCustomTemplate(
1150
1082
Map .Entry <String , String > entry ,
1151
1083
String idlFilename ,
1152
1084
String outputDir ,
1153
- String relativeDir ,
1154
1085
String contextFilename ,
1155
1086
TemplateGroup maintemplates ,
1156
1087
boolean replace ,
@@ -1167,11 +1098,11 @@ private boolean createOutputCustomTemplate(
1167
1098
{
1168
1099
if (outputName .contains (".hpp" ) || outputName .contains (".h" ))
1169
1100
{
1170
- project .addCommonIncludeFile (relativeDir + outputName );
1101
+ project .addCommonIncludeFile (outputName );
1171
1102
}
1172
1103
else
1173
1104
{
1174
- project .addCommonSrcFile (relativeDir + contextFilename + outputName );
1105
+ project .addCommonSrcFile (contextFilename + outputName );
1175
1106
}
1176
1107
}
1177
1108
return ret_val ;
0 commit comments