forked from crossbario/autobahn-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tobias Oberstein
committed
Mar 26, 2014
1 parent
eac7ead
commit e19879f
Showing
2 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
_gen | ||
_build | ||
*.pyc | ||
.sconsign.dblite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
############################################################################### | ||
## | ||
## Copyright (C) 2014 Tavendo GmbH | ||
## | ||
## Licensed under the Apache License, Version 2.0 (the "License"); | ||
## you may not use this file except in compliance with the License. | ||
## You may obtain a copy of the License at | ||
## | ||
## http://www.apache.org/licenses/LICENSE-2.0 | ||
## | ||
## Unless required by applicable law or agreed to in writing, software | ||
## distributed under the License is distributed on an "AS IS" BASIS, | ||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
## See the License for the specific language governing permissions and | ||
## limitations under the License. | ||
## | ||
############################################################################### | ||
|
||
import os | ||
import json | ||
import pkg_resources | ||
|
||
taschenmesser = pkg_resources.resource_filename('taschenmesser', '..') | ||
#taschenmesser = "../../../infrequent/taschenmesser" | ||
env = Environment(tools = ['default', 'taschenmesser'], | ||
toolpath = [taschenmesser], | ||
ENV = os.environ) | ||
|
||
JAVADOCSDIR = '_gen' | ||
DOCSDIR = '_build' | ||
S3DIR = '_upload' | ||
|
||
## | ||
## Javasphinx Build | ||
## | ||
javadocs = env.Command(JAVADOCSDIR, [], "javasphinx-apidoc -u -o $TARGET ../Autobahn/src/") | ||
env.AlwaysBuild(javadocs) | ||
Clean(javadocs, JAVADOCSDIR) | ||
|
||
|
||
## | ||
## Sphinx Build | ||
## | ||
docs = env.Command(DOCSDIR, [], "sphinx-build -b html . $TARGET") | ||
env.AlwaysBuild(docs) | ||
Clean(docs, DOCSDIR) | ||
|
||
Depends(docs, javadocs) | ||
Default(docs) | ||
|
||
|
||
## | ||
## Upload to Amazon S3 | ||
## | ||
env['S3_RELPATH'] = DOCSDIR | ||
env['S3_BUCKET'] = 'autobahn.ws' | ||
env['S3_BUCKET_PREFIX'] = 'android/' # note the trailing slash! | ||
env['S3_OBJECT_ACL'] = 'public-read' | ||
|
||
|
||
uploaded = [] | ||
import fnmatch | ||
|
||
for root, dirnames, filenames in os.walk(DOCSDIR): | ||
if not root.endswith('.doctrees'): | ||
for filename in filenames: | ||
if not fnmatch.fnmatch(filename, '*.s3'): | ||
source = os.path.join(root, filename) | ||
target = os.path.join(S3DIR, source) | ||
uploaded.append(env.S3('{}.s3'.format(target), source)) | ||
|
||
Depends(uploaded, docs) | ||
Clean(docs, S3DIR) | ||
Alias("publish", uploaded) | ||
|