Nathaniel Manista | cbf21da | 2016-02-02 22:17:44 +0000 | [diff] [blame] | 1 | #!/usr/bin/env python2.7 |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 2 | # Copyright 2016, Google Inc. |
| 3 | # All rights reserved. |
| 4 | # |
| 5 | # Redistribution and use in source and binary forms, with or without |
| 6 | # modification, are permitted provided that the following conditions are |
| 7 | # met: |
| 8 | # |
| 9 | # * Redistributions of source code must retain the above copyright |
| 10 | # notice, this list of conditions and the following disclaimer. |
| 11 | # * Redistributions in binary form must reproduce the above |
| 12 | # copyright notice, this list of conditions and the following disclaimer |
| 13 | # in the documentation and/or other materials provided with the |
| 14 | # distribution. |
| 15 | # * Neither the name of Google Inc. nor the names of its |
| 16 | # contributors may be used to endorse or promote products derived from |
| 17 | # this software without specific prior written permission. |
| 18 | # |
| 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 20 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 21 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 22 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 23 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | |
| 31 | """Definition of targets to build artifacts.""" |
| 32 | |
Masood Malekghassemi | 0e12875 | 2016-07-15 14:36:54 -0700 | [diff] [blame] | 33 | import os.path |
Ken Payson | 5998cd7 | 2016-08-10 15:39:43 -0700 | [diff] [blame] | 34 | import random |
| 35 | import string |
Masood Malekghassemi | 0e12875 | 2016-07-15 14:36:54 -0700 | [diff] [blame] | 36 | import sys |
| 37 | |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 38 | import jobset |
| 39 | |
| 40 | |
| 41 | def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={}, |
Masood Malekghassemi | 027835f | 2016-07-15 22:31:50 -0700 | [diff] [blame] | 42 | flake_retries=0, timeout_retries=0, timeout_seconds=30*60): |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 43 | """Creates jobspec for a task running under docker.""" |
| 44 | environ = environ.copy() |
| 45 | environ['RUN_COMMAND'] = shell_command |
| 46 | |
| 47 | docker_args=[] |
siddharthshukla | 0589e53 | 2016-07-07 16:08:01 +0200 | [diff] [blame] | 48 | for k,v in environ.items(): |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 49 | docker_args += ['-e', '%s=%s' % (k, v)] |
| 50 | docker_env = {'DOCKERFILE_DIR': dockerfile_dir, |
Jan Tattermusch | 9835d4b | 2016-04-29 15:05:05 -0700 | [diff] [blame] | 51 | 'DOCKER_RUN_SCRIPT': 'tools/run_tests/dockerize/docker_run.sh', |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 52 | 'OUTPUT_DIR': 'artifacts'} |
| 53 | jobspec = jobset.JobSpec( |
Jan Tattermusch | 9835d4b | 2016-04-29 15:05:05 -0700 | [diff] [blame] | 54 | cmdline=['tools/run_tests/dockerize/build_and_run_docker.sh'] + docker_args, |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 55 | environ=docker_env, |
| 56 | shortname='build_artifact.%s' % (name), |
Masood Malekghassemi | 027835f | 2016-07-15 22:31:50 -0700 | [diff] [blame] | 57 | timeout_seconds=timeout_seconds, |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 58 | flake_retries=flake_retries, |
| 59 | timeout_retries=timeout_retries) |
| 60 | return jobspec |
| 61 | |
| 62 | |
| 63 | def create_jobspec(name, cmdline, environ=None, shell=False, |
Masood Malekghassemi | 027835f | 2016-07-15 22:31:50 -0700 | [diff] [blame] | 64 | flake_retries=0, timeout_retries=0, timeout_seconds=30*60): |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 65 | """Creates jobspec.""" |
| 66 | jobspec = jobset.JobSpec( |
| 67 | cmdline=cmdline, |
| 68 | environ=environ, |
| 69 | shortname='build_artifact.%s' % (name), |
Masood Malekghassemi | 027835f | 2016-07-15 22:31:50 -0700 | [diff] [blame] | 70 | timeout_seconds=timeout_seconds, |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 71 | flake_retries=flake_retries, |
| 72 | timeout_retries=timeout_retries, |
| 73 | shell=shell) |
| 74 | return jobspec |
| 75 | |
| 76 | |
Jan Tattermusch | e046f71 | 2016-02-18 16:06:10 -0800 | [diff] [blame] | 77 | _MACOS_COMPAT_FLAG = '-mmacosx-version-min=10.7' |
| 78 | |
| 79 | _ARCH_FLAG_MAP = { |
| 80 | 'x86': '-m32', |
| 81 | 'x64': '-m64' |
| 82 | } |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 83 | |
Nicolas "Pixel" Noble | 6a4e473 | 2016-02-20 01:30:57 +0100 | [diff] [blame] | 84 | |
Jan Tattermusch | 8640f92 | 2016-02-01 18:58:46 -0800 | [diff] [blame] | 85 | class PythonArtifact: |
| 86 | """Builds Python artifacts.""" |
| 87 | |
Ken Payson | 5998cd7 | 2016-08-10 15:39:43 -0700 | [diff] [blame] | 88 | def __init__(self, platform, arch, py_version): |
| 89 | self.name = 'python_%s_%s_%s' % (platform, arch, py_version) |
Jan Tattermusch | 8640f92 | 2016-02-01 18:58:46 -0800 | [diff] [blame] | 90 | self.platform = platform |
| 91 | self.arch = arch |
Ken Payson | 5998cd7 | 2016-08-10 15:39:43 -0700 | [diff] [blame] | 92 | self.labels = ['artifact', 'python', platform, arch, py_version] |
| 93 | self.py_version = py_version |
Jan Tattermusch | 8640f92 | 2016-02-01 18:58:46 -0800 | [diff] [blame] | 94 | |
| 95 | def pre_build_jobspecs(self): |
Masood Malekghassemi | 0e12875 | 2016-07-15 14:36:54 -0700 | [diff] [blame] | 96 | return [] |
Jan Tattermusch | 8640f92 | 2016-02-01 18:58:46 -0800 | [diff] [blame] | 97 | |
| 98 | def build_jobspec(self): |
Nicolas "Pixel" Noble | de808bb | 2016-02-18 01:13:14 +0100 | [diff] [blame] | 99 | environ = {} |
| 100 | if self.platform == 'linux': |
| 101 | if self.arch == 'x86': |
| 102 | environ['SETARCH_CMD'] = 'linux32' |
Masood Malekghassemi | 010eb48 | 2016-05-03 15:59:40 -0700 | [diff] [blame] | 103 | # Inside the manylinux container, the python installations are located in |
| 104 | # special places... |
Ken Payson | 5998cd7 | 2016-08-10 15:39:43 -0700 | [diff] [blame] | 105 | environ['PYTHON'] = '/opt/python/{}/bin/python'.format(self.py_version) |
| 106 | environ['PIP'] = '/opt/python/{}/bin/pip'.format(self.py_version) |
Masood Malekghassemi | 010eb48 | 2016-05-03 15:59:40 -0700 | [diff] [blame] | 107 | # Platform autodetection for the manylinux1 image breaks so we set the |
| 108 | # defines ourselves. |
| 109 | # TODO(atash) get better platform-detection support in core so we don't |
| 110 | # need to do this manually... |
Masood Malekghassemi | f4c70ca | 2016-05-05 19:14:05 -0700 | [diff] [blame] | 111 | environ['CFLAGS'] = '-DGPR_MANYLINUX1=1' |
Ken Payson | dd24c1e | 2016-07-13 14:18:33 -0700 | [diff] [blame] | 112 | environ['BUILD_HEALTH_CHECKING'] = 'TRUE' |
Ken Payson | cc17af1 | 2016-07-21 11:08:46 -0700 | [diff] [blame] | 113 | environ['BUILD_MANYLINUX_WHEEL'] = 'TRUE' |
Nicolas "Pixel" Noble | de808bb | 2016-02-18 01:13:14 +0100 | [diff] [blame] | 114 | return create_docker_jobspec(self.name, |
Masood Malekghassemi | 010eb48 | 2016-05-03 15:59:40 -0700 | [diff] [blame] | 115 | 'tools/dockerfile/grpc_artifact_python_manylinux_%s' % self.arch, |
Nicolas "Pixel" Noble | de808bb | 2016-02-18 01:13:14 +0100 | [diff] [blame] | 116 | 'tools/run_tests/build_artifact_python.sh', |
Masood Malekghassemi | 027835f | 2016-07-15 22:31:50 -0700 | [diff] [blame] | 117 | environ=environ, |
| 118 | timeout_seconds=60*60) |
Nicolas "Pixel" Noble | de808bb | 2016-02-18 01:13:14 +0100 | [diff] [blame] | 119 | elif self.platform == 'windows': |
Ken Payson | 5998cd7 | 2016-08-10 15:39:43 -0700 | [diff] [blame] | 120 | if 'Python27' in self.py_version or 'Python34' in self.py_version: |
| 121 | environ['EXT_COMPILER'] = 'mingw32' |
| 122 | else: |
| 123 | environ['EXT_COMPILER'] = 'msvc' |
| 124 | # For some reason, the batch script %random% always runs with the same |
| 125 | # seed. We create a random temp-dir here |
| 126 | dir = ''.join(random.choice(string.ascii_uppercase) for _ in range(10)) |
Nicolas "Pixel" Noble | de808bb | 2016-02-18 01:13:14 +0100 | [diff] [blame] | 127 | return create_jobspec(self.name, |
Nicolas "Pixel" Noble | 6a4e473 | 2016-02-20 01:30:57 +0100 | [diff] [blame] | 128 | ['tools\\run_tests\\build_artifact_python.bat', |
Ken Payson | 5998cd7 | 2016-08-10 15:39:43 -0700 | [diff] [blame] | 129 | self.py_version, |
| 130 | '32' if self.arch == 'x86' else '64', |
| 131 | dir |
Nicolas "Pixel" Noble | 6a4e473 | 2016-02-20 01:30:57 +0100 | [diff] [blame] | 132 | ], |
Ken Payson | 5998cd7 | 2016-08-10 15:39:43 -0700 | [diff] [blame] | 133 | environ=environ, |
Nicolas "Pixel" Noble | de808bb | 2016-02-18 01:13:14 +0100 | [diff] [blame] | 134 | shell=True) |
Jan Tattermusch | 8640f92 | 2016-02-01 18:58:46 -0800 | [diff] [blame] | 135 | else: |
Ken Payson | 5998cd7 | 2016-08-10 15:39:43 -0700 | [diff] [blame] | 136 | environ['PYTHON'] = self.py_version |
| 137 | environ['SKIP_PIP_INSTALL'] = 'TRUE' |
Nicolas "Pixel" Noble | de808bb | 2016-02-18 01:13:14 +0100 | [diff] [blame] | 138 | return create_jobspec(self.name, |
| 139 | ['tools/run_tests/build_artifact_python.sh'], |
| 140 | environ=environ) |
Jan Tattermusch | 8640f92 | 2016-02-01 18:58:46 -0800 | [diff] [blame] | 141 | |
| 142 | def __str__(self): |
| 143 | return self.name |
| 144 | |
| 145 | |
Jan Tattermusch | 4437213 | 2016-02-01 16:20:03 -0800 | [diff] [blame] | 146 | class RubyArtifact: |
| 147 | """Builds ruby native gem.""" |
| 148 | |
| 149 | def __init__(self, platform, arch): |
| 150 | self.name = 'ruby_native_gem_%s_%s' % (platform, arch) |
| 151 | self.platform = platform |
| 152 | self.arch = arch |
| 153 | self.labels = ['artifact', 'ruby', platform, arch] |
| 154 | |
| 155 | def pre_build_jobspecs(self): |
| 156 | return [] |
| 157 | |
| 158 | def build_jobspec(self): |
| 159 | if self.platform == 'windows': |
| 160 | raise Exception("Not supported yet") |
| 161 | else: |
| 162 | if self.platform == 'linux': |
| 163 | environ = {} |
| 164 | if self.arch == 'x86': |
Jan Tattermusch | 7cf8bf4 | 2016-02-03 13:41:07 -0800 | [diff] [blame] | 165 | environ['SETARCH_CMD'] = 'linux32' |
Jan Tattermusch | 4437213 | 2016-02-01 16:20:03 -0800 | [diff] [blame] | 166 | return create_docker_jobspec(self.name, |
| 167 | 'tools/dockerfile/grpc_artifact_linux_%s' % self.arch, |
| 168 | 'tools/run_tests/build_artifact_ruby.sh', |
| 169 | environ=environ) |
| 170 | else: |
| 171 | return create_jobspec(self.name, |
| 172 | ['tools/run_tests/build_artifact_ruby.sh']) |
| 173 | |
| 174 | |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 175 | class CSharpExtArtifact: |
| 176 | """Builds C# native extension library""" |
| 177 | |
| 178 | def __init__(self, platform, arch): |
| 179 | self.name = 'csharp_ext_%s_%s' % (platform, arch) |
| 180 | self.platform = platform |
| 181 | self.arch = arch |
| 182 | self.labels = ['artifact', 'csharp', platform, arch] |
| 183 | |
| 184 | def pre_build_jobspecs(self): |
| 185 | if self.platform == 'windows': |
| 186 | return [create_jobspec('prebuild_%s' % self.name, |
| 187 | ['tools\\run_tests\\pre_build_c.bat'], |
| 188 | shell=True, |
| 189 | flake_retries=5, |
| 190 | timeout_retries=2)] |
| 191 | else: |
| 192 | return [] |
| 193 | |
| 194 | def build_jobspec(self): |
| 195 | if self.platform == 'windows': |
| 196 | msbuild_platform = 'Win32' if self.arch == 'x86' else self.arch |
| 197 | return create_jobspec(self.name, |
| 198 | ['tools\\run_tests\\build_artifact_csharp.bat', |
| 199 | 'vsprojects\\grpc_csharp_ext.sln', |
| 200 | '/p:Configuration=Release', |
| 201 | '/p:PlatformToolset=v120', |
| 202 | '/p:Platform=%s' % msbuild_platform], |
| 203 | shell=True) |
| 204 | else: |
| 205 | environ = {'CONFIG': 'opt', |
| 206 | 'EMBED_OPENSSL': 'true', |
Craig Tiller | 71ea4a1 | 2016-02-04 15:06:41 -0800 | [diff] [blame] | 207 | 'EMBED_ZLIB': 'true', |
Jan Tattermusch | 60cbec7 | 2016-02-26 13:47:16 -0800 | [diff] [blame] | 208 | 'CFLAGS': '-DGPR_BACKWARDS_COMPATIBILITY_MODE', |
| 209 | 'LDFLAGS': ''} |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 210 | if self.platform == 'linux': |
| 211 | return create_docker_jobspec(self.name, |
| 212 | 'tools/dockerfile/grpc_artifact_linux_%s' % self.arch, |
Jan Tattermusch | 60cbec7 | 2016-02-26 13:47:16 -0800 | [diff] [blame] | 213 | 'tools/run_tests/build_artifact_csharp.sh', |
| 214 | environ=environ) |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 215 | else: |
Jan Tattermusch | 60cbec7 | 2016-02-26 13:47:16 -0800 | [diff] [blame] | 216 | archflag = _ARCH_FLAG_MAP[self.arch] |
| 217 | environ['CFLAGS'] += ' %s %s' % (archflag, _MACOS_COMPAT_FLAG) |
| 218 | environ['LDFLAGS'] += ' %s' % archflag |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 219 | return create_jobspec(self.name, |
| 220 | ['tools/run_tests/build_artifact_csharp.sh'], |
| 221 | environ=environ) |
| 222 | |
| 223 | def __str__(self): |
| 224 | return self.name |
| 225 | |
Jan Tattermusch | e046f71 | 2016-02-18 16:06:10 -0800 | [diff] [blame] | 226 | |
murgatroid99 | 673f65b | 2016-02-01 11:19:07 -0800 | [diff] [blame] | 227 | node_gyp_arch_map = { |
| 228 | 'x86': 'ia32', |
| 229 | 'x64': 'x64' |
| 230 | } |
| 231 | |
| 232 | class NodeExtArtifact: |
| 233 | """Builds Node native extension""" |
| 234 | |
| 235 | def __init__(self, platform, arch): |
| 236 | self.name = 'node_ext_{0}_{1}'.format(platform, arch) |
| 237 | self.platform = platform |
| 238 | self.arch = arch |
| 239 | self.gyp_arch = node_gyp_arch_map[arch] |
| 240 | self.labels = ['artifact', 'node', platform, arch] |
| 241 | |
| 242 | def pre_build_jobspecs(self): |
| 243 | return [] |
| 244 | |
| 245 | def build_jobspec(self): |
| 246 | if self.platform == 'windows': |
| 247 | return create_jobspec(self.name, |
| 248 | ['tools\\run_tests\\build_artifact_node.bat', |
| 249 | self.gyp_arch], |
| 250 | shell=True) |
| 251 | else: |
| 252 | if self.platform == 'linux': |
| 253 | return create_docker_jobspec( |
| 254 | self.name, |
| 255 | 'tools/dockerfile/grpc_artifact_linux_{}'.format(self.arch), |
| 256 | 'tools/run_tests/build_artifact_node.sh {}'.format(self.gyp_arch)) |
| 257 | else: |
| 258 | return create_jobspec(self.name, |
| 259 | ['tools/run_tests/build_artifact_node.sh', |
| 260 | self.gyp_arch]) |
| 261 | |
Stanley Cheung | bf74d69 | 2016-02-23 22:39:25 -0800 | [diff] [blame] | 262 | class PHPArtifact: |
| 263 | """Builds PHP PECL package""" |
Stanley Cheung | 5adb71f | 2016-02-13 00:03:02 -0800 | [diff] [blame] | 264 | |
| 265 | def __init__(self, platform, arch): |
Stanley Cheung | bf74d69 | 2016-02-23 22:39:25 -0800 | [diff] [blame] | 266 | self.name = 'php_pecl_package_{0}_{1}'.format(platform, arch) |
Stanley Cheung | 5adb71f | 2016-02-13 00:03:02 -0800 | [diff] [blame] | 267 | self.platform = platform |
| 268 | self.arch = arch |
| 269 | self.labels = ['artifact', 'php', platform, arch] |
| 270 | |
| 271 | def pre_build_jobspecs(self): |
| 272 | return [] |
| 273 | |
| 274 | def build_jobspec(self): |
Stanley Cheung | 80db5be | 2016-02-24 21:35:56 -0800 | [diff] [blame] | 275 | if self.platform == 'linux': |
| 276 | return create_docker_jobspec( |
| 277 | self.name, |
| 278 | 'tools/dockerfile/grpc_artifact_linux_{}'.format(self.arch), |
| 279 | 'tools/run_tests/build_artifact_php.sh') |
| 280 | else: |
| 281 | return create_jobspec(self.name, |
| 282 | ['tools/run_tests/build_artifact_php.sh']) |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 283 | |
Jan Tattermusch | e046f71 | 2016-02-18 16:06:10 -0800 | [diff] [blame] | 284 | class ProtocArtifact: |
| 285 | """Builds protoc and protoc-plugin artifacts""" |
| 286 | |
| 287 | def __init__(self, platform, arch): |
| 288 | self.name = 'protoc_%s_%s' % (platform, arch) |
| 289 | self.platform = platform |
| 290 | self.arch = arch |
| 291 | self.labels = ['artifact', 'protoc', platform, arch] |
| 292 | |
| 293 | def pre_build_jobspecs(self): |
| 294 | return [] |
| 295 | |
| 296 | def build_jobspec(self): |
| 297 | if self.platform != 'windows': |
| 298 | cxxflags = '-DNDEBUG %s' % _ARCH_FLAG_MAP[self.arch] |
Jan Tattermusch | e7b7d86 | 2016-02-19 09:49:35 -0800 | [diff] [blame] | 299 | ldflags = '%s' % _ARCH_FLAG_MAP[self.arch] |
| 300 | if self.platform != 'macos': |
Jan Tattermusch | 07591a5 | 2016-02-19 10:28:24 -0800 | [diff] [blame] | 301 | ldflags += ' -static-libgcc -static-libstdc++ -s' |
Jan Tattermusch | e046f71 | 2016-02-18 16:06:10 -0800 | [diff] [blame] | 302 | environ={'CONFIG': 'opt', |
| 303 | 'CXXFLAGS': cxxflags, |
| 304 | 'LDFLAGS': ldflags, |
| 305 | 'PROTOBUF_LDFLAGS_EXTRA': ldflags} |
| 306 | if self.platform == 'linux': |
| 307 | return create_docker_jobspec(self.name, |
| 308 | 'tools/dockerfile/grpc_artifact_protoc', |
| 309 | 'tools/run_tests/build_artifact_protoc.sh', |
| 310 | environ=environ) |
| 311 | else: |
Jan Tattermusch | e7b7d86 | 2016-02-19 09:49:35 -0800 | [diff] [blame] | 312 | environ['CXXFLAGS'] += ' -std=c++11 -stdlib=libc++ %s' % _MACOS_COMPAT_FLAG |
Jan Tattermusch | e046f71 | 2016-02-18 16:06:10 -0800 | [diff] [blame] | 313 | return create_jobspec(self.name, |
| 314 | ['tools/run_tests/build_artifact_protoc.sh'], |
| 315 | environ=environ) |
| 316 | else: |
Jan Tattermusch | 6d15982 | 2016-02-19 16:03:22 -0800 | [diff] [blame] | 317 | generator = 'Visual Studio 12 Win64' if self.arch == 'x64' else 'Visual Studio 12' |
| 318 | vcplatform = 'x64' if self.arch == 'x64' else 'Win32' |
| 319 | return create_jobspec(self.name, |
| 320 | ['tools\\run_tests\\build_artifact_protoc.bat'], |
| 321 | environ={'generator': generator, |
| 322 | 'Platform': vcplatform}) |
Jan Tattermusch | e046f71 | 2016-02-18 16:06:10 -0800 | [diff] [blame] | 323 | |
| 324 | def __str__(self): |
| 325 | return self.name |
| 326 | |
| 327 | |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 328 | def targets(): |
| 329 | """Gets list of supported targets""" |
murgatroid99 | 41a9e83 | 2016-02-03 09:47:35 -0800 | [diff] [blame] | 330 | return ([Cls(platform, arch) |
Jan Tattermusch | 6d15982 | 2016-02-19 16:03:22 -0800 | [diff] [blame] | 331 | for Cls in (CSharpExtArtifact, NodeExtArtifact, ProtocArtifact) |
murgatroid99 | 41a9e83 | 2016-02-03 09:47:35 -0800 | [diff] [blame] | 332 | for platform in ('linux', 'macos', 'windows') |
| 333 | for arch in ('x86', 'x64')] + |
Ken Payson | 5998cd7 | 2016-08-10 15:39:43 -0700 | [diff] [blame] | 334 | [PythonArtifact('linux', 'x86', 'cp27-cp27m'), |
| 335 | PythonArtifact('linux', 'x86', 'cp27-cp27mu'), |
| 336 | PythonArtifact('linux', 'x86', 'cp34-cp34m'), |
| 337 | PythonArtifact('linux', 'x86', 'cp35-cp35m'), |
| 338 | PythonArtifact('linux', 'x64', 'cp27-cp27m'), |
| 339 | PythonArtifact('linux', 'x64', 'cp27-cp27mu'), |
| 340 | PythonArtifact('linux', 'x64', 'cp34-cp34m'), |
| 341 | PythonArtifact('linux', 'x64', 'cp35-cp35m'), |
| 342 | PythonArtifact('macos', 'x64', 'python2.7'), |
| 343 | PythonArtifact('macos', 'x64', 'python3.4'), |
| 344 | PythonArtifact('macos', 'x64', 'python3.5'), |
| 345 | PythonArtifact('windows', 'x86', 'Python27_32bits'), |
| 346 | PythonArtifact('windows', 'x86', 'Python34_32bits'), |
| 347 | PythonArtifact('windows', 'x86', 'Python35_32bits'), |
| 348 | PythonArtifact('windows', 'x64', 'Python27'), |
| 349 | PythonArtifact('windows', 'x64', 'Python34'), |
| 350 | PythonArtifact('windows', 'x64', 'Python35'), |
murgatroid99 | 41a9e83 | 2016-02-03 09:47:35 -0800 | [diff] [blame] | 351 | RubyArtifact('linux', 'x86'), |
murgatroid99 | 33c808b | 2016-02-03 15:27:41 -0800 | [diff] [blame] | 352 | RubyArtifact('linux', 'x64'), |
Stanley Cheung | 5adb71f | 2016-02-13 00:03:02 -0800 | [diff] [blame] | 353 | RubyArtifact('macos', 'x64'), |
Stanley Cheung | bf74d69 | 2016-02-23 22:39:25 -0800 | [diff] [blame] | 354 | PHPArtifact('linux', 'x64'), |
| 355 | PHPArtifact('macos', 'x64')]) |