MCPcopy Create free account
hub / github.com/Autodesk/AutomaticComponentToolkit / writeLicenseHeaderEx

Function writeLicenseHeaderEx

Source/languagewriter.go:146–178  ·  view source on GitHub ↗

writeLicenseHeaderEx writes a license header into a writer.

(w io.Writer, component ComponentDefinition, abstract string, includeVersion bool, CommandStart string, CommandEnd string)

Source from the content-addressed store, hash-verified

144
145// writeLicenseHeaderEx writes a license header into a writer.
146func writeLicenseHeaderEx (w io.Writer, component ComponentDefinition, abstract string, includeVersion bool, CommandStart string, CommandEnd string) {
147 ACTVersion := component.ACTVersion;
148 version := component.Version;
149 copyright := component.Copyright;
150 year := component.Year;
151
152 if (len(CommandStart) > 0) {
153 fmt.Fprintf (w, "%s++\n", CommandStart);
154 fmt.Fprintf (w, "\n");
155 }
156 fmt.Fprintf (w, "Copyright (C) %d %s\n", year, copyright);
157 fmt.Fprintf (w, "\n");
158 for i := 0; i < len(component.License.Lines); i++ {
159 line := component.License.Lines[i];
160 fmt.Fprintf (w, "%s\n", line.Value);
161 }
162 fmt.Fprintf (w, "\n");
163 if (includeVersion) {
164 fmt.Fprintf (w, "This file has been generated by the Automatic Component Toolkit (ACT) version %s.\n", ACTVersion)
165 fmt.Fprintf (w, "\n");
166 }
167 if (len(abstract) > 0 ) {
168 fmt.Fprintf (w, "Abstract: %s\n", abstract);
169 if (includeVersion) {
170 fmt.Fprintf (w, "\nInterface version: %d.%d.%d\n", majorVersion(version), minorVersion(version), microVersion(version))
171 }
172 }
173 fmt.Fprintf (w, "\n");
174 if (len(CommandEnd) > 0) {
175 fmt.Fprintf (w, "%s\n", CommandEnd);
176 fmt.Fprintf (w, "\n");
177 }
178}
179
180
181// CreateLanguageFile creates a LanguageWriter and sets its indent string

Callers 6

WriteCLicenseHeaderMethod · 0.85
WriteLicenseHeaderFunction · 0.85

Calls 3

majorVersionFunction · 0.85
minorVersionFunction · 0.85
microVersionFunction · 0.85

Tested by

no test coverage detected