Skip to content

Commit

Permalink
[GR-17217] Add --no-license option for VM build.
Browse files Browse the repository at this point in the history
PullRequest: graal/4207
  • Loading branch information
gilles-duboscq committed Aug 20, 2019
2 parents b09b1f6 + 77d9a5a commit e734472
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions vm/mx.vm/mx_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ def _add_link(_dest, _target, _component=None):
'exclude': exclusion_list + [
exclude_base + '/COPYRIGHT',
exclude_base + '/LICENSE',
exclude_base + '/README.html',
exclude_base + '/THIRDPARTYLICENSEREADME.txt',
exclude_base + '/THIRDPARTYLICENSEREADME-JAVAFX.txt',
exclude_base + '/release',
exclude_base + '/bin/jvisualvm',
exclude_base + '/bin/jvisualvm.exe',
Expand Down Expand Up @@ -408,7 +411,12 @@ def _add_link(_dest, _target, _component=None):
_add(layout, '<jre_base>/lib/boot/', ['dependency:' + d for d in _component.boot_jars], _component, with_sources=True)
_add(layout, _component_base, ['dependency:' + d for d in _component.jar_distributions], _component, with_sources=True)
_add(layout, _component_base + 'builder/', ['dependency:' + d for d in _component.builder_jar_distributions], _component, with_sources=True)
_add(layout, _component_base, ['extracted-dependency:' + d for d in _component.support_distributions], _component)
_add(layout, _component_base, [{
'source_type': 'extracted-dependency',
'dependency': d,
'exclude': _component.license_files if mx.get_opts().no_licenses else [],
'path': None,
} for d in _component.support_distributions], _component)
if isinstance(_component, mx_sdk.GraalVmJvmciComponent):
_add(layout, '<jre_base>/lib/jvmci/', ['dependency:' + d for d in _component.jvmci_jars], _component, with_sources=True)

Expand All @@ -417,7 +425,10 @@ def _add_link(_dest, _target, _component=None):
else:
_jdk_jre_bin = '<jre_base>/bin/'

for _license in _component.license_files + _component.third_party_license_files:
_licenses = _component.third_party_license_files
if not mx.get_opts().no_licenses:
_licenses += _component.license_files
for _license in _licenses:
if mx.is_windows() or isinstance(self, mx.AbstractJARDistribution):
if _component_base == '<jdk_base>/':
pass # already in place from the support dist
Expand Down Expand Up @@ -607,6 +618,8 @@ def _get_graalvm_configuration(base_name, stage1=False):
for library_config in _get_library_configs(component):
if _skip_libraries(library_config):
components_set.add('s' + remove_lib_prefix_suffix(basename(library_config.destination)))
if mx.get_opts().no_licenses:
components_set.add('nolic')

# Use custom distribution name and base dir for registered vm configurations
vm_dist_name = None
Expand Down Expand Up @@ -2286,6 +2299,7 @@ def graalvm_vm_name(graalvm_dist, jdk_home):
mx.add_argument('--release-catalog', action='store', help='Change the default URL of the component catalog for releases.', default=None)
mx.add_argument('--extra-image-builder-argument', action='append', help='Add extra arguments to the image builder.', default=[])
mx.add_argument('--image-profile', action='append', help='Add a profile to be used while building a native image.', default=[])
mx.add_argument('--no-licenses', action='store_true', help='Do not add license files in the archives.')

if mx.get_os() == 'windows':
register_vm_config('ce', ['bjs', 'bnative-image', 'bnative-image-configure', 'bpolyglot', 'cmp', 'gvm', 'ins', 'js', 'nfi', 'ni', 'nil', 'poly', 'polynative', 'pro', 'rgx', 'snative-image-agent', 'svm', 'svml', 'tfl', 'vvm'], env_file='ce-win')
Expand Down

0 comments on commit e734472

Please sign in to comment.