blob: 554022a6ffd678fc2639779ddaa50777fc74ce6c [file] [log] [blame]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001#!/usr/bin/env python3
2
3import os
4import shutil
5import subprocess
6
7TARGET = ".docs"
Haibo Huang8b9513e2020-07-13 22:05:39 -07008VERSION = "clang_10_0"
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07009
10if os.path.isdir(TARGET):
11 shutil.rmtree(TARGET)
12
13os.mkdir(TARGET)
14
15for (name, features) in [("default", VERSION), ("runtime", f"runtime,{VERSION}")]:
16 subprocess.call(["cargo", "clean"])
17 subprocess.call(["cargo", "doc", f"--features={features}", "--no-deps"])
18 print(f"Copying docs to {TARGET}/{name}...")
19 shutil.copytree(f"target/doc", f"{TARGET}/{name}")
20
21os.chdir(TARGET)
22subprocess.call(["git", "init"])
23subprocess.call(["git", "remote", "add", "origin", "git@github.com:KyleMayes/clang-sys.git"])
24subprocess.call(["git", "checkout", "--orphan", "gh-pages"])
25subprocess.call(["git", "add", "-A"])
26subprocess.call(["git", "commit", "-m", "\"Update documentation\""])
27subprocess.call(["git", "push", "origin", "gh-pages", "--force"])
28
29os.chdir("..")
30shutil.rmtree(TARGET)