Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

62 lines (47 sloc) 2.035 kb
#
# Licensed to Cloudkick, Inc ('Cloudkick') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# Cloudkick licenses this file to You 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.
#
EnsureSConsVersion(1, 1, 0)
import os
import re
from os.path import join as pjoin
opts = Variables('build.py')
env = Environment(options=opts,
ENV = os.environ.copy(),
tools=['default'])
#TODO: convert this to a configure builder, so it gets cached
def read_version(prefix, path):
version_re = re.compile("(.*)%s_VERSION_(?P<id>MAJOR|MINOR|PATCH)(\s+)=(\s+)(?P<num>\d)(.*)" % prefix)
versions = {}
fp = open(path, 'rb')
for line in fp.readlines():
m = version_re.match(line)
if m:
versions[m.group('id')] = int(m.group('num'))
fp.close()
return (versions['MAJOR'], versions['MINOR'], versions['PATCH'])
env['version_major'], env['version_minor'], env['version_patch'] = read_version('DISLOCATE', 'dislocate/version.js')
env['version_string'] = "%d.%d.%d" % (env['version_major'], env['version_minor'], env['version_patch'])
conf = Configure(env, custom_tests = {})
conf.env.AppendUnique(RPATH = conf.env.get('LIBPATH'))
env = conf.Finish()
Export("env")
source = SConscript("dislocate/SConscript")
jslint = [env.Command(str(x)+".jslint", x, ["jslint $SOURCE || exit 0"]) for x in source]
#env.AlwaysBuild(jslint)
Alias('jslint', jslint)
targets = []
env.Default(targets)
Jump to Line
Something went wrong with that request. Please try again.