|
57 | 57 | import mx_native
|
58 | 58 | import mx_sdk
|
59 | 59 | import mx_sdk_vm
|
| 60 | +import mx_sdk_vm_impl |
60 | 61 | import mx_subst
|
61 | 62 | import mx_unittest
|
62 | 63 | import mx_jardistribution
|
@@ -1302,11 +1303,13 @@ def build(self):
|
1302 | 1303 | pkg_name = prj.name
|
1303 | 1304 | with open(_PolyglotIsolateResourceBuildTask._template_file(prj.placeholder), 'r', encoding='utf-8') as f:
|
1304 | 1305 | file_content = f.read()
|
1305 |
| - file_content = (file_content.replace('${package}', pkg_name) |
1306 |
| - .replace('${languageId}', prj.language_id) |
1307 |
| - .replace('${resourceId}', prj.resource_id) |
1308 |
| - .replace('${os}', prj.os_name) |
1309 |
| - .replace('${arch}', prj.cpu_architecture)) |
| 1306 | + subst_eng = mx_subst.SubstitutionEngine() |
| 1307 | + subst_eng.register_no_arg('package', pkg_name) |
| 1308 | + subst_eng.register_no_arg('languageId', prj.language_id) |
| 1309 | + subst_eng.register_no_arg('resourceId', prj.resource_id) |
| 1310 | + subst_eng.register_no_arg('os', prj.os_name) |
| 1311 | + subst_eng.register_no_arg('arch', prj.cpu_architecture) |
| 1312 | + file_content = subst_eng.substitute(file_content) |
1310 | 1313 | target_file = _PolyglotIsolateResourceBuildTask._target_file(prj.source_gen_dir(), pkg_name)
|
1311 | 1314 | mx_util.ensure_dir_exists(dirname(target_file))
|
1312 | 1315 | with mx_util.SafeFileCreation(target_file) as sfc, open(sfc.tmpPath, 'w', encoding='utf-8') as f:
|
@@ -1347,10 +1350,8 @@ def register_polyglot_isolate_distributions(language_suite, register_project, re
|
1347 | 1350 | assert maven_group_id
|
1348 | 1351 | assert language_license
|
1349 | 1352 |
|
1350 |
| - polyglot_isolates_value = mx.get_opts().polyglot_isolates |
1351 |
| - if polyglot_isolates_value is None: |
1352 |
| - polyglot_isolates_value = os.getenv('POLYGLOT_ISOLATES') |
1353 |
| - if not polyglot_isolates_value or (polyglot_isolates_value != 'true' and language_id not in polyglot_isolates_value.split(',')): |
| 1353 | + polyglot_isolates_value = mx_sdk_vm_impl._parse_cmd_arg('polyglot_isolates') |
| 1354 | + if not polyglot_isolates_value or not (polyglot_isolates_value is True or (isinstance(polyglot_isolates_value, list) and language_id in polyglot_isolates_value)): |
1354 | 1355 | return False
|
1355 | 1356 |
|
1356 | 1357 | if not isinstance(language_license, list):
|
@@ -1394,7 +1395,6 @@ def _qualname(distribution_name):
|
1394 | 1395 | if build_for_current_platform:
|
1395 | 1396 | # 2. Register a project building the isolate library
|
1396 | 1397 | isolate_deps = [language_pom_distribution, 'graal-enterprise:TRUFFLE_ENTERPRISE']
|
1397 |
| - import mx_sdk_vm_impl |
1398 | 1398 | build_library = mx_sdk_vm_impl.PolyglotIsolateLibrary(language_suite, language_id, isolate_deps, isolate_build_options)
|
1399 | 1399 | register_project(build_library)
|
1400 | 1400 |
|
|
0 commit comments