Skip to content

Commit

Permalink
Remove SVN revision handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kjozic committed Feb 23, 2018
1 parent 18b6fb5 commit 4d6721c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
12 changes: 3 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,13 @@ func generate(name string, args []string) {
LenientInit: *lenientInit,
}

specs, rev := parseSpecifications(*xmlDir)
specs := parseSpecifications(*xmlDir)
docs := parseDocumentation(*xmlDir)

var pkg *Package
for _, spec := range specs {
if spec.HasPackage(packageSpec) {
pkg = spec.ToPackage(packageSpec)
pkg.SpecRev = rev
docs.AddDocs(pkg)
if len(*restrict) > 0 {
performRestriction(pkg, *restrict)
Expand Down Expand Up @@ -112,7 +111,7 @@ func performRestriction(pkg *Package, jsonPath string) {
pkg.Filter(lookupMap(r.Enums), lookupMap(r.Functions))
}

func parseSpecifications(xmlDir string) ([]*Specification, string) {
func parseSpecifications(xmlDir string) []*Specification {
specDir := filepath.Join(xmlDir, "spec")
specFiles, err := ioutil.ReadDir(specDir)
if err != nil {
Expand All @@ -131,12 +130,7 @@ func parseSpecifications(xmlDir string) ([]*Specification, string) {
specs = append(specs, spec)
}

rev, err := ioutil.ReadFile(filepath.Join(specDir, "REVISION"))
if err != nil {
log.Fatalln("error reading spec revision file:", err)
}

return specs, string(rev)
return specs
}

func parseDocumentation(xmlDir string) Documentation {
Expand Down
2 changes: 0 additions & 2 deletions package.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ type Package struct {
Typedefs []*Typedef
Enums map[string]*Enum
Functions map[string]*PackageFunction

SpecRev string
}

// A PackageFunction is a package-specific Function wrapper.
Expand Down
2 changes: 0 additions & 2 deletions tmpl/package.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
// This package was automatically generated using Glow:
// http://github.com/go-gl/glow
//
// Generated based on the OpenGL XML specification:
// SVN revision {{.SpecRev}}
package {{.Name}}
//glow:rmspace

Expand Down

0 comments on commit 4d6721c

Please sign in to comment.