Skip to content

Commit

Permalink
Added Cpp Documentation creation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderoster committed Aug 5, 2022
1 parent 2935c77 commit 1c4a983
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 10 deletions.
28 changes: 22 additions & 6 deletions Source/automaticcomponenttoolkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,18 @@ func createComponent(component ComponentDefinition, outfolderBase string, bindin

case "CppDynamic":
{

outputFolderDocumentationCppExplicit := "";

if (binding.Documentation != "") {

outputFolderDocumentationCppExplicit = outputFolderDocumentation + "/Cpp"
err = os.MkdirAll(outputFolderDocumentationCppExplicit, os.ModePerm)
if err != nil {
log.Fatal(err)
}
}

outputFolderBindingCppDynamic := outputFolderBindings + "/CppDynamic"
err = os.MkdirAll(outputFolderBindingCppDynamic, os.ModePerm)
if err != nil {
Expand All @@ -169,18 +181,22 @@ func createComponent(component ComponentDefinition, outfolderBase string, bindin
}

err = BuildBindingCppExplicit(component, outputFolderBindingCppDynamic, outputFolderExampleCppDynamic,
indentString, binding.ClassIdentifier)
outputFolderDocumentationCppExplicit, indentString, binding.ClassIdentifier)
if err != nil {
return err
}
}

case "Cpp":
{
outputFolderDocumentationCppImplicit := outputFolderDocumentation + "/Cpp"
err = os.MkdirAll(outputFolderDocumentationCppImplicit, os.ModePerm)
if err != nil {
log.Fatal(err)
outputFolderDocumentationCppImplicit := "";

if (binding.Documentation != "") {
outputFolderDocumentationCppImplicit = outputFolderDocumentation + "/Cpp";
err = os.MkdirAll(outputFolderDocumentationCppImplicit, os.ModePerm)
if err != nil {
log.Fatal(err)
}
}

outputFolderBindingCppImplicit := outputFolderBindings + "/Cpp"
Expand Down Expand Up @@ -513,7 +529,7 @@ func printUsageInfo() {
}

func main() {
ACTVersion := "1.7.0-develop"
ACTVersion := "1.8.0-develop"
fmt.Fprintln(os.Stdout, "Automatic Component Toolkit v"+ACTVersion)
if len(os.Args) < 2 {
printUsageInfo()
Expand Down
21 changes: 17 additions & 4 deletions Source/buildbindingccpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,13 @@ func BuildBindingCppImplicit(component ComponentDefinition, outputFolder string,
}
}

err = BuildCCPPDocumentation(component, outputFolderDocumentation, ClassIdentifier)
if err != nil {
return err
if (outputFolderDocumentation != "") {

err = BuildCCPPDocumentation(component, outputFolderDocumentation, ClassIdentifier)
if err != nil {
return err
}

}


Expand Down Expand Up @@ -1580,7 +1584,7 @@ func buildCppHeader(component ComponentDefinition, w LanguageWriter, NameSpace s

// BuildBindingCppExplicit builds headeronly C++-bindings of a library's API in form of expliclty loaded function handles.
func BuildBindingCppExplicit(component ComponentDefinition, outputFolder string, outputFolderExample string,
indentString string, ClassIdentifier string) error {
outputFolderDocumentation string, indentString string, ClassIdentifier string) error {
forceRecreation := false
ExplicitLinking := true
namespace := component.NameSpace
Expand Down Expand Up @@ -1646,6 +1650,15 @@ func BuildBindingCppExplicit(component ComponentDefinition, outputFolder string,
log.Printf("Omitting recreation of C++Dynamic example file \"%s\"", DynamicCPPCMake)
}
}

if (outputFolderDocumentation != "") {

err = BuildCCPPDocumentation(component, outputFolderDocumentation, ClassIdentifier)
if err != nil {
return err
}

}

return nil
}
Expand Down
1 change: 1 addition & 0 deletions Source/componentdefinition.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ type ComponentDefinitionBinding struct {
Language string `xml:"language,attr"`
Indentation string `xml:"indentation,attr"`
ClassIdentifier string `xml:"classidentifier,attr"`
Documentation string `xml:"documentation,attr"`
Version string `xml:"version,attr"`
}

Expand Down

0 comments on commit 1c4a983

Please sign in to comment.