Fix documentation generation on Windows.

Previously doc/doc.css was a symlink to util/doc.css, but symlinks
don't work well on Windows. Now util/doc.css is copied to the output
directory when the documentation is generated.

Change-Id: I2c9f4fee4f4307cc3dd70c4be380b4551d5e9ab5
Reviewed-on: https://boringssl-review.googlesource.com/5677
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
Brian Smith 2015-08-09 17:08:49 -04:00 committed by Adam Langley
parent 6488725e5e
commit 55a3cf4ad5
3 changed files with 14 additions and 1 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ ssl/test/runner/runner
*.swp
*.swo
doc/*.html
doc/doc.css

View File

@ -1 +0,0 @@
../util/doc.css

View File

@ -605,6 +605,14 @@ func generateIndex(outPath string, config *Config, headerDescriptions map[string
return nil
}
func copyFile(outPath string, inFilePath string) error {
bytes, err := ioutil.ReadFile(inFilePath)
if err != nil {
return err
}
return ioutil.WriteFile(filepath.Join(outPath, filepath.Base(inFilePath)), bytes, 0666)
}
func main() {
var (
configFlag *string = flag.String("config", "doc.config", "Location of config file")
@ -645,4 +653,9 @@ func main() {
fmt.Printf("Failed to generate index: %s\n", err)
os.Exit(1)
}
if err := copyFile(*outputDir, "doc.css"); err != nil {
fmt.Printf("Failed to copy static file: %s\n", err)
os.Exit(1)
}
}