aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Baker <dbkr@users.noreply.github.com>2018-10-12 08:13:45 +0100
committerGitHub <noreply@github.com>2018-10-12 08:13:45 +0100
commitb2d91f55ece853ca1a398d3c6814f18a3f10bee0 (patch)
treef8e9a909d9bc075fb40b968fa4c478f42ebf9668
parent3cfcf1615dfe434e1aa10d5c904d537b159e1566 (diff)
parent82534708a35640672c812e7603a84a9f42c8b50c (diff)
Merge pull request #62 from matrix-org/dbkr/ci2
CircleCI Build Support
-rw-r--r--.circleci/config.yml27
-rw-r--r--Makefile2
-rwxr-xr-xexports.py18
3 files changed, 46 insertions, 1 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
new file mode 100644
index 0000000..0a891db
--- /dev/null
+++ b/.circleci/config.yml
@@ -0,0 +1,27 @@
+version: 2
+jobs:
+ build:
+ docker:
+ - image: trzeci/emscripten
+
+ working_directory: ~/repo
+
+ steps:
+ - checkout
+ - run:
+ name: Native Compile
+ command: make
+ - run:
+ name: Native Tests
+ command: make test
+ - run:
+ name: JS Compile
+ command: make js
+ - run:
+ name: Install JS Deps
+ working_directory: ~/repo/javascript
+ command: npm install
+ - run:
+ name: JS Tests
+ working_directory: ~/repo/javascript
+ command: npm run test
diff --git a/Makefile b/Makefile
index 8887172..91436ed 100644
--- a/Makefile
+++ b/Makefile
@@ -219,7 +219,7 @@ fuzzers: $(FUZZER_BINARIES) $(FUZZER_DEBUG_BINARIES)
.PHONY: fuzzers
$(JS_EXPORTED_FUNCTIONS): $(PUBLIC_HEADERS)
- perl -MJSON -ne '$$f{"_$$1"}=1 if /(olm_[^( ]*)\(/; END { @f=sort keys %f; print encode_json \@f }' $^ > $@.tmp
+ ./exports.py $^ > $@.tmp
mv $@.tmp $@
all: test js lib debug doc
diff --git a/exports.py b/exports.py
new file mode 100755
index 0000000..b37cbbb
--- /dev/null
+++ b/exports.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+
+import sys
+import re
+import json
+
+expr = re.compile(r"(olm_[^( ]*)\(")
+
+exports = set()
+
+for f in sys.argv[1:]:
+ with open(f) as fp:
+ for line in fp:
+ matches = expr.search(line)
+ if matches is not None:
+ exports.add('_%s' % (matches.group(1),))
+
+json.dump(sorted(exports), sys.stdout)