Skip to content

Commit

Permalink
improved build sys
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Oberstein committed Nov 24, 2013
1 parent 6bca874 commit e9a23e3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
all: clean build
all:
@echo "Targets:"
@echo ""
@echo " clean Clean everything"
@echo " build Build AutobahnJS library"
@echo " publish Clean, build and publish to S3"
@echo ""

clean:
scons -uc
rm -rf ./build

build:
scons

publish: clean build
scons publish
25 changes: 19 additions & 6 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import os
import pkg_resources

taschenmesser = pkg_resources.resource_filename('taschenmesser', '..')
#taschenmesser = "../../infrequent/taschenmesser"
#taschenmesser = pkg_resources.resource_filename('taschenmesser', '..')
taschenmesser = "../../infrequent/taschenmesser"
env = Environment(tools = ['default', 'taschenmesser'],
toolpath = [taschenmesser],
ENV = os.environ)
Expand Down Expand Up @@ -72,15 +72,28 @@ artifacts = [ab,
#ab_extjs_min_gz,
]

## Generate MD5 checksums file
## Generate checksum files
##
checksums = env.MD5("build/CHECKSUM.MD5", artifacts)
uploads = artifacts + [checksums]
checksums = []
checksums.append(env.MD5("build/CHECKSUM.MD5", artifacts))
checksums.append(env.SHA1("build/CHECKSUM.SHA1", artifacts))
checksums.append(env.SHA256("build/CHECKSUM.SHA256", artifacts))

## The default target consists of all artifacts that
## would get published
##
uploads = artifacts + checksums
Default(uploads)

## Upload to Amazon S3
##
publish = env.S3("build/.S3UploadDone", uploads)
env['S3_BUCKET'] = 'autobahn'
env['S3_BUCKET_PREFIX'] = 'js/' # note the trailing slash!
env['S3_OBJECT_ACL'] = 'public-read'

## The uploaded stuff is always considered stale
##
publish = AlwaysBuild(env.S3("build/.S3UploadDone", uploads))

Depends(publish, uploads)
Alias("publish", publish)

0 comments on commit e9a23e3

Please sign in to comment.