Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit a3461f6

Browse files
committed
Merge remote-tracking branch 'upstream/develop-8.1' into merge-develop-8.1_09.02.2017
2 parents 62c0373 + 78a9e82 commit a3461f6

52 files changed

Lines changed: 1006 additions & 649 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,16 @@ all-win-%:
185185

186186
$(addsuffix -win,all config compile): %: %-x86
187187

188+
# Dummy rules for Windows x86-64 builds
189+
# TODO Replace with real rules
190+
config-win-x86_64:
191+
mkdir -p build-win-x86_64
192+
compile-win-x86_64:
193+
mkdir -p win-x86_64-bin
194+
all-win-x86_64:
195+
$(MAKE) config-win-x86_64
196+
$(MAKE) compile-win-x86_64
197+
188198
################################################################
189199
# Emscripten rules
190200
################################################################

buildbot.mk

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
# This file contains rules used by the LiveCode Buildbot installation at
1818
# <https://vulcan.livecode.com/>
19+
#
20+
# Tasks that may be run on Windows workers must be implemented in the
21+
# buildbot.py script.
1922

2023
# Load version information
2124
include version
@@ -28,48 +31,11 @@ GIT_VERSION=g$(shell git rev-parse --short HEAD)
2831
endif
2932

3033
################################################################
31-
# Configure with gyp
32-
################################################################
33-
34-
# Buildbot must set the variables PLATFORM and SUBPLATFORM
35-
36-
ifeq ($(BUILD_SUBPLATFORM),)
37-
CONFIG_TARGET = config-$(BUILD_PLATFORM)
38-
else
39-
CONFIG_TARGET = config-$(BUILD_PLATFORM)-$(BUILD_SUBPLATFORM)
40-
endif
41-
42-
config:
43-
$(MAKE) $(CONFIG_TARGET)
44-
45-
.PHONY: config
46-
47-
################################################################
48-
# Compile
49-
################################################################
50-
51-
# Buildbot must set the variables PLATFORM and SUBPLATFORM
52-
53-
ifeq ($(BUILD_SUBPLATFORM),)
54-
COMPILE_TARGET = compile-$(BUILD_PLATFORM)
55-
else
56-
COMPILE_TARGET = compile-$(BUILD_PLATFORM)-$(BUILD_SUBPLATFORM)
57-
endif
58-
59-
compile:
60-
$(MAKE) $(COMPILE_TARGET)
61-
62-
.PHONY: compile
63-
64-
################################################################
65-
# Archive / extract built binaries
34+
# Extract built binaries
6635
################################################################
6736

68-
bin-archive:
69-
tar -Jcvf $(BUILD_PLATFORM)-bin.tar.xz $(BUILD_PLATFORM)-bin
70-
7137
bin-extract:
72-
find . -maxdepth 1 -name '*-bin.tar.xz' -print0 | xargs -0 -n1 tar -xvf
38+
find . -maxdepth 1 -name '*-bin.tar.*' -exec tar -xvf '{}' ';'
7339

7440
################################################################
7541
# Installer generation

buildbot.py

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
#!/usr/bin/env python
2+
# Copyright (C) 2017 LiveCode Ltd.
3+
#
4+
# This file is part of LiveCode.
5+
#
6+
# LiveCode is free software; you can redistribute it and/or modify it under
7+
# the terms of the GNU General Public License v3 as published by the Free
8+
# Software Foundation.
9+
#
10+
# LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY
11+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13+
# for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with LiveCode. If not see <http://www.gnu.org/licenses/>.
17+
18+
# This file contains rules used by the LiveCode Buildbot installation
19+
# at <https://vulcan.livecode.com/>
20+
#
21+
# Tasks that may be run on Windows workers must be implemented in this
22+
# file. Other tasks may be implemented in buildbot.mk, and this
23+
# script redirects to that Makefile. All buildbot operations should
24+
# occur via this script, so that buildbot does not invoke
25+
# platform-specific tools directly.
26+
27+
import sys
28+
import subprocess
29+
import os
30+
import platform as _platform
31+
import shutil
32+
import tarfile
33+
34+
# The set of platforms for which this branch supports automated builds
35+
BUILDBOT_PLATFORMS = ('linux-x86', 'linux-x86_64', 'android-armv6', 'mac',
36+
'ios', 'win-x86', 'emscripten')
37+
# The set of build tasks that this branch supports
38+
BUILDBOT_TARGETS = ('config', 'compile', 'bin-archive', 'bin-extract',
39+
'dist-notes', 'dist-docs', 'dist-server', 'dist-tools', 'dist-upload',
40+
'distmac-archive', 'distmac-extract', 'distmac-disk')
41+
42+
SKIP_EXIT_STATUS = 88
43+
44+
def usage(exit_status):
45+
print(
46+
"""Perform continuous integration and release build steps.
47+
48+
Usage:
49+
buildbot.py TARGET
50+
51+
Environment variables:
52+
BUILD_EDITION LiveCode edition name ("commercial" or "community")
53+
BUILD_PLATFORM The target platform for build (e.g. "ios")
54+
BUILD_SUBPLATFORM The target subplatform (e.g. "iphoneos10.2")
55+
56+
Many tasks are deferred to the "buildbot.mk" Makefile and the
57+
"config.py" configuration script. Refer to these for other
58+
environment variables that may affect the build.
59+
""")
60+
61+
sys.exit(exit_status)
62+
63+
def error(message):
64+
print("ERROR: " + message)
65+
sys.exit(1)
66+
67+
def get_build_platform():
68+
platform = (os.environ.get('BUILD_PLATFORM'),
69+
os.environ.get('BUILD_SUBPLATFORM'))
70+
if platform[0] is None:
71+
error('You must set $BUILD_PLATFORM')
72+
return platform
73+
74+
def get_buildtype():
75+
return os.environ.get('BUILDTYPE', 'Debug')
76+
77+
def get_build_edition():
78+
return os.environ.get('BUILD_EDITION', 'community')
79+
80+
################################################################
81+
# Defer to buildbot.mk
82+
################################################################
83+
84+
def exec_buildbot_make(target):
85+
args = ["make", "-f", "buildbot.mk", target]
86+
print(' '.join(args))
87+
sys.exit(subprocess.call(args))
88+
89+
################################################################
90+
# Configure with gyp
91+
################################################################
92+
93+
def exec_configure(args):
94+
import config
95+
print('config.py ' + ' '.join(args))
96+
sys.exit(config.configure(args))
97+
98+
def do_configure():
99+
platform, subplatform = get_build_platform()
100+
101+
if platform == 'ios':
102+
if subplatform is None:
103+
error('You must set $BUILD_SUBPLATFORM for iOS builds')
104+
exec_configure(['--platform', 'ios',
105+
'--generator-output',
106+
'build-{}-{}/livecode'.format(platform, subplatform),
107+
'-Dtarget_sdk=' + subplatform])
108+
else:
109+
exec_configure(['--platform', platform])
110+
return 0
111+
112+
################################################################
113+
# Compile
114+
################################################################
115+
116+
def exec_make(target):
117+
args = ['make', target]
118+
print(' '.join(args))
119+
sys.exit(subprocess.call(args))
120+
121+
def exec_msbuild(platform):
122+
# Run the make.cmd batch script; it's run using Wine if this is
123+
# not actually a Windows system.
124+
cwd = 'build-' + platform
125+
126+
if _platform.system() == 'Windows':
127+
args = ['cmd', '/C', '..\\make.cmd']
128+
print(' '.join(args))
129+
sys.exit(subprocess.call(args, cwd=cwd))
130+
131+
else:
132+
args = ['wine', 'cmd', '/K', '..\\make.cmd']
133+
print(' '.join(args))
134+
exit_status = sys.exit(subprocess.call(args, cwd=cwd))
135+
136+
# Clean up any Wine processes that are still hanging around.
137+
# This is important in case the build fails.
138+
args = ['wineserver', '-k', '-w']
139+
subprocess.call(args, cwd=cwd)
140+
141+
sys.exit(exit_status)
142+
143+
def do_compile():
144+
platform, subplatform = get_build_platform()
145+
if platform.startswith('win-'):
146+
return exec_msbuild(platform)
147+
else:
148+
# Just defer to the top level Makefile
149+
if platform == 'ios':
150+
if subplatform is None:
151+
error('You must set $BUILD_SUBPLATFORM for iOS builds')
152+
target = 'compile-{}-{}'.format(platform, subplatform)
153+
else:
154+
target = 'compile-' + platform
155+
return exec_make(target)
156+
157+
################################################################
158+
# Archive / extract built binaries
159+
################################################################
160+
161+
def do_bin_archive():
162+
platform, subplatform = get_build_platform()
163+
bindir = platform + '-bin'
164+
shutil.make_archive(bindir, 'bztar', '.', bindir)
165+
166+
################################################################
167+
# Main entry point
168+
################################################################
169+
170+
def buildbot_task(target):
171+
# Check that this branch can actually be built for the specified platform
172+
platform, subplatform = get_build_platform()
173+
if not platform in BUILDBOT_PLATFORMS:
174+
print('Buildbot build for "{}" platform is not supported'.format(platform))
175+
sys.exit(SKIP_EXIT_STATUS)
176+
177+
# Check that this branch supports performing the requested buildbot task
178+
if not target in BUILDBOT_TARGETS:
179+
print('Buildbot build step "{}" is not supported'.format(target))
180+
sys.exit(SKIP_EXIT_STATUS)
181+
182+
if target == 'config':
183+
return do_configure()
184+
elif target == 'compile':
185+
return do_compile()
186+
elif target == 'bin-archive':
187+
return do_bin_archive()
188+
else:
189+
return exec_buildbot_make(target)
190+
191+
if __name__ == '__main__':
192+
if len(sys.argv) < 2:
193+
error("You must specify a buildbot target stage")
194+
sys.exit(buildbot_task(sys.argv[1]))

builder/builder_utilities.livecodescript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
script "BuilderUtilities"
22

33
constant kMergExtVersion = "2016-12-22"
4-
constant kTSNetVersion = "1.2.6"
4+
constant kTSNetVersion = "1.2.7"
55

66
local sEngineDir
77
local sWorkDir

0 commit comments

Comments
 (0)