From 149980a682edd4874968749565b690e0431e9115 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Thu, 27 Jul 2017 13:00:21 -0700 Subject: Update third party DMG dependencies These are now all pure and untouched from upstream. Change-Id: I0721258122bd72a89114bbdd3ab8f8ca7482a988 Reviewed-by: Kai Koehne Reviewed-by: Joerg Bornemann --- .../site-packages/biplist/qt_attribution.json | 4 +- .../lib/python2.7/site-packages/dmgbuild/core.py | 143 +++++++++++---------- .../site-packages/dmgbuild/qt_attribution.json | 4 +- .../lib/python2.7/site-packages/ds_store/buddy.py | 15 ++- .../site-packages/ds_store/qt_attribution.json | 4 +- .../lib/python2.7/site-packages/ds_store/store.py | 76 +++++++---- .../lib/python2.7/site-packages/mac_alias/alias.py | 56 +++++--- .../python2.7/site-packages/mac_alias/bookmark.py | 55 +++++--- .../lib/python2.7/site-packages/mac_alias/osx.py | 6 +- .../site-packages/mac_alias/qt_attribution.json | 4 +- 10 files changed, 221 insertions(+), 146 deletions(-) diff --git a/src/3rdparty/python/lib/python2.7/site-packages/biplist/qt_attribution.json b/src/3rdparty/python/lib/python2.7/site-packages/biplist/qt_attribution.json index 6b0df2d21..266e9dd89 100644 --- a/src/3rdparty/python/lib/python2.7/site-packages/biplist/qt_attribution.json +++ b/src/3rdparty/python/lib/python2.7/site-packages/biplist/qt_attribution.json @@ -5,8 +5,8 @@ "QtUsage": "Used in the qbs dmg module for building Apple disk images.", "Description": "biplist is a library for reading/writing binary plists.", "Homepage": "https://bitbucket.org/wooster/biplist", - "Version": "1.0.1", - "License": "BSD 3-clause "New" or "Revised" License", + "Version": "1.0.2", + "License": "BSD 3-clause \"New\" or \"Revised\" License", "LicenseId": "BSD-3-Clause", "LicenseFile": "LICENSE", "Copyright": "Copyright (c) 2010, Andrew Wooster" diff --git a/src/3rdparty/python/lib/python2.7/site-packages/dmgbuild/core.py b/src/3rdparty/python/lib/python2.7/site-packages/dmgbuild/core.py index 91f5e6c24..9ffcd3790 100644 --- a/src/3rdparty/python/lib/python2.7/site-packages/dmgbuild/core.py +++ b/src/3rdparty/python/lib/python2.7/site-packages/dmgbuild/core.py @@ -127,8 +127,9 @@ def load_json(filename, settings): settings['symlinks'] = symlinks settings['icon_locations'] = icon_locations -def build_dmg(filename, volume_name, settings_file=None, defines={}, lookForHiDPI=True): - settings = { +def build_dmg(filename, volume_name, settings_file=None, settings={}, + defines={}, lookForHiDPI=True): + options = { # Default settings 'filename': filename, 'volume_name': volume_name, @@ -199,26 +200,30 @@ def build_dmg(filename, volume_name, settings_file=None, defines={}, lookForHiDP if settings_file: # We now support JSON settings files using appdmg's format if settings_file.endswith('.json'): - load_json(settings_file, settings) + load_json(settings_file, options) else: - load_settings(settings_file, settings) + load_settings(settings_file, options) + + # Add any overrides + options.update(settings) # Set up the finder data - bounds = settings['window_rect'] + bounds = options['window_rect'] + bounds_string = '{{%s, %s}, {%s, %s}}' % (bounds[0][0], + bounds[0][1], + bounds[1][0], + bounds[1][1]) bwsp = { - b'ShowStatusBar': settings['show_status_bar'], - b'WindowBounds': b'{{%s, %s}, {%s, %s}}' % (bounds[0][0], - bounds[0][1], - bounds[1][0], - bounds[1][1]), - b'ContainerShowSidebar': False, - b'PreviewPaneVisibility': False, - b'SidebarWidth': settings['sidebar_width'], - b'ShowTabView': settings['show_tab_view'], - b'ShowToolbar': settings['show_toolbar'], - b'ShowPathbar': settings['show_pathbar'], - b'ShowSidebar': settings['show_sidebar'] + 'ShowStatusBar': options['show_status_bar'], + 'WindowBounds': bounds_string.encode('utf-8'), + 'ContainerShowSidebar': False, + 'PreviewPaneVisibility': False, + 'SidebarWidth': options['sidebar_width'], + 'ShowTabView': options['show_tab_view'], + 'ShowToolbar': options['show_toolbar'], + 'ShowPathbar': options['show_pathbar'], + 'ShowSidebar': options['show_sidebar'] } arrange_options = { @@ -233,25 +238,25 @@ def build_dmg(filename, volume_name, settings_file=None, defines={}, lookForHiDP } icvp = { - b'viewOptionsVersion': 1, - b'backgroundType': 0, - b'backgroundColorRed': 1.0, - b'backgroundColorGreen': 1.0, - b'backgroundColorBlue': 1.0, - b'gridOffsetX': float(settings['grid_offset'][0]), - b'gridOffsetY': float(settings['grid_offset'][1]), - b'gridSpacing': float(settings['grid_spacing']), - b'arrangeBy': str(arrange_options.get(settings['arrange_by'], 'none')), - b'showIconPreview': settings['show_icon_preview'] == True, - b'showItemInfo': settings['show_item_info'] == True, - b'labelOnBottom': settings['label_pos'] == 'bottom', - b'textSize': float(settings['text_size']), - b'iconSize': float(settings['icon_size']), - b'scrollPositionX': float(settings['scroll_position'][0]), - b'scrollPositionY': float(settings['scroll_position'][1]) + 'viewOptionsVersion': 1, + 'backgroundType': 0, + 'backgroundColorRed': 1.0, + 'backgroundColorGreen': 1.0, + 'backgroundColorBlue': 1.0, + 'gridOffsetX': float(options['grid_offset'][0]), + 'gridOffsetY': float(options['grid_offset'][1]), + 'gridSpacing': float(options['grid_spacing']), + 'arrangeBy': str(arrange_options.get(options['arrange_by'], 'none')), + 'showIconPreview': options['show_icon_preview'] == True, + 'showItemInfo': options['show_item_info'] == True, + 'labelOnBottom': options['label_pos'] == 'bottom', + 'textSize': float(options['text_size']), + 'iconSize': float(options['icon_size']), + 'scrollPositionX': float(options['scroll_position'][0]), + 'scrollPositionY': float(options['scroll_position'][1]) } - background = settings['background'] + background = options['background'] columns = { 'name': 'name', @@ -293,25 +298,25 @@ def build_dmg(filename, volume_name, settings_file=None, defines={}, lookForHiDP } lsvp = { - b'viewOptionsVersion': 1, - b'sortColumn': columns.get(settings['list_sort_by'], 'name'), - b'textSize': float(settings['list_text_size']), - b'iconSize': float(settings['list_icon_size']), - b'showIconPreview': settings['show_icon_preview'], - b'scrollPositionX': settings['list_scroll_position'][0], - b'scrollPositionY': settings['list_scroll_position'][1], - b'useRelativeDates': settings['list_use_relative_dates'], - b'calculateAllSizes': settings['list_calculate_all_sizes'], + 'viewOptionsVersion': 1, + 'sortColumn': columns.get(options['list_sort_by'], 'name'), + 'textSize': float(options['list_text_size']), + 'iconSize': float(options['list_icon_size']), + 'showIconPreview': options['show_icon_preview'], + 'scrollPositionX': options['list_scroll_position'][0], + 'scrollPositionY': options['list_scroll_position'][1], + 'useRelativeDates': options['list_use_relative_dates'], + 'calculateAllSizes': options['list_calculate_all_sizes'], } lsvp['columns'] = {} cndx = {} - for n, column in enumerate(settings['list_columns']): + for n, column in enumerate(options['list_columns']): cndx[column] = n - width = settings['list_column_widths'].get(column, + width = options['list_column_widths'].get(column, default_widths[column]) - asc = 'ascending' == settings['list_column_sort_directions'].get(column, + asc = 'ascending' == options['list_column_sort_directions'].get(column, default_sort_directions[column]) lsvp['columns'][columns[column]] = { @@ -322,7 +327,7 @@ def build_dmg(filename, volume_name, settings_file=None, defines={}, lookForHiDP 'ascending': asc } - n = len(settings['list_columns']) + n = len(options['list_columns']) for k in iterkeys(columns): if cndx.get(k, None) is None: cndx[k] = n @@ -339,7 +344,7 @@ def build_dmg(filename, volume_name, settings_file=None, defines={}, lookForHiDP n += 1 - default_view = settings['default_view'] + default_view = options['default_view'] views = { 'icon-view': b'icnv', 'column-view': b'clmv', @@ -350,14 +355,14 @@ def build_dmg(filename, volume_name, settings_file=None, defines={}, lookForHiDP icvl = (b'type', views.get(default_view, 'icnv')) include_icon_view_settings = default_view == 'icon-view' \ - or settings['include_icon_view_settings'] not in \ + or options['include_icon_view_settings'] not in \ ('auto', 'no', 0, False, None) include_list_view_settings = default_view in ('list-view', 'coverflow') \ - or settings['include_list_view_settings'] not in \ + or options['include_list_view_settings'] not in \ ('auto', 'no', 0, False, None) - filename = settings['filename'] - volume_name = settings['volume_name'] + filename = options['filename'] + volume_name = options['volume_name'] # Construct a writeable image to start with dirname, basename = os.path.split(os.path.realpath(filename)) @@ -366,7 +371,7 @@ def build_dmg(filename, volume_name, settings_file=None, defines={}, lookForHiDP writableFile = tempfile.NamedTemporaryFile(dir=dirname, prefix='.temp', suffix=basename) - total_size = settings['size'] + total_size = options['size'] if total_size == None: # Start with a size of 128MB - this way we don't need to calculate the # size of the background image, volume icon, and .DS_Store file (and @@ -377,7 +382,7 @@ def build_dmg(filename, volume_name, settings_file=None, defines={}, lookForHiDP def roundup(x, n): return x if x % n == 0 else x + n - x % n - for path in settings['files']: + for path in options['files']: if isinstance(path, tuple): path = path[0] @@ -389,7 +394,7 @@ def build_dmg(filename, volume_name, settings_file=None, defines={}, lookForHiDP else: total_size += roundup(os.lstat(path).st_size, 4096) - for name,target in iteritems(settings['symlinks']): + for name,target in iteritems(options['symlinks']): total_size += 4096 total_size = str(max(total_size / 1024, 1024)) + 'K' @@ -420,9 +425,9 @@ def build_dmg(filename, volume_name, settings_file=None, defines={}, lookForHiDP device = info['dev-entry'] mount_point = info['mount-point'] - icon = settings['icon'] + icon = options['icon'] if badge: - badge_icon = settings['badge_icon'] + badge_icon = options['badge_icon'] else: badge_icon = None icon_target_path = os.path.join(mount_point, '.VolumeIcon.icns') @@ -491,7 +496,7 @@ def build_dmg(filename, volume_name, settings_file=None, defines={}, lookForHiDP 'resources/' + background + '.tiff') path_in_image = os.path.join(mount_point, '.background.tiff') - with open(path_in_image, 'w') as f: + with open(path_in_image, 'wb') as f: f.write(tiffdata) else: raise ValueError('background file "%s" not found' % background) @@ -502,7 +507,7 @@ def build_dmg(filename, volume_name, settings_file=None, defines={}, lookForHiDP icvp['backgroundType'] = 2 icvp['backgroundImageAlias'] = biplist.Data(alias.to_bytes()) - for f in settings['files']: + for f in options['files']: if isinstance(f, tuple): f_in_image = os.path.join(mount_point, f[1]) f = f[0] @@ -513,13 +518,13 @@ def build_dmg(filename, volume_name, settings_file=None, defines={}, lookForHiDP # use system ditto command to preserve code signing, etc. subprocess.call(['/usr/bin/ditto', f, f_in_image]) - for name,target in iteritems(settings['symlinks']): + for name,target in iteritems(options['symlinks']): name_in_image = os.path.join(mount_point, name) os.symlink(target, name_in_image) - userfn = settings.get('create_hook', None) + userfn = options.get('create_hook', None) if callable(userfn): - userfn(mount_point, settings) + userfn(mount_point, options) image_dsstore = os.path.join(mount_point, '.DS_Store') @@ -534,7 +539,7 @@ def build_dmg(filename, volume_name, settings_file=None, defines={}, lookForHiDP d['.']['lsvp'] = lsvp d['.']['icvl'] = icvl - for k,v in iteritems(settings['icon_locations']): + for k,v in iteritems(options['icon_locations']): d[k]['Iloc'] = v # Delete .Trashes, if it gets created @@ -561,30 +566,30 @@ def build_dmg(filename, volume_name, settings_file=None, defines={}, lookForHiDP raise DMGError('Unable to shrink') key_prefix = {'UDZO': 'zlib', 'UDBZ': 'bzip2', 'ULFO': 'lzfse'} - compression_level = settings['compression_level'] - if settings['format'] in key_prefix and compression_level: + compression_level = options['compression_level'] + if options['format'] in key_prefix and compression_level: compression_args = [ '-imagekey', - key_prefix[settings['format']] + '-level=' + str(compression_level) + key_prefix[options['format']] + '-level=' + str(compression_level) ] else: compression_args = [] ret, output = hdiutil('convert', writableFile.name, - '-format', settings['format'], + '-format', options['format'], '-ov', '-o', filename, *compression_args) if ret: raise DMGError('Unable to convert') - if settings['license']: + if options['license']: ret, output = hdiutil('unflatten', '-quiet', filename, plist=False) if ret: raise DMGError('Unable to unflatten to add license') - licensing.add_license(filename, settings['license']) + licensing.add_license(filename, options['license']) ret, output = hdiutil('flatten', '-quiet', filename, plist=False) diff --git a/src/3rdparty/python/lib/python2.7/site-packages/dmgbuild/qt_attribution.json b/src/3rdparty/python/lib/python2.7/site-packages/dmgbuild/qt_attribution.json index 9f318e6d2..d9f97ae2c 100644 --- a/src/3rdparty/python/lib/python2.7/site-packages/dmgbuild/qt_attribution.json +++ b/src/3rdparty/python/lib/python2.7/site-packages/dmgbuild/qt_attribution.json @@ -4,8 +4,8 @@ "QDocModule": "qbs", "QtUsage": "Used in the qbs dmg module for building Apple disk images.", "Description": "macOS command line utility to build disk images", - "Homepage": "https://bitbucket.org/al45tair/dmgbuild", - "Version": "1.3.0~16", + "Homepage": "https://github.com/al45tair/dmgbuild", + "Version": "1.3.1", "License": "MIT License", "LicenseId": "MIT", "LicenseFile": "LICENSE", diff --git a/src/3rdparty/python/lib/python2.7/site-packages/ds_store/buddy.py b/src/3rdparty/python/lib/python2.7/site-packages/ds_store/buddy.py index a94ab6e22..320768cd3 100644 --- a/src/3rdparty/python/lib/python2.7/site-packages/ds_store/buddy.py +++ b/src/3rdparty/python/lib/python2.7/site-packages/ds_store/buddy.py @@ -158,7 +158,7 @@ class Allocator(object): count = self._root.read('>I')[0] for n in range(count): nlen = self._root.read('B')[0] - name = str(self._root.read(nlen)) + name = bytes(self._root.read(nlen)) value = self._root.read('>I')[0] self._toc[name] = value @@ -347,9 +347,8 @@ class Allocator(object): block.write('>I', len(keys)) for k in keys: - b = k.encode('utf-8') - block.write('B', len(b)) - block.write(b) + block.write('B', len(k)) + block.write(k) block.write('>I', self._toc[k]) # Free list @@ -445,17 +444,23 @@ class Allocator(object): def __getitem__(self, key): if not isinstance(key, (str, unicode)): raise TypeError('Keys must be of string type') + if not isinstance(key, bytes): + key = key.encode('latin_1') return self._toc[key] def __setitem__(self, key, value): if not isinstance(key, (str, unicode)): raise TypeError('Keys must be of string type') + if not isinstance(key, bytes): + key = key.encode('latin_1') self._toc[key] = value self._dirty = True def __delitem__(self, key): if not isinstance(key, (str, unicode)): raise TypeError('Keys must be of string type') + if not isinstance(key, bytes): + key = key.encode('latin_1') del self._toc[key] self._dirty = True @@ -464,7 +469,7 @@ class Allocator(object): def keys(self): return iterkeys(self._toc) - + def __iter__(self): return iterkeys(self._toc) diff --git a/src/3rdparty/python/lib/python2.7/site-packages/ds_store/qt_attribution.json b/src/3rdparty/python/lib/python2.7/site-packages/ds_store/qt_attribution.json index dda98b937..a4854d1ed 100644 --- a/src/3rdparty/python/lib/python2.7/site-packages/ds_store/qt_attribution.json +++ b/src/3rdparty/python/lib/python2.7/site-packages/ds_store/qt_attribution.json @@ -4,8 +4,8 @@ "QDocModule": "qbs", "QtUsage": "Used in the qbs dmg module for building Apple disk images.", "Description": "Manipulate Finder .DS_Store files from Python", - "Homepage": "https://bitbucket.org/al45tair/ds_store", - "Version": "1.1.0", + "Homepage": "https://github.com/al45tair/ds_store", + "Version": "1.1.2", "License": "MIT License", "LicenseId": "MIT", "LicenseFile": "LICENSE", diff --git a/src/3rdparty/python/lib/python2.7/site-packages/ds_store/store.py b/src/3rdparty/python/lib/python2.7/site-packages/ds_store/store.py index bf680d77a..b6f805b24 100644 --- a/src/3rdparty/python/lib/python2.7/site-packages/ds_store/store.py +++ b/src/3rdparty/python/lib/python2.7/site-packages/ds_store/store.py @@ -55,12 +55,12 @@ class BookmarkCodec(object): # .DS_Store file. This is really a convenience, and we currently only # support a tiny subset of the possible entry types. codecs = { - 'Iloc': ILocCodec, - 'bwsp': PlistCodec, - 'lsvp': PlistCodec, - 'lsvP': PlistCodec, - 'icvp': PlistCodec, - 'pBBk': BookmarkCodec + b'Iloc': ILocCodec, + b'bwsp': PlistCodec, + b'lsvp': PlistCodec, + b'lsvP': PlistCodec, + b'icvp': PlistCodec, + b'pBBk': BookmarkCodec } class DSStoreEntry(object): @@ -76,6 +76,10 @@ class DSStoreEntry(object): def __init__(self, filename, code, typecode, value=None): if str != bytes and type(filename) == bytes: filename = filename.decode('utf-8') + + if not isinstance(code, bytes): + code = code.encode('latin_1') + self.filename = filename self.code = code self.type = typecode @@ -187,25 +191,28 @@ class DSStoreEntry(object): utf16 = self.filename.encode('utf-16be') l = 4 + len(utf16) + 8 - if isinstance(self.type, (str, unicode)): + if isinstance(self.type, unicode): + entry_type = self.type.encode('latin_1') + value = self.value + elif isinstance(self.type, (bytes, str)): entry_type = self.type value = self.value else: - entry_type = 'blob' + entry_type = b'blob' value = self.type.encode(self.value) - if entry_type == 'bool': + if entry_type == b'bool': l += 1 - elif entry_type == 'long' or entry_type == 'shor': + elif entry_type == b'long' or entry_type == b'shor': l += 4 - elif entry_type == 'blob': + elif entry_type == b'blob': l += 4 + len(value) - elif entry_type == 'ustr': + elif entry_type == b'ustr': utf16 = value.encode('utf-16be') l += 4 + len(utf16) - elif entry_type == 'type': + elif entry_type == b'type': l += 4 - elif entry_type == 'comp' or entry_type == 'dutc': + elif entry_type == b'comp' or entry_type == b'dutc': l += 8 else: raise ValueError('Unknown type code "%s"' % entry_type) @@ -218,33 +225,38 @@ class DSStoreEntry(object): w = block.insert else: w = block.write - - if isinstance(self.type, (str, unicode)): + + if isinstance(self.type, unicode): + entry_type = self.type.encode('latin_1') + value = self.value + elif isinstance(self.type, (bytes, str)): entry_type = self.type value = self.value else: - entry_type = 'blob' + entry_type = b'blob' value = self.type.encode(self.value) - + utf16 = self.filename.encode('utf-16be') w(b'>I', len(utf16) // 2) w(utf16) - w(b'>4s4s', self.code.encode('utf-8'), entry_type.encode('utf-8')) + w(b'>4s4s', self.code, entry_type) - if entry_type == 'bool': + if entry_type == b'bool': w(b'>?', value) - elif entry_type == 'long' or entry_type == 'shor': + elif entry_type == b'long' or entry_type == b'shor': w(b'>I', value) - elif entry_type == 'blob': + elif entry_type == b'blob': w(b'>I', len(value)) w(value) - elif entry_type == 'ustr': + elif entry_type == b'ustr': utf16 = value.encode('utf-16be') w(b'>I', len(utf16) // 2) w(utf16) - elif entry_type == 'type': - w(b'>4s', value.encode('utf-8')) - elif entry_type == 'comp' or entry_type == 'dutc': + elif entry_type == b'type': + if isinstance(value, unicode): + value = value.encode('latin_1') + w(b'>4s', value) + elif entry_type == b'comp' or entry_type == b'dutc': w(b'>Q', value) else: raise ValueError('Unknown type code "%s"' % entry_type) @@ -1134,6 +1146,8 @@ class DSStore(object): # Find implementation def _find(self, node, filename_lc, code=None): + if not isinstance(code, bytes): + code = code.encode('latin_1') with self._get_block(node) as block: next_node, count = block.read(b'>II') if next_node: @@ -1189,14 +1203,17 @@ class DSStore(object): def __getitem__(self, code): if code is None: raise KeyError('no such key - [%s][None]' % self._filename) - + + if not isinstance(code, bytes): + code = code.encode('latin_1') + try: item = next(self._store.find(self._filename, code)) except StopIteration: raise KeyError('no such key - [%s][%s]' % (self._filename, code)) - if not isinstance(item.type, (str, unicode)): + if not isinstance(item.type, (bytes, str, unicode)): return item.value return (item.type, item.value) @@ -1205,6 +1222,9 @@ class DSStore(object): if code is None: raise KeyError('bad key - [%s][None]' % self._filename) + if not isinstance(code, bytes): + code = code.encode('latin_1') + codec = codecs.get(code, None) if codec: entry_type = codec diff --git a/src/3rdparty/python/lib/python2.7/site-packages/mac_alias/alias.py b/src/3rdparty/python/lib/python2.7/site-packages/mac_alias/alias.py index b35f4029b..512d2221b 100644 --- a/src/3rdparty/python/lib/python2.7/site-packages/mac_alias/alias.py +++ b/src/3rdparty/python/lib/python2.7/site-packages/mac_alias/alias.py @@ -14,6 +14,11 @@ import sys if sys.platform == 'darwin': from . import osx +try: + long +except NameError: + long = int + from .utils import * ALIAS_KIND_FILE = 0 @@ -30,6 +35,16 @@ ALIAS_EJECTABLE_DISK = 5 ALIAS_NO_CNID = 0xffffffff +def encode_utf8(s): + if isinstance(s, bytes): + return s + return s.encode('utf-8') + +def decode_utf8(s): + if isinstance(s, bytes): + return s.decode('utf-8') + return s + class AppleShareInfo (object): def __init__(self, zone=None, server=None, user=None): #: The AppleShare zone @@ -323,6 +338,8 @@ class Alias (object): """Create an :class:`Alias` that points at the specified file.""" if sys.platform != 'darwin': raise Exception('Not implemented (requires special support)') + + path = encode_utf8(path) a = Alias() @@ -337,7 +354,7 @@ class Alias (object): volinfo = osx.getattrlist(vol_path, attrs, 0) vol_crtime = volinfo[0] - vol_name = volinfo[1] + vol_name = encode_utf8(volinfo[1]) # Also grab various attributes of the file attrs = [(osx.ATTR_CMN_OBJTYPE @@ -357,7 +374,7 @@ class Alias (object): dirname, filename = os.path.split(path) - if dirname == '' or dirname == '.': + if dirname == b'' or dirname == b'.': dirname = os.getcwd() foldername = os.path.basename(dirname) @@ -382,10 +399,10 @@ class Alias (object): rel_path = os.path.relpath(path, vol_path) # Leave off the initial '/' if vol_path is '/' (no idea why) - if vol_path == '/': + if vol_path == b'/': a.target.posix_path = rel_path else: - a.target.posix_path = '/' + rel_path + a.target.posix_path = b'/' + rel_path # Construct the Carbon and CNID paths carbon_path = [] @@ -398,10 +415,11 @@ class Alias (object): attrs = [osx.ATTR_CMN_FILEID, 0, 0, 0, 0] info = osx.getattrlist(os.path.join(vol_path, head), attrs, 0) cnid_path.append(info[0]) - carbon_tail = tail.replace(':','/') + carbon_tail = tail.replace(b':',b'/') carbon_path.insert(0, carbon_tail) head, tail = os.path.split(head) - carbon_path = vol_name + ':' + ':\0'.join(carbon_path) + + carbon_path = vol_name + b':' + b':\0'.join(carbon_path) a.target.carbon_path = carbon_path a.target.cnid_path = cnid_path @@ -413,8 +431,8 @@ class Alias (object): pos = b.tell() b.write(struct.pack(b'>4shh', self.appinfo, 0, self.version)) - carbon_volname = self.volume.name.replace(':','/').encode('utf-8') - carbon_filename = self.target.filename.replace(':','/').encode('utf-8') + carbon_volname = encode_utf8(self.volume.name).replace(b':',b'/') + carbon_filename = encode_utf8(self.target.filename).replace(b':',b'/') voldate = (self.volume.creation_date - mac_epoch).total_seconds() crdate = (self.target.creation_date - mac_epoch).total_seconds() @@ -422,13 +440,13 @@ class Alias (object): # (so doing so is ridiculous, and nothing could rely on it). b.write(struct.pack(b'>h28pI2shI64pII4s4shhI2s10s', self.target.kind, - carbon_volname, voldate, + carbon_volname, int(voldate), self.volume.fs_type, self.volume.disk_type, self.target.folder_cnid, carbon_filename, self.target.cnid, - crdate, + int(crdate), self.target.creator_code, self.target.type_code, self.target.levels_from, @@ -439,8 +457,8 @@ class Alias (object): # Excuse the odd order; we're copying Finder if self.target.folder_name: - carbon_foldername = self.target.folder_name.replace(':','/')\ - .encode('utf-8') + carbon_foldername = encode_utf8(self.target.folder_name)\ + .replace(b':',b'/') b.write(struct.pack(b'>hh', TAG_CARBON_FOLDER_NAME, len(carbon_foldername))) b.write(carbon_foldername) @@ -461,7 +479,7 @@ class Alias (object): b.write(cnid_path) if self.target.carbon_path: - carbon_path=self.target.carbon_path.encode('utf-8') + carbon_path=encode_utf8(self.target.carbon_path) b.write(struct.pack(b'>hh', TAG_CARBON_PATH, len(carbon_path))) b.write(carbon_path) @@ -490,7 +508,7 @@ class Alias (object): b.write(b'\0') if self.volume.driver_name: - driver_name = self.volume.driver_name.encode('utf-8') + driver_name = encode_utf8(self.volume.driver_name) b.write(struct.pack(b'>hh', TAG_DRIVER_NAME, len(driver_name))) b.write(driver_name) @@ -511,20 +529,22 @@ class Alias (object): if len(self.volume.network_mount_info) & 1: b.write(b'\0') - utf16 = self.target.filename.replace(':','/').encode('utf-16-be') + utf16 = decode_utf8(self.target.filename)\ + .replace(':','/').encode('utf-16-be') b.write(struct.pack(b'>hhh', TAG_UNICODE_FILENAME, len(utf16) + 2, len(utf16) // 2)) b.write(utf16) - utf16 = self.volume.name.replace(':','/').encode('utf-16-be') + utf16 = decode_utf8(self.volume.name)\ + .replace(':','/').encode('utf-16-be') b.write(struct.pack(b'>hhh', TAG_UNICODE_VOLUME_NAME, len(utf16) + 2, len(utf16) // 2)) b.write(utf16) if self.target.posix_path: - posix_path = self.target.posix_path.encode('utf-8') + posix_path = encode_utf8(self.target.posix_path) b.write(struct.pack(b'>hh', TAG_POSIX_PATH, len(posix_path))) b.write(posix_path) @@ -532,7 +552,7 @@ class Alias (object): b.write(b'\0') if self.volume.posix_path: - posix_path = self.volume.posix_path.encode('utf-8') + posix_path = encode_utf8(self.volume.posix_path) b.write(struct.pack(b'>hh', TAG_POSIX_PATH_TO_MOUNTPOINT, len(posix_path))) b.write(posix_path) diff --git a/src/3rdparty/python/lib/python2.7/site-packages/mac_alias/bookmark.py b/src/3rdparty/python/lib/python2.7/site-packages/mac_alias/bookmark.py index 41b9acf35..409ed8297 100644 --- a/src/3rdparty/python/lib/python2.7/site-packages/mac_alias/bookmark.py +++ b/src/3rdparty/python/lib/python2.7/site-packages/mac_alias/bookmark.py @@ -4,7 +4,7 @@ # for the old-fashioned alias format. The details of this format were # reverse engineered; some things are still not entirely clear. # -from __future__ import unicode_literals +from __future__ import unicode_literals, print_function import struct import uuid @@ -13,11 +13,26 @@ import os import sys import pprint -from urlparse import urljoin +try: + from urlparse import urljoin +except ImportError: + from urllib.parse import urljoin if sys.platform == 'darwin': from . import osx +def iteritems(x): + return x.iteritems() + +try: + unicode +except NameError: + unicode = str + long = int + xrange = range + def iteritems(x): + return x.items() + from .utils import * BMK_DATA_TYPE_MASK = 0xffffff00 @@ -144,7 +159,7 @@ kBookmarkFileCreationDate = 0x1040 # = 0x1055 # ? # = 0x1056 # ? # = 0x1101 # ? -# = 0x1102 # ? +# = 0x1102 # ? kBookmarkTOCPath = 0x2000 # A list of (TOC id, ?) pairs kBookmarkVolumePath = 0x2002 kBookmarkVolumeURL = 0x2005 @@ -292,23 +307,20 @@ class Bookmark (object): elif dtype == BMK_NULL: return None - print 'Unknown data type %08x' % typecode + print('Unknown data type %08x' % typecode) return (typecode, databytes) @classmethod def from_bytes(cls, data): """Create a :class:`Bookmark` given byte data.""" - if isinstance(data, bytearray): - data = bytes(data) - if len(data) < 16: raise ValueError('Not a bookmark file (too short)') magic,size,dummy,hdrsize = struct.unpack(b'<4sIII', data[0:16]) - if magic != 'book': - raise ValueError('Not a bookmark file (bad magic)') + if magic != b'book': + raise ValueError('Not a bookmark file (bad magic) %r' % magic) if hdrsize < 16: raise ValueError('Not a bookmark file (header size too short)') @@ -445,7 +457,7 @@ class Bookmark (object): ioffset = offset + 8 + len(item) * 8 result = [struct.pack(b' -1: sz = sz[:nul] return sz.decode('utf-8') @@ -757,6 +757,8 @@ def _get_errno(): return __error().contents.value def getattrlist(path, attrs, options): + if not isinstance(path, bytes): + path = path.encode('utf-8') attrs = list(attrs) if attrs[1]: attrs[1] |= ATTR_VOL_INFO @@ -805,6 +807,8 @@ def fgetattrlist(fd, attrs, options): return _decode_attrlist_result(buf, attrs, options) def statfs(path): + if not isinstance(path, bytes): + path = path.encode('utf-8') result = struct_statfs() ret = _statfs(path, byref(result)) if ret < 0: diff --git a/src/3rdparty/python/lib/python2.7/site-packages/mac_alias/qt_attribution.json b/src/3rdparty/python/lib/python2.7/site-packages/mac_alias/qt_attribution.json index 562440cd6..2c4bdccc5 100644 --- a/src/3rdparty/python/lib/python2.7/site-packages/mac_alias/qt_attribution.json +++ b/src/3rdparty/python/lib/python2.7/site-packages/mac_alias/qt_attribution.json @@ -4,8 +4,8 @@ "QDocModule": "qbs", "QtUsage": "Used in the qbs dmg module for building Apple disk images.", "Description": "Generate/parse Mac OS Alias records from Python", - "Homepage": "https://bitbucket.org/al45tair/mac_alias", - "Version": "2.0.1", + "Homepage": "https://github.com/al45tair/mac_alias", + "Version": "2.0.4", "License": "MIT License", "LicenseId": "MIT", "LicenseFile": "LICENSE", -- cgit v1.2.3 From 548790931ccac858d9244e4c5546ef1664b0dc4a Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 28 Jul 2017 11:41:26 +0200 Subject: Revert change to module merger that broke overriding list properties ... from the command line. The original change was part of 41595d0cf8, but it is not clear anymore exactly which problem it was supposed to solve. It may well be that it only worked around a temporary problem that no longer existed when the patch was merged. Task-number: QBS-1152 Change-Id: I7e89cf4bf64ef5c8dae5e598154403d4909969c0 Reviewed-by: Joerg Bornemann --- src/lib/corelib/language/modulemerger.cpp | 5 +---- .../module-property-overrides-per-product.qbs | 3 +++ tests/auto/language/tst_language.cpp | 26 +++++++++++++++++----- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/lib/corelib/language/modulemerger.cpp b/src/lib/corelib/language/modulemerger.cpp index ea79d6562..9dc066bf1 100644 --- a/src/lib/corelib/language/modulemerger.cpp +++ b/src/lib/corelib/language/modulemerger.cpp @@ -223,11 +223,8 @@ void ModuleMerger::insertProperties(Item::PropertyMap *dst, Item *srcItem, Prope for (Item::PropertyMap::const_iterator it = srcItem->properties().constBegin(); it != srcItem->properties().constEnd(); ++it) { const ValuePtr &srcVal = it.value(); - if (srcVal->type() == Value::ItemValueType - || it.key() == QLatin1String("_qbs_sourceDir")) { + if (srcVal->type() != Value::JSSourceValueType) continue; - } - const PropertyDeclaration srcDecl = srcItem->propertyDeclaration(it.key()); if (!srcDecl.isValid() || srcDecl.isScalar() != (type == ScalarProperties)) continue; diff --git a/tests/auto/language/testdata/module-property-overrides-per-product.qbs b/tests/auto/language/testdata/module-property-overrides-per-product.qbs index e58f563a0..3ff811080 100644 --- a/tests/auto/language/testdata/module-property-overrides-per-product.qbs +++ b/tests/auto/language/testdata/module-property-overrides-per-product.qbs @@ -4,13 +4,16 @@ Project { Product { Depends { name: "dummy" } name: "a" + property stringList rpaths: dummy.rpaths } Product { Depends { name: "dummy" } name: "b" + property stringList rpaths: dummy.rpaths } Product { Depends { name: "dummy" } name: "c" + property stringList rpaths: dummy.rpaths } } diff --git a/tests/auto/language/tst_language.cpp b/tests/auto/language/tst_language.cpp index fdcd98da8..380d23669 100644 --- a/tests/auto/language/tst_language.cpp +++ b/tests/auto/language/tst_language.cpp @@ -1511,9 +1511,11 @@ void TestLanguage::modulePropertyOverridesPerProduct() try { SetupProjectParameters params = defaultParameters; params.setOverriddenValues({ + std::make_pair("modules.dummy.rpaths", QStringList({"/usr/lib"})), std::make_pair("modules.dummy.someString", "m"), std::make_pair("products.b.dummy.someString", "b"), - std::make_pair("products.c.dummy.someString", "c") + std::make_pair("products.c.dummy.someString", "c"), + std::make_pair("products.c.dummy.rpaths", QStringList({"/home", "/tmp"})) }); params.setProjectFilePath( testProject("module-property-overrides-per-product.qbs")); @@ -1528,14 +1530,28 @@ void TestLanguage::modulePropertyOverridesPerProduct() const ResolvedProductConstPtr c = products.value("c"); QVERIFY(!!c); - const auto propertyValue = [](const ResolvedProductConstPtr &p) -> QString + const auto stringPropertyValue = [](const ResolvedProductConstPtr &p) -> QString { return p->moduleProperties->moduleProperty("dummy", "someString").toString(); }; + const auto listPropertyValue = [](const ResolvedProductConstPtr &p) -> QStringList + { + return p->moduleProperties->moduleProperty("dummy", "rpaths").toStringList(); + }; + const auto productPropertyValue = [](const ResolvedProductConstPtr &p) -> QStringList + { + return p->productProperties.value("rpaths").toStringList(); + }; - QCOMPARE(propertyValue(a), QString("m")); - QCOMPARE(propertyValue(b), QString("b")); - QCOMPARE(propertyValue(c), QString("c")); + QCOMPARE(stringPropertyValue(a), QString("m")); + QCOMPARE(stringPropertyValue(b), QString("b")); + QCOMPARE(stringPropertyValue(c), QString("c")); + QCOMPARE(listPropertyValue(a), QStringList({"/usr/lib"})); + QCOMPARE(listPropertyValue(b), QStringList({"/usr/lib"})); + QCOMPARE(listPropertyValue(c), QStringList({"/home", "/tmp"})); + QCOMPARE(listPropertyValue(a), productPropertyValue(a)); + QCOMPARE(listPropertyValue(b), productPropertyValue(b)); + QCOMPARE(listPropertyValue(c), productPropertyValue(c)); } catch (const ErrorInfo &e) { exceptionCaught = true; -- cgit v1.2.3 From bc26762e48732a88cd412430faade77ffc2c8f60 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 31 Jul 2017 12:06:39 +0200 Subject: Autotests: Ensure that waitForNewTimestamp() always terminates Apparently, the abovementioned function has been observed to run seemingly forever in certain environments. Fix that by no longer requiring an actual file timestamp change for it to terminate. Task-number: QBS-1169 Change-Id: I9798309d179b0b6f8857ca8a4a5c1236ca162c27 Reviewed-by: Joerg Bornemann --- tests/auto/shared.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/auto/shared.h b/tests/auto/shared.h index 36a15ca74..6a0caaa3c 100644 --- a/tests/auto/shared.h +++ b/tests/auto/shared.h @@ -123,14 +123,19 @@ inline void waitForNewTimestamp(const QString &testDir) if (!f1.open()) qFatal("Failed to open temp file"); const QDateTime initialTime = QFileInfo(f1).lastModified(); - while (true) { - QTest::qWait(50); + int totalMsPassed = 0; + while (totalMsPassed <= 2000) { + static const int increment = 50; + QTest::qWait(increment); + totalMsPassed += increment; QTemporaryFile f2(nameTemplate); if (!f2.open()) qFatal("Failed to open temp file"); if (QFileInfo(f2).lastModified() > initialTime) - break; + return; } + qWarning("Got no new timestamp after two seconds, going ahead anyway. Subsequent " + "test failure might not be genuine."); } } -- cgit v1.2.3 From 140d26dc7d8efc673fb77768a19242ae81ae334f Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 31 Jul 2017 15:05:35 +0200 Subject: Cpp module: Fix mingw's setupBuildEnvironment script The host OS is not necessarily Windows. Change-Id: Ie17349f215cbd3acd252755387a668b794ff2cbe Reviewed-by: Joerg Bornemann --- share/qbs/modules/cpp/windows-mingw.qbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/qbs/modules/cpp/windows-mingw.qbs b/share/qbs/modules/cpp/windows-mingw.qbs index d74588c71..f76fb424e 100644 --- a/share/qbs/modules/cpp/windows-mingw.qbs +++ b/share/qbs/modules/cpp/windows-mingw.qbs @@ -53,13 +53,13 @@ GenericGCC { property path windresPath: { return toolchainPathPrefix + windresName } setupBuildEnvironment: { - var v = new ModUtils.EnvironmentVariable("PATH", ";", true); + var v = new ModUtils.EnvironmentVariable("PATH", qbs.pathListSeparator, true); v.prepend(toolchainInstallPath); v.set(); } setupRunEnvironment: { - var v = new ModUtils.EnvironmentVariable("PATH", ";", true); + var v = new ModUtils.EnvironmentVariable("PATH", qbs.pathListSeparator, true); v.prepend(toolchainInstallPath); v.set(); } -- cgit v1.2.3 From de5db8cfb87f7c54fddd6d9ecc124cd33201de2a Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 31 Jul 2017 15:01:37 +0200 Subject: cpp module: Fix the GCC compiler path probe The toolchain prefix was missing in the compiler file name, which lead to interesting effects, as the probe would potentially detect a wrong toolchain install path. Change-Id: I09fe63c5b9860506fe86ade60a74851d428438c8 Reviewed-by: Joerg Bornemann --- share/qbs/modules/cpp/GenericGCC.qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs index b25de28c0..8a83f9d5e 100644 --- a/share/qbs/modules/cpp/GenericGCC.qbs +++ b/share/qbs/modules/cpp/GenericGCC.qbs @@ -46,7 +46,7 @@ CppModule { Probes.BinaryProbe { id: compilerPathProbe condition: !toolchainInstallPath - names: [compilerName] + names: [toolchainPrefix ? toolchainPrefix + compilerName : compilerName] } // Find the version as early as possible in case other things depend on it, -- cgit v1.2.3 From 1eff54864642c459263de9653e26d9f56af04ce9 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 1 Aug 2017 18:10:36 +0200 Subject: Do not access the bundle module unconditionally It is a mistake that the NativeBinary item currently pulls in the bundle module unconditionally (and also that the module is enabled everywhere). We want to change that. Prepare for the change by removing all unconditional accesses to the module's properties. Change-Id: If57b8222c1a0e2b09c33520882446fa71401f1f1 Reviewed-by: Joerg Bornemann --- examples/code-generator/code-generator.qbs | 2 +- examples/install-bundle/install-bundle.qbs | 14 ++++++----- qbs-resources/imports/QbsLibrary.qbs | 7 ++++-- share/qbs/modules/cli/CLIModule.qbs | 8 ++++--- src/app/config-ui/config-ui.qbs | 6 +++-- .../app-without-sources/app-without-sources.qbs | 2 +- .../change-dependent-lib/change-dependent-lib.qbs | 6 ++++- .../disabled_install_group.qbs | 2 +- .../export-item-with-group.qbs | 2 +- .../api/testdata/export-simple/export-simple.qbs | 5 +++- .../auto/api/testdata/is-runnable/is-runnable.qbs | 5 +++- .../link-dynamiclibs-staticlibs.qbs | 10 ++++++-- .../testdata/link-dynamiclibs/link-dynamiclibs.qbs | 20 ++++++++++++---- .../link-staticlibs-dynamiclibs.qbs | 10 ++++++-- .../new-output-artifact-in-dependency.qbs | 5 +++- .../productNameWithDots/productNameWithDots.qbs | 7 ++---- tests/auto/api/testdata/qt5-plugin/qt5-plugin.qbs | 5 +++- tests/auto/api/testdata/rename-product/rename.qbs | 5 +++- .../api/testdata/rename-target-artifact/rename.qbs | 5 +++- .../auto/blackbox/testdata-java/java/vehicles.qbs | 5 +++- .../plugin-meta-data/plugin-meta-data.qbs | 5 +++- tests/auto/blackbox/testdata/assembly/assembly.qbs | 20 ++++++++++++---- tests/auto/blackbox/testdata/clean/clean.qbs | 5 +++- .../testdata/command-file/command-file.qbs | 5 +++- .../testdata/external-libs/external-libs.qbs | 10 ++++++-- tests/auto/blackbox/testdata/ld/ld.qbs | 3 +-- .../testdata/loadablemodule/loadablemodule.qbs | 9 ++++---- .../overrideProjectProperties/helper_lib.qbs | 5 +++- .../product-dependencies-by-type.qbs | 5 +++- .../testdata/propertyChanges/propertyChanges.qbs | 5 +++- .../separate-debug-info/separate-debug-info.qbs | 27 +++++++++++++++++----- .../testdata/symbolLinkMode/symbolLinkMode.qbs | 12 ++++++---- 32 files changed, 176 insertions(+), 66 deletions(-) diff --git a/examples/code-generator/code-generator.qbs b/examples/code-generator/code-generator.qbs index f242fb61e..b9aef12b6 100644 --- a/examples/code-generator/code-generator.qbs +++ b/examples/code-generator/code-generator.qbs @@ -40,8 +40,8 @@ Project { // A code generator that outputs a "Hello World" C++ program. CppApplication { name: "hwgen" + consoleApplication: true files: ["hwgen.cpp"] - bundle.isBundle: false } // Generate and build a hello-world application. diff --git a/examples/install-bundle/install-bundle.qbs b/examples/install-bundle/install-bundle.qbs index 5659f3c72..3151f5517 100644 --- a/examples/install-bundle/install-bundle.qbs +++ b/examples/install-bundle/install-bundle.qbs @@ -8,7 +8,8 @@ Project { Depends { name: "Qt"; submodules: ["core", "gui", "widgets"] } name: "window" - targetName: bundle.isBundle ? "Window" : "window" + property bool isBundle: qbs.targetOS.contains("darwin") && bundle.isBundle + targetName: isBundle ? "Window" : "window" files: [ "main.cpp", "assetcatalog1.xcassets", @@ -19,9 +20,9 @@ Project { ] Group { - fileTagsFilter: bundle.isBundle ? ["bundle.content"] : ["application"] + fileTagsFilter: isBundle ? ["bundle.content"] : ["application"] qbs.install: true - qbs.installDir: bundle.isBundle ? "Applications" : (qbs.targetOS.contains("windows") ? "" : "bin") + qbs.installDir: isBundle ? "Applications" : (qbs.targetOS.contains("windows") ? "" : "bin") qbs.installSourceBase: product.buildDirectory } } @@ -30,13 +31,14 @@ Project { Depends { name: "cpp" } name: "coreutils" - targetName: bundle.isBundle ? "CoreUtils" : "coreutils" + property bool isBundle: qbs.targetOS.contains("darwin") && bundle.isBundle + targetName: isBundle ? "CoreUtils" : "coreutils" files: ["coreutils.cpp", "coreutils.h"] Group { - fileTagsFilter: bundle.isBundle ? ["bundle.content"] : ["dynamiclibrary", "dynamiclibrary_symlink", "dynamiclibrary_import"] + fileTagsFilter: isBundle ? ["bundle.content"] : ["dynamiclibrary", "dynamiclibrary_symlink", "dynamiclibrary_import"] qbs.install: true - qbs.installDir: bundle.isBundle ? "Library/Frameworks" : (qbs.targetOS.contains("windows") ? "" : "lib") + qbs.installDir: isBundle ? "Library/Frameworks" : (qbs.targetOS.contains("windows") ? "" : "lib") qbs.installSourceBase: product.buildDirectory } } diff --git a/qbs-resources/imports/QbsLibrary.qbs b/qbs-resources/imports/QbsLibrary.qbs index b459b4c8c..3b884ed5d 100644 --- a/qbs-resources/imports/QbsLibrary.qbs +++ b/qbs-resources/imports/QbsLibrary.qbs @@ -2,7 +2,6 @@ import qbs QbsProduct { Depends { name: "cpp" } - Depends { name: "bundle" } version: qbsversion.version type: Qt.core.staticBuild ? "staticlibrary" : "dynamiclibrary" targetName: (qbs.enableDebugCode && qbs.targetOS.contains("windows")) ? (name + 'd') : name @@ -13,7 +12,6 @@ QbsProduct { //cpp.soVersion: version.replace(/\.\d+$/, '') cpp.visibility: "minimal" cpp.cxxLanguageVersion: "c++11" - bundle.isBundle: false property bool visibilityType: Qt.core.staticBuild ? "static" : "dynamic" property string headerInstallPrefix: "/include/qbs" Group { @@ -27,6 +25,11 @@ QbsProduct { qbs.installDir: qbsbuildconfig.importLibInstallDir } + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } + Export { Depends { name: "cpp" } Depends { name: "Qt"; submodules: ["core"] } diff --git a/share/qbs/modules/cli/CLIModule.qbs b/share/qbs/modules/cli/CLIModule.qbs index 3b4ce8693..5c708a482 100644 --- a/share/qbs/modules/cli/CLIModule.qbs +++ b/share/qbs/modules/cli/CLIModule.qbs @@ -5,9 +5,11 @@ import qbs.ModUtils import "cli.js" as CLI Module { - Depends { name: "bundle" } - - bundle.isBundle: false + Depends { name: "bundle"; condition: qbs.targetOS.contains("darwin") } + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } condition: false diff --git a/src/app/config-ui/config-ui.qbs b/src/app/config-ui/config-ui.qbs index 33fe36eae..2222e6a17 100644 --- a/src/app/config-ui/config-ui.qbs +++ b/src/app/config-ui/config-ui.qbs @@ -26,6 +26,8 @@ QbsApp { cpp.frameworks: ["ApplicationServices", "Cocoa"] } - Depends { name: "bundle" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } diff --git a/tests/auto/api/testdata/app-without-sources/app-without-sources.qbs b/tests/auto/api/testdata/app-without-sources/app-without-sources.qbs index 726726337..f12a28fe6 100644 --- a/tests/auto/api/testdata/app-without-sources/app-without-sources.qbs +++ b/tests/auto/api/testdata/app-without-sources/app-without-sources.qbs @@ -24,6 +24,7 @@ Project { CppApplication { name: "appWithoutSources" + consoleApplication: true // HACK: cpp.entryPoint currently not working 100% with gcc Properties { @@ -31,7 +32,6 @@ Project { cpp.entryPoint: "main" } cpp.entryPoint: undefined - bundle.isBundle: false Depends { name: "a" } Depends { name: "b" } diff --git a/tests/auto/api/testdata/change-dependent-lib/change-dependent-lib.qbs b/tests/auto/api/testdata/change-dependent-lib/change-dependent-lib.qbs index 4037ae869..f52c90055 100644 --- a/tests/auto/api/testdata/change-dependent-lib/change-dependent-lib.qbs +++ b/tests/auto/api/testdata/change-dependent-lib/change-dependent-lib.qbs @@ -18,7 +18,11 @@ Project { } Depends { name: "cpp" } cpp.defines: ["XXXX"] - bundle.isBundle: false + + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } } diff --git a/tests/auto/api/testdata/disabled_install_group/disabled_install_group.qbs b/tests/auto/api/testdata/disabled_install_group/disabled_install_group.qbs index 6364506b4..b80af6e8a 100644 --- a/tests/auto/api/testdata/disabled_install_group/disabled_install_group.qbs +++ b/tests/auto/api/testdata/disabled_install_group/disabled_install_group.qbs @@ -1,11 +1,11 @@ import qbs CppApplication { + consoleApplication: true files: "main.cpp" Group { condition: false qbs.install: true fileTagsFilter: product.type } - bundle.isBundle: false } diff --git a/tests/auto/api/testdata/export-item-with-group/export-item-with-group.qbs b/tests/auto/api/testdata/export-item-with-group/export-item-with-group.qbs index 2dffc2803..30f1868cb 100644 --- a/tests/auto/api/testdata/export-item-with-group/export-item-with-group.qbs +++ b/tests/auto/api/testdata/export-item-with-group/export-item-with-group.qbs @@ -11,7 +11,7 @@ Project { Application { name: "app" - bundle.isBundle: false + consoleApplication: true Depends { name: "dep" } } } diff --git a/tests/auto/api/testdata/export-simple/export-simple.qbs b/tests/auto/api/testdata/export-simple/export-simple.qbs index 6eca71e89..d07bb0d1a 100644 --- a/tests/auto/api/testdata/export-simple/export-simple.qbs +++ b/tests/auto/api/testdata/export-simple/export-simple.qbs @@ -44,7 +44,10 @@ Project { files : [ "lib1.cpp" ] } Depends { name: "cpp" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } } diff --git a/tests/auto/api/testdata/is-runnable/is-runnable.qbs b/tests/auto/api/testdata/is-runnable/is-runnable.qbs index 47e217a6a..2883328ed 100644 --- a/tests/auto/api/testdata/is-runnable/is-runnable.qbs +++ b/tests/auto/api/testdata/is-runnable/is-runnable.qbs @@ -6,6 +6,9 @@ Project { } DynamicLibrary { name: "lib" - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } } diff --git a/tests/auto/api/testdata/link-dynamiclibs-staticlibs/link-dynamiclibs-staticlibs.qbs b/tests/auto/api/testdata/link-dynamiclibs-staticlibs/link-dynamiclibs-staticlibs.qbs index 2020752e6..8fec45700 100644 --- a/tests/auto/api/testdata/link-dynamiclibs-staticlibs/link-dynamiclibs-staticlibs.qbs +++ b/tests/auto/api/testdata/link-dynamiclibs-staticlibs/link-dynamiclibs-staticlibs.qbs @@ -13,7 +13,10 @@ Project { files : [ "dynamic1.cpp" ] Depends { name: "cpp" } Depends { name: "static1" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } StaticLibrary { @@ -29,7 +32,10 @@ Project { Depends { name: "cpp" } Depends { name: "static2" } cpp.visibility: 'hidden' - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } StaticLibrary { diff --git a/tests/auto/api/testdata/link-dynamiclibs/link-dynamiclibs.qbs b/tests/auto/api/testdata/link-dynamiclibs/link-dynamiclibs.qbs index e0f1fc553..d6047060c 100644 --- a/tests/auto/api/testdata/link-dynamiclibs/link-dynamiclibs.qbs +++ b/tests/auto/api/testdata/link-dynamiclibs/link-dynamiclibs.qbs @@ -18,7 +18,10 @@ Project { } Depends { name: "cpp" } Depends { name: "lib2" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } DynamicLibrary { @@ -29,7 +32,10 @@ Project { } Depends { name: "cpp" } Depends { name: "lib3" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } DynamicLibrary { @@ -39,7 +45,10 @@ Project { files : [ "lib3.cpp" ] } Depends { name: "cpp" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } DynamicLibrary { @@ -50,7 +59,10 @@ Project { files : [ "lib4.h", "lib4.cpp" ] } Depends { name: "cpp" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } Export { Depends { name: "cpp" } diff --git a/tests/auto/api/testdata/link-staticlibs-dynamiclibs/link-staticlibs-dynamiclibs.qbs b/tests/auto/api/testdata/link-staticlibs-dynamiclibs/link-staticlibs-dynamiclibs.qbs index 6704a9188..eafa764ba 100644 --- a/tests/auto/api/testdata/link-staticlibs-dynamiclibs/link-staticlibs-dynamiclibs.qbs +++ b/tests/auto/api/testdata/link-staticlibs-dynamiclibs/link-staticlibs-dynamiclibs.qbs @@ -20,7 +20,10 @@ Project { files : [ "dynamic1.cpp" ] Depends { name: "cpp" } Depends { name: "static2" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } StaticLibrary { @@ -35,7 +38,10 @@ Project { files: [ "dynamic2.cpp" ] Depends { name: "cpp" } cpp.visibility: 'hidden' - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } } diff --git a/tests/auto/api/testdata/new-output-artifact-in-dependency/new-output-artifact-in-dependency.qbs b/tests/auto/api/testdata/new-output-artifact-in-dependency/new-output-artifact-in-dependency.qbs index 2695a8085..8b50cce2a 100644 --- a/tests/auto/api/testdata/new-output-artifact-in-dependency/new-output-artifact-in-dependency.qbs +++ b/tests/auto/api/testdata/new-output-artifact-in-dependency/new-output-artifact-in-dependency.qbs @@ -5,7 +5,10 @@ Project { //Depends { name: "cpp" } name: "lib" files: "lib.cpp" - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } CppApplication { diff --git a/tests/auto/api/testdata/productNameWithDots/productNameWithDots.qbs b/tests/auto/api/testdata/productNameWithDots/productNameWithDots.qbs index f0cf5813c..5e3427793 100644 --- a/tests/auto/api/testdata/productNameWithDots/productNameWithDots.qbs +++ b/tests/auto/api/testdata/productNameWithDots/productNameWithDots.qbs @@ -1,13 +1,10 @@ import qbs Project { - Product { - Depends { name: "cpp" } - Depends { name: "bundle" } - type: ["application"] + CppApplication { name: "myapp" + consoleApplication: true Depends { name: "foo.bar.bla" } files: ["app.cpp"] - bundle.isBundle: false } StaticLibrary { Depends { name: "cpp" } diff --git a/tests/auto/api/testdata/qt5-plugin/qt5-plugin.qbs b/tests/auto/api/testdata/qt5-plugin/qt5-plugin.qbs index 834c386ad..204711625 100644 --- a/tests/auto/api/testdata/qt5-plugin/qt5-plugin.qbs +++ b/tests/auto/api/testdata/qt5-plugin/qt5-plugin.qbs @@ -7,7 +7,10 @@ DynamicLibrary { Depends { name: "Qt.core" } Depends { name: "cpp" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } Group { condition: Qt.core.versionMajor >= 5 diff --git a/tests/auto/api/testdata/rename-product/rename.qbs b/tests/auto/api/testdata/rename-product/rename.qbs index 137de27a7..18eb5ee6c 100644 --- a/tests/auto/api/testdata/rename-product/rename.qbs +++ b/tests/auto/api/testdata/rename-product/rename.qbs @@ -12,6 +12,9 @@ Project { Depends { name: "cpp" } cpp.defines: "MY_EXPORT=EXPORT" files: "lib.cpp" - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } } diff --git a/tests/auto/api/testdata/rename-target-artifact/rename.qbs b/tests/auto/api/testdata/rename-target-artifact/rename.qbs index 27f91841a..a3e811c29 100644 --- a/tests/auto/api/testdata/rename-target-artifact/rename.qbs +++ b/tests/auto/api/testdata/rename-target-artifact/rename.qbs @@ -13,6 +13,9 @@ Project { Depends { name: "cpp" } cpp.defines: "MY_EXPORT=EXPORT" files: "lib.cpp" - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } } diff --git a/tests/auto/blackbox/testdata-java/java/vehicles.qbs b/tests/auto/blackbox/testdata-java/java/vehicles.qbs index 2e048c634..56a5f3d37 100644 --- a/tests/auto/blackbox/testdata-java/java/vehicles.qbs +++ b/tests/auto/blackbox/testdata-java/java/vehicles.qbs @@ -5,7 +5,10 @@ Project { DynamicLibrary { Depends { name: "cpp" } Depends { name: "car_jar" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } name: "native" files: ["engine.c"] diff --git a/tests/auto/blackbox/testdata-qt/plugin-meta-data/plugin-meta-data.qbs b/tests/auto/blackbox/testdata-qt/plugin-meta-data/plugin-meta-data.qbs index 0d623a739..b91b8799e 100644 --- a/tests/auto/blackbox/testdata-qt/plugin-meta-data/plugin-meta-data.qbs +++ b/tests/auto/blackbox/testdata-qt/plugin-meta-data/plugin-meta-data.qbs @@ -24,7 +24,10 @@ Project { Depends { name: "cpp" } Depends { name: "Qt.core" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } cpp.defines: [Qt.core.staticBuild ? "QT_STATICPLUGIN" : "QT_PLUGIN"] cpp.cxxLanguageVersion: "c++11" cpp.sonamePrefix: qbs.targetOS.contains("darwin") ? "@rpath" : undefined diff --git a/tests/auto/blackbox/testdata/assembly/assembly.qbs b/tests/auto/blackbox/testdata/assembly/assembly.qbs index 39ecc021c..7dd82731a 100644 --- a/tests/auto/blackbox/testdata/assembly/assembly.qbs +++ b/tests/auto/blackbox/testdata/assembly/assembly.qbs @@ -32,21 +32,30 @@ Project { files : [ "testa.s" ] Depends { name: "cpp" } condition: qbs.toolchain.contains("gcc") - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } StaticLibrary { name : "testb" files : [ "testb.S" ] Depends { name: "cpp" } condition: qbs.toolchain.contains("gcc") - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } StaticLibrary { name : "testc" files : [ "testc.sx" ] Depends { name: "cpp" } condition: qbs.toolchain.contains("gcc") - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } StaticLibrary { name: "testd" @@ -57,7 +66,10 @@ Project { Depends { name: "cpp" } condition: qbs.toolchain.contains("msvc") && (qbs.architecture === "x86" || qbs.architecture === "x86_64") - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } } diff --git a/tests/auto/blackbox/testdata/clean/clean.qbs b/tests/auto/blackbox/testdata/clean/clean.qbs index 8221d0544..28ebe91f0 100644 --- a/tests/auto/blackbox/testdata/clean/clean.qbs +++ b/tests/auto/blackbox/testdata/clean/clean.qbs @@ -6,7 +6,10 @@ Project { version: "1.1.0" name: "dep" files: "dep.cpp" - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } CppApplication { diff --git a/tests/auto/blackbox/testdata/command-file/command-file.qbs b/tests/auto/blackbox/testdata/command-file/command-file.qbs index fb4943fb0..fb46a0712 100644 --- a/tests/auto/blackbox/testdata/command-file/command-file.qbs +++ b/tests/auto/blackbox/testdata/command-file/command-file.qbs @@ -5,7 +5,10 @@ Project { name: "theLib" destinationDirectory: project.buildDirectory Depends { name: "cpp" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } files: ["lib.cpp"] } CppApplication { diff --git a/tests/auto/blackbox/testdata/external-libs/external-libs.qbs b/tests/auto/blackbox/testdata/external-libs/external-libs.qbs index ff40604b4..5b9e12ebb 100644 --- a/tests/auto/blackbox/testdata/external-libs/external-libs.qbs +++ b/tests/auto/blackbox/testdata/external-libs/external-libs.qbs @@ -7,7 +7,10 @@ Project { name: "lib1" destinationDirectory: project.libDir Depends { name: "cpp" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } files: ["lib1.cpp"] } StaticLibrary { @@ -15,7 +18,10 @@ Project { destinationDirectory: project.libDir Depends { name: "cpp" } Depends { name: "lib1" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } files: ["lib2.cpp"] } // TODO: Remove once we have parameterized dependencies diff --git a/tests/auto/blackbox/testdata/ld/ld.qbs b/tests/auto/blackbox/testdata/ld/ld.qbs index d19603511..f95157012 100644 --- a/tests/auto/blackbox/testdata/ld/ld.qbs +++ b/tests/auto/blackbox/testdata/ld/ld.qbs @@ -6,10 +6,9 @@ Project { name: "coreutils" targetName: "qbs can handle any file paths, even the crazy ones! ;)" files: ["coreutils.cpp", "coreutils.h"] - bundle.isBundle: false - Properties { condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false cpp.sonamePrefix: "@rpath" } diff --git a/tests/auto/blackbox/testdata/loadablemodule/loadablemodule.qbs b/tests/auto/blackbox/testdata/loadablemodule/loadablemodule.qbs index a3327454d..44d0cec37 100644 --- a/tests/auto/blackbox/testdata/loadablemodule/loadablemodule.qbs +++ b/tests/auto/blackbox/testdata/loadablemodule/loadablemodule.qbs @@ -3,8 +3,10 @@ import qbs Project { LoadableModule { Depends { name: "cpp" } - Depends { name: "bundle" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } name: "CoolPlugIn" files: ["exported.cpp", "exported.h"] @@ -17,8 +19,7 @@ Project { CppApplication { Depends { name: "cpp" } Depends { name: "CoolPlugIn"; cpp.link: false } - Depends { name: "bundle" } - bundle.isBundle: false + consoleApplication: true name: "CoolApp" files: ["main.cpp"] diff --git a/tests/auto/blackbox/testdata/overrideProjectProperties/helper_lib.qbs b/tests/auto/blackbox/testdata/overrideProjectProperties/helper_lib.qbs index 16c68064e..b26b0f31f 100644 --- a/tests/auto/blackbox/testdata/overrideProjectProperties/helper_lib.qbs +++ b/tests/auto/blackbox/testdata/overrideProjectProperties/helper_lib.qbs @@ -4,5 +4,8 @@ DynamicLibrary { name: "helperLib" files: "helperlib.cpp" Depends { name: "cpp" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } diff --git a/tests/auto/blackbox/testdata/product-dependencies-by-type/product-dependencies-by-type.qbs b/tests/auto/blackbox/testdata/product-dependencies-by-type/product-dependencies-by-type.qbs index ebfc45d3f..d6cba15dd 100644 --- a/tests/auto/blackbox/testdata/product-dependencies-by-type/product-dependencies-by-type.qbs +++ b/tests/auto/blackbox/testdata/product-dependencies-by-type/product-dependencies-by-type.qbs @@ -29,7 +29,10 @@ Project { Depends { name: "cpp" } name: "lib-product" files: "main.cpp" - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } CppApplication { diff --git a/tests/auto/blackbox/testdata/propertyChanges/propertyChanges.qbs b/tests/auto/blackbox/testdata/propertyChanges/propertyChanges.qbs index 5574c5fb4..da9a862c5 100644 --- a/tests/auto/blackbox/testdata/propertyChanges/propertyChanges.qbs +++ b/tests/auto/blackbox/testdata/propertyChanges/propertyChanges.qbs @@ -27,7 +27,10 @@ Project { Depends { name: "cpp" } name: "library" files: "lib.cpp" - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } } Product { diff --git a/tests/auto/blackbox/testdata/separate-debug-info/separate-debug-info.qbs b/tests/auto/blackbox/testdata/separate-debug-info/separate-debug-info.qbs index 1ecbe0f36..b28d7b822 100644 --- a/tests/auto/blackbox/testdata/separate-debug-info/separate-debug-info.qbs +++ b/tests/auto/blackbox/testdata/separate-debug-info/separate-debug-info.qbs @@ -77,7 +77,7 @@ Project { name: "app4" type: ["application"] files: ["main.cpp"] - bundle.isBundle: false + consoleApplication: true cpp.separateDebugInformation: true } DynamicLibrary { @@ -85,14 +85,20 @@ Project { name: "foo4" type: ["dynamiclibrary"] files: ["foo.cpp"] - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } cpp.separateDebugInformation: true } LoadableModule { Depends { name: "cpp" } name: "bar4" files: ["foo.cpp"] - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } cpp.separateDebugInformation: true } @@ -100,7 +106,10 @@ Project { name: "app5" type: ["application"] files: ["main.cpp"] - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } cpp.separateDebugInformation: true Properties { condition: qbs.targetOS.contains("darwin") @@ -112,7 +121,10 @@ Project { name: "foo5" type: ["dynamiclibrary"] files: ["foo.cpp"] - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } cpp.separateDebugInformation: true Properties { condition: qbs.targetOS.contains("darwin") @@ -123,7 +135,10 @@ Project { Depends { name: "cpp" } name: "bar5" files: ["foo.cpp"] - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } cpp.separateDebugInformation: true Properties { condition: qbs.targetOS.contains("darwin") diff --git a/tests/auto/blackbox/testdata/symbolLinkMode/symbolLinkMode.qbs b/tests/auto/blackbox/testdata/symbolLinkMode/symbolLinkMode.qbs index 95adaa4ba..a95d6015e 100644 --- a/tests/auto/blackbox/testdata/symbolLinkMode/symbolLinkMode.qbs +++ b/tests/auto/blackbox/testdata/symbolLinkMode/symbolLinkMode.qbs @@ -39,11 +39,13 @@ Project { } DynamicLibrary { - Depends { name: "bundle" } Depends { name: "cpp" } Depends { name: "indirect"; cpp.symbolLinkMode: "reexport" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } name: "functions" files: ["lib.cpp"] cpp.cxxLanguageVersion: "c++11" @@ -80,10 +82,12 @@ Project { } DynamicLibrary { - Depends { name: "bundle" } Depends { name: "cpp" } - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } name: "indirect" files: ["indirect.cpp"] cpp.cxxLanguageVersion: "c++11" -- cgit v1.2.3 From f4f882ea206882050c79a6b9618c0ae53b89126c Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 27 Jul 2017 18:14:33 +0200 Subject: Fix change tracking for wildcards The code that stored the directory timestamps erroneously assumed it would get called recursively in the case of a "**" construct. As a result, the mechanism failed for files created or removed anywhere else than in the first level of the directory hierarchy. Change-Id: I8978e1fb8daa63e402be02bb47d171554703b54f Reviewed-by: Jake Petroules --- src/lib/corelib/language/language.cpp | 10 ++++-- .../recursive_wildcards/recursive_wildcards.qbs | 36 ++++++++++++++++++++++ tests/auto/blackbox/tst_blackbox.cpp | 20 ++++++++++++ 3 files changed, 63 insertions(+), 3 deletions(-) diff --git a/src/lib/corelib/language/language.cpp b/src/lib/corelib/language/language.cpp index c5aa34ae1..e2aa3dbe6 100644 --- a/src/lib/corelib/language/language.cpp +++ b/src/lib/corelib/language/language.cpp @@ -1140,14 +1140,18 @@ void SourceWildCards::expandPatterns(Set &result, const GroupConstPtr & QDirIterator it(baseDir, QStringList(filePattern), itFilters, itFlags); while (it.hasNext()) { const QString filePath = it.next(); - if (it.fileInfo().dir().path().startsWith(buildDir)) + const QString parentDir = it.fileInfo().dir().path(); + if (parentDir.startsWith(buildDir)) continue; // See above. if (!isDir && it.fileInfo().isDir() && !it.fileInfo().isSymLink()) continue; - if (isDir) + if (isDir) { expandPatterns(result, group, changed_parts, filePath, buildDir); - else + } else { + if (parentDir != baseDir) + dirTimeStamps.push_back({parentDir, FileInfo(baseDir).lastModified()}); result += QDir::cleanPath(filePath); + } } } diff --git a/tests/auto/blackbox/testdata/recursive_wildcards/recursive_wildcards.qbs b/tests/auto/blackbox/testdata/recursive_wildcards/recursive_wildcards.qbs index a1970e1c4..703a65e0e 100644 --- a/tests/auto/blackbox/testdata/recursive_wildcards/recursive_wildcards.qbs +++ b/tests/auto/blackbox/testdata/recursive_wildcards/recursive_wildcards.qbs @@ -1,7 +1,43 @@ +import qbs +import qbs.TextFile + Product { + type: ["txt.out"] Group { files: "dir/**" qbs.install: true qbs.installDir: "dir" } + FileTagger { + patterns: ["*.txt"] + fileTags: ["txt.in"] + } + Rule { + multiplex: true + requiresInputs: false + explicitlyDependsOn: ["txt.in"] + Artifact { + filePath: "output.txt" + fileTags: product.type + qbs.install: true + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "Creating " + output.fileName; + cmd.sourceCode = function() { + var inputList = explicitlyDependsOn["txt.in"]; + var fileNameList = []; + for (var i = 0; i < inputList.length; ++i) + fileNameList.push(inputList[i].fileName); + fileNameList.sort(); + var f = new TextFile(output.filePath, TextFile.WriteOnly); + try { + f.write(fileNameList.join('')); + } finally { + f.close(); + } + }; + return [cmd]; + } + } } diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 7154893e6..08c72f2f3 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -1528,6 +1528,26 @@ void TestBlackbox::recursiveWildcards() QCOMPARE(runQbs(QbsRunParameters("install")), 0); QVERIFY(QFileInfo(defaultInstallRoot + "/dir/file1.txt").exists()); QVERIFY(QFileInfo(defaultInstallRoot + "/dir/file2.txt").exists()); + QFile outputFile(defaultInstallRoot + "/output.txt"); + QVERIFY2(outputFile.open(QIODevice::ReadOnly), qPrintable(outputFile.errorString())); + QCOMPARE(outputFile.readAll(), QByteArray("file1.txtfile2.txt")); + outputFile.close(); + QFile newFile("dir/subdir/file3.txt"); + QVERIFY2(newFile.open(QIODevice::WriteOnly), qPrintable(newFile.errorString())); + newFile.close(); + QCOMPARE(runQbs(QbsRunParameters("install")), 0); + QVERIFY(QFileInfo(defaultInstallRoot + "/dir/file3.txt").exists()); + QVERIFY2(outputFile.open(QIODevice::ReadOnly), qPrintable(outputFile.errorString())); + QCOMPARE(outputFile.readAll(), QByteArray("file1.txtfile2.txtfile3.txt")); + outputFile.close(); + QVERIFY2(newFile.remove(), qPrintable(newFile.errorString())); + QVERIFY2(!newFile.exists(), qPrintable(newFile.fileName())); + QCOMPARE(runQbs(QbsRunParameters("install", QStringList{ "--clean-install-root"})), 0); + QVERIFY(QFileInfo(defaultInstallRoot + "/dir/file1.txt").exists()); + QVERIFY(QFileInfo(defaultInstallRoot + "/dir/file2.txt").exists()); + QVERIFY(!QFileInfo(defaultInstallRoot + "/dir/file3.txt").exists()); + QVERIFY2(outputFile.open(QIODevice::ReadOnly), qPrintable(outputFile.errorString())); + QCOMPARE(outputFile.readAll(), QByteArray("file1.txtfile2.txt")); } void TestBlackbox::referenceErrorInExport() -- cgit v1.2.3 From 4cceb84d1c4a43fe4f984e6e4126c08175a97c6d Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Wed, 2 Aug 2017 10:31:54 -0700 Subject: Update third party DMG dependencies mac_alias is updated from 2.0.4 to 2.0.6 and biplist is updated from 1.0.1 to 1.0.2 since pip has trouble properly updating packages, so now we download all packages directly from our Git forks. Change-Id: Ia8533b90a19483763f6e48693124361eb32c3651 Reviewed-by: Christian Kandeler --- .../python/lib/python2.7/site-packages/biplist/__init__.py | 7 +++++-- .../lib/python2.7/site-packages/mac_alias/bookmark.py | 14 ++++---------- .../python2.7/site-packages/mac_alias/qt_attribution.json | 2 +- src/3rdparty/python/update.sh | 6 +++++- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/3rdparty/python/lib/python2.7/site-packages/biplist/__init__.py b/src/3rdparty/python/lib/python2.7/site-packages/biplist/__init__.py index 9cab05ec3..17d35178d 100644 --- a/src/3rdparty/python/lib/python2.7/site-packages/biplist/__init__.py +++ b/src/3rdparty/python/lib/python2.7/site-packages/biplist/__init__.py @@ -507,6 +507,9 @@ class StringWrapper(object): else: return len(self.encodedValue)//2 + def __lt__(self, other): + return self.encodedValue < other.encodedValue + @property def encodingMarker(self): if self.encoding == 'ascii': @@ -770,7 +773,7 @@ class PlistWriter(object): output += proc_variable_length(0b1010, len(obj)) objectsToWrite = [] - for objRef in obj: + for objRef in sorted(obj) if isinstance(obj, set) else obj: (isNew, output) = self.writeObjectReference(objRef, output) if isNew: objectsToWrite.append(objRef) @@ -781,7 +784,7 @@ class PlistWriter(object): keys = [] values = [] objectsToWrite = [] - for key, value in iteritems(obj): + for key, value in sorted(iteritems(obj)): keys.append(key) values.append(value) for key in keys: diff --git a/src/3rdparty/python/lib/python2.7/site-packages/mac_alias/bookmark.py b/src/3rdparty/python/lib/python2.7/site-packages/mac_alias/bookmark.py index 409ed8297..0de6b9404 100644 --- a/src/3rdparty/python/lib/python2.7/site-packages/mac_alias/bookmark.py +++ b/src/3rdparty/python/lib/python2.7/site-packages/mac_alias/bookmark.py @@ -317,6 +317,9 @@ class Bookmark (object): if len(data) < 16: raise ValueError('Not a bookmark file (too short)') + if isinstance(data, bytearray): + data = bytes(data) + magic,size,dummy,hdrsize = struct.unpack(b'<4sIII', data[0:16]) if magic != b'book': @@ -508,7 +511,7 @@ class Bookmark (object): # binary search to find data entries.sort() - tocs.append((tid, b''.join([struct.pack(' Date: Thu, 3 Aug 2017 10:28:34 +0200 Subject: Fix recursiveWildcards() autotest We forgot to wait for a new timestamp before doing the file system updates. Change-Id: I23bdcabc397d2b490c81cd6e894fb9929b2f7c62 Reviewed-by: Joerg Bornemann --- tests/auto/blackbox/tst_blackbox.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 08c72f2f3..2018259b1 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -1532,6 +1532,7 @@ void TestBlackbox::recursiveWildcards() QVERIFY2(outputFile.open(QIODevice::ReadOnly), qPrintable(outputFile.errorString())); QCOMPARE(outputFile.readAll(), QByteArray("file1.txtfile2.txt")); outputFile.close(); + WAIT_FOR_NEW_TIMESTAMP(); QFile newFile("dir/subdir/file3.txt"); QVERIFY2(newFile.open(QIODevice::WriteOnly), qPrintable(newFile.errorString())); newFile.close(); @@ -1540,6 +1541,7 @@ void TestBlackbox::recursiveWildcards() QVERIFY2(outputFile.open(QIODevice::ReadOnly), qPrintable(outputFile.errorString())); QCOMPARE(outputFile.readAll(), QByteArray("file1.txtfile2.txtfile3.txt")); outputFile.close(); + WAIT_FOR_NEW_TIMESTAMP(); QVERIFY2(newFile.remove(), qPrintable(newFile.errorString())); QVERIFY2(!newFile.exists(), qPrintable(newFile.fileName())); QCOMPARE(runQbs(QbsRunParameters("install", QStringList{ "--clean-install-root"})), 0); -- cgit v1.2.3 From 6edf9bfdbd80329022cb328a6c2082724d03b07b Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 4 Aug 2017 11:10:37 +0200 Subject: Add reference pages to index.html The reference is arguably the most important part, so it makes sense to link also to sub-sections from the main page. One of the issues is that the sub-pages are not properly 'linked' with nextpage and previouspage. Anyhow, this should not block us from making the index page more useful. Change-Id: I1c80345795c1df294d07f7a31b613a24df341cb3 Reviewed-by: Leena Miettinen Reviewed-by: Christian Kandeler --- doc/qbs.qdoc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/qbs.qdoc b/doc/qbs.qdoc index 568e09317..a5856f449 100644 --- a/doc/qbs.qdoc +++ b/doc/qbs.qdoc @@ -72,6 +72,18 @@ \endlist \li \l{How-tos} \li \l{Reference} + \list + \li \l{List of All Items} + \list + \li \l{List of Language Items} + \li \l{List of Convenience Items} + \endlist + \li \l{List of Built-in Services} + \li \l{List of Command-line Tools} + \li \l{List of Modules} + \li \l{Command and JavaScriptCommand} + \endlist + \li \l{Appendix A: Building Qbs} \endlist */ -- cgit v1.2.3 From 3255da1a9809f10ffa73f15a39977a086d1e4299 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 7 Aug 2017 13:49:20 +0200 Subject: Fix help output The term "Internal command" is ambiguous. Change-Id: I0d1c84bf813256ea9ac96582994e07106f36f4ea Reviewed-by: Oswald Buddenhagen Reviewed-by: Jake Petroules --- src/app/qbs/parser/commandlineparser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/qbs/parser/commandlineparser.cpp b/src/app/qbs/parser/commandlineparser.cpp index 6e45aeb0a..9afbd7002 100644 --- a/src/app/qbs/parser/commandlineparser.cpp +++ b/src/app/qbs/parser/commandlineparser.cpp @@ -390,7 +390,7 @@ static QString extractToolDescription(const QString &tool, const QString &output QString CommandLineParser::CommandLineParserPrivate::generalHelp() const { QString help = Tr::tr("Usage: qbs [command] [command parameters]\n"); - help += Tr::tr("Internal commands:\n"); + help += Tr::tr("Built-in commands:\n"); const int rhsIndentation = 30; // Sorting the commands by name is nicer for the user. -- cgit v1.2.3 From c83ae7c3c01e17e00eff9a8aaf08807702578227 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 4 Aug 2017 15:16:45 +0200 Subject: Add autotest checking that module loading respects property overrides Change-Id: I938cb7a27d1bcc5cd9885a3aae7b5a076edb9ef2 Reviewed-by: Joerg Bornemann --- .../modules/multiple-backends/backend1.qbs | 6 +++++ .../modules/multiple-backends/backend2.qbs | 6 +++++ .../overridden-properties-and-prototypes.qbs | 6 +++++ tests/auto/language/tst_language.cpp | 30 ++++++++++++++++++++++ tests/auto/language/tst_language.h | 2 ++ 5 files changed, 50 insertions(+) create mode 100644 tests/auto/language/testdata/modules/multiple-backends/backend1.qbs create mode 100644 tests/auto/language/testdata/modules/multiple-backends/backend2.qbs create mode 100644 tests/auto/language/testdata/overridden-properties-and-prototypes.qbs diff --git a/tests/auto/language/testdata/modules/multiple-backends/backend1.qbs b/tests/auto/language/testdata/modules/multiple-backends/backend1.qbs new file mode 100644 index 000000000..011f96af8 --- /dev/null +++ b/tests/auto/language/testdata/modules/multiple-backends/backend1.qbs @@ -0,0 +1,6 @@ +import qbs + +Module { + condition: qbs.targetOS.contains("os1") + property string prop: "backend 1" +} diff --git a/tests/auto/language/testdata/modules/multiple-backends/backend2.qbs b/tests/auto/language/testdata/modules/multiple-backends/backend2.qbs new file mode 100644 index 000000000..1d2d817f7 --- /dev/null +++ b/tests/auto/language/testdata/modules/multiple-backends/backend2.qbs @@ -0,0 +1,6 @@ +import qbs + +Module { + condition: qbs.targetOS.contains("os2") + property string prop: "backend 2" +} diff --git a/tests/auto/language/testdata/overridden-properties-and-prototypes.qbs b/tests/auto/language/testdata/overridden-properties-and-prototypes.qbs new file mode 100644 index 000000000..d87611d7c --- /dev/null +++ b/tests/auto/language/testdata/overridden-properties-and-prototypes.qbs @@ -0,0 +1,6 @@ +import qbs + +Product { + name: "p" + Depends { name: "multiple-backends" } +} diff --git a/tests/auto/language/tst_language.cpp b/tests/auto/language/tst_language.cpp index 380d23669..9964c7055 100644 --- a/tests/auto/language/tst_language.cpp +++ b/tests/auto/language/tst_language.cpp @@ -1730,6 +1730,36 @@ void TestLanguage::outerInGroup() QCOMPARE(exceptionCaught, false); } +void TestLanguage::overriddenPropertiesAndPrototypes() +{ + bool exceptionCaught = false; + try { + QFETCH(QString, osName); + QFETCH(QString, backendName); + SetupProjectParameters params = defaultParameters; + params.setProjectFilePath(testProject("overridden-properties-and-prototypes.qbs")); + params.setOverriddenValues({std::make_pair("modules.qbs.targetOS", osName)}); + TopLevelProjectConstPtr project = loader->loadProject(params); + QVERIFY(project); + QCOMPARE(project->products.count(), 1); + QCOMPARE(project->products.first()->moduleProperties->moduleProperty( + "multiple-backends", "prop").toString(), backendName); + } + catch (const ErrorInfo &e) { + exceptionCaught = true; + qDebug() << e.toString(); + } + QCOMPARE(exceptionCaught, false); +} + +void TestLanguage::overriddenPropertiesAndPrototypes_data() +{ + QTest::addColumn("osName"); + QTest::addColumn("backendName"); + QTest::newRow("first backend") << "os1" << "backend 1"; + QTest::newRow("second backend") << "os2" << "backend 2"; +} + void TestLanguage::parameterTypes() { bool exceptionCaught = false; diff --git a/tests/auto/language/tst_language.h b/tests/auto/language/tst_language.h index 62805ec2f..897a5cd3f 100644 --- a/tests/auto/language/tst_language.h +++ b/tests/auto/language/tst_language.h @@ -121,6 +121,8 @@ private slots: void nonRequiredProducts(); void nonRequiredProducts_data(); void outerInGroup(); + void overriddenPropertiesAndPrototypes(); + void overriddenPropertiesAndPrototypes_data(); void parameterTypes(); void pathProperties(); void productConditions(); -- cgit v1.2.3 From a590bcb89cf42017206991107111df95c5612dfc Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 11 Aug 2017 12:45:24 +0200 Subject: Fix build data rescuing when multiplexing The code assumed that we could only multiplex over profiles, which is no longer true. Change-Id: Ia0a522b701d3ed983d484d0683e1417ab2adeb94 Reviewed-by: Joerg Bornemann --- src/lib/corelib/buildgraph/buildgraphloader.cpp | 2 +- src/lib/corelib/buildgraph/executor.cpp | 2 +- src/lib/corelib/buildgraph/rescuableartifactdata.h | 10 +++++----- src/lib/corelib/tools/persistence.cpp | 2 +- .../change-tracking-and-multiplexing.qbs | 13 +++++++++++++ .../testdata/change-tracking-and-multiplexing/lib.cpp | 1 + tests/auto/blackbox/tst_blackbox.cpp | 13 +++++++++++++ tests/auto/blackbox/tst_blackbox.h | 1 + 8 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 tests/auto/blackbox/testdata/change-tracking-and-multiplexing/change-tracking-and-multiplexing.qbs create mode 100644 tests/auto/blackbox/testdata/change-tracking-and-multiplexing/lib.cpp diff --git a/src/lib/corelib/buildgraph/buildgraphloader.cpp b/src/lib/corelib/buildgraph/buildgraphloader.cpp index ff85f2536..f16d80ddb 100644 --- a/src/lib/corelib/buildgraph/buildgraphloader.cpp +++ b/src/lib/corelib/buildgraph/buildgraphloader.cpp @@ -1011,7 +1011,7 @@ void BuildGraphLoader::rescueOldBuildData(const ResolvedProductConstPtr &restore const ChildrenInfo &childrenInfo = childLists.value(oldArtifact); for (Artifact * const child : qAsConst(childrenInfo.children)) { rad.children << RescuableArtifactData::ChildData(child->product->name, - child->product->profile, child->filePath(), + child->product->multiplexConfigurationId, child->filePath(), childrenInfo.childrenAddedByScanner.contains(child)); } newlyResolvedProduct->buildData->rescuableArtifactData.insert( diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp index 7b98eb909..786fdbc42 100644 --- a/src/lib/corelib/buildgraph/executor.cpp +++ b/src/lib/corelib/buildgraph/executor.cpp @@ -779,7 +779,7 @@ void Executor::rescueOldBuildData(Artifact *artifact, bool *childrenAdded = 0) ResolvedProductPtr pseudoProduct = ResolvedProduct::create(); for (const RescuableArtifactData::ChildData &cd : qAsConst(rad.children)) { pseudoProduct->name = cd.productName; - pseudoProduct->profile = cd.productProfile; + pseudoProduct->multiplexConfigurationId = cd.productMultiplexId; Artifact * const child = lookupArtifact(pseudoProduct, m_project->buildData.data(), cd.childFilePath, true); if (artifact->children.contains(child)) diff --git a/src/lib/corelib/buildgraph/rescuableartifactdata.h b/src/lib/corelib/buildgraph/rescuableartifactdata.h index 0058885a1..92718ae4b 100644 --- a/src/lib/corelib/buildgraph/rescuableartifactdata.h +++ b/src/lib/corelib/buildgraph/rescuableartifactdata.h @@ -64,15 +64,15 @@ public: struct ChildData { - ChildData(const QString &n = QString(), const QString &p = QString(), + ChildData(const QString &n = QString(), const QString &m = QString(), const QString &c = QString(), bool byScanner = false) - : productName(n), productProfile(p), childFilePath(c), addedByScanner(byScanner) + : productName(n), productMultiplexId(m), childFilePath(c), addedByScanner(byScanner) {} void load(PersistentPool &pool) { pool.load(productName); - pool.load(productProfile); + pool.load(productMultiplexId); pool.load(childFilePath); pool.load(addedByScanner); } @@ -80,13 +80,13 @@ public: void store(PersistentPool &pool) const { pool.store(productName); - pool.store(productProfile); + pool.store(productMultiplexId); pool.store(childFilePath); pool.store(addedByScanner); } QString productName; - QString productProfile; + QString productMultiplexId; QString childFilePath; bool addedByScanner; }; diff --git a/src/lib/corelib/tools/persistence.cpp b/src/lib/corelib/tools/persistence.cpp index 56868cae7..bf8da20e8 100644 --- a/src/lib/corelib/tools/persistence.cpp +++ b/src/lib/corelib/tools/persistence.cpp @@ -50,7 +50,7 @@ namespace qbs { namespace Internal { -static const char QBS_PERSISTENCE_MAGIC[] = "QBSPERSISTENCE-103"; +static const char QBS_PERSISTENCE_MAGIC[] = "QBSPERSISTENCE-104"; NoBuildGraphError::NoBuildGraphError() : ErrorInfo(Tr::tr("No build graph exists yet for this configuration.")) diff --git a/tests/auto/blackbox/testdata/change-tracking-and-multiplexing/change-tracking-and-multiplexing.qbs b/tests/auto/blackbox/testdata/change-tracking-and-multiplexing/change-tracking-and-multiplexing.qbs new file mode 100644 index 000000000..78bd8abda --- /dev/null +++ b/tests/auto/blackbox/testdata/change-tracking-and-multiplexing/change-tracking-and-multiplexing.qbs @@ -0,0 +1,13 @@ +import qbs + +StaticLibrary { + name: "l" + + Depends { condition: qbs.targetOS.contains("darwin"); name: "bundle" } + Properties { condition: qbs.targetOS.contains("darwin"); bundle.isBundle: false } + + multiplexByQbsProperties: ["buildVariants"] + qbs.buildVariants: ["debug", "release"] + Depends { name: "cpp" } + files: ["lib.cpp"] +} diff --git a/tests/auto/blackbox/testdata/change-tracking-and-multiplexing/lib.cpp b/tests/auto/blackbox/testdata/change-tracking-and-multiplexing/lib.cpp new file mode 100644 index 000000000..9a6145659 --- /dev/null +++ b/tests/auto/blackbox/testdata/change-tracking-and-multiplexing/lib.cpp @@ -0,0 +1 @@ +void l() {} diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 2018259b1..f26f33d53 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -598,6 +598,19 @@ void TestBlackbox::changeInImportedFile() QVERIFY2(!m_qbsStdout.contains("output"), m_qbsStdout.constData()); } +void TestBlackbox::changeTrackingAndMultiplexing() +{ + QDir::setCurrent(testDataDir + "/change-tracking-and-multiplexing"); + QCOMPARE(runQbs(QStringList("modules.cpp.staticLibraryPrefix:prefix1")), 0); + QCOMPARE(m_qbsStdout.count("compiling lib.cpp"), 2); + QCOMPARE(m_qbsStdout.count("creating prefix1l"), 2); + QCOMPARE(runQbs(QbsRunParameters("resolve", + QStringList("modules.cpp.staticLibraryPrefix:prefix2"))), 0); + QCOMPARE(runQbs(), 0); + QCOMPARE(m_qbsStdout.count("compiling lib.cpp"), 0); + QCOMPARE(m_qbsStdout.count("creating prefix2l"), 2); +} + static QJsonObject findByName(const QJsonArray &objects, const QString &name) { for (const QJsonValue v : objects) { diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h index 1337644fb..1426046cf 100644 --- a/tests/auto/blackbox/tst_blackbox.h +++ b/tests/auto/blackbox/tst_blackbox.h @@ -52,6 +52,7 @@ private slots: void changedFiles(); void changeInDisabledProduct(); void changeInImportedFile(); + void changeTrackingAndMultiplexing(); void checkProjectFilePath(); void clean(); void cli(); -- cgit v1.2.3 From 945a1db8e27bb7f8f7edb1e55bf746104e723dd4 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 14 Aug 2017 10:49:22 +0200 Subject: Fix build Change-Id: Ib8d2ba1860bb1e64dce149afb8a1bfd2ac10f604 Reviewed-by: Joerg Bornemann --- tests/auto/language/tst_language.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/language/tst_language.cpp b/tests/auto/language/tst_language.cpp index 9964c7055..6ee7a42a1 100644 --- a/tests/auto/language/tst_language.cpp +++ b/tests/auto/language/tst_language.cpp @@ -1740,7 +1740,7 @@ void TestLanguage::overriddenPropertiesAndPrototypes() params.setProjectFilePath(testProject("overridden-properties-and-prototypes.qbs")); params.setOverriddenValues({std::make_pair("modules.qbs.targetOS", osName)}); TopLevelProjectConstPtr project = loader->loadProject(params); - QVERIFY(project); + QVERIFY(!!project); QCOMPARE(project->products.count(), 1); QCOMPARE(project->products.first()->moduleProperties->moduleProperty( "multiple-backends", "prop").toString(), backendName); -- cgit v1.2.3 From b790a7aa74653bf3d9125b30f262c37e389ac131 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 9 Aug 2017 13:18:37 +0200 Subject: ModuleLoader: Remove invalid assertion The assumption that all list properties must have acquired a defining item at some point is simply wrong. Change-Id: I34d035e50b5d5cd8c62f1baba899326b92ade8d1 Reviewed-by: Joerg Bornemann --- src/lib/corelib/language/moduleloader.cpp | 4 +--- .../language/testdata/modulepropertiesingroups.qbs | 12 +++++++++++ tests/auto/language/tst_language.cpp | 23 +++++++++++++++++++++- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/lib/corelib/language/moduleloader.cpp b/src/lib/corelib/language/moduleloader.cpp index 5a8f1f50a..e861f2dfd 100755 --- a/src/lib/corelib/language/moduleloader.cpp +++ b/src/lib/corelib/language/moduleloader.cpp @@ -1740,10 +1740,8 @@ void ModuleLoader::adjustDefiningItemsInGroupModuleInstances(const Item::Module bool hasDefiningItem = false; for (ValueConstPtr v = propValue; v && !hasDefiningItem; v = v->next()) hasDefiningItem = v->definingItem(); - if (!hasDefiningItem) { - QBS_CHECK(decl.isScalar() || instanceWithProperty == modulePrototype); + if (!hasDefiningItem) continue; - } const ValuePtr clonedValue = propValue->clone(); for (ValuePtr v = clonedValue; v; v = v->next()) { diff --git a/tests/auto/language/testdata/modulepropertiesingroups.qbs b/tests/auto/language/testdata/modulepropertiesingroups.qbs index 7a0a99b3e..5a1e75ab8 100644 --- a/tests/auto/language/testdata/modulepropertiesingroups.qbs +++ b/tests/auto/language/testdata/modulepropertiesingroups.qbs @@ -70,4 +70,16 @@ Project { } } } + Product { + name: "grouptest2" + Depends { name: "gmod.gmod1" } + Group { + name: "g1" + gmod.gmod1.gmod1_list2: ["G1"] + Group { + name: "g1.1" + gmod.gmod1.gmod1_string: "G1.1" + } + } + } } diff --git a/tests/auto/language/tst_language.cpp b/tests/auto/language/tst_language.cpp index 6ee7a42a1..19c67eda3 100644 --- a/tests/auto/language/tst_language.cpp +++ b/tests/auto/language/tst_language.cpp @@ -1321,7 +1321,7 @@ void TestLanguage::modulePropertiesInGroups() TopLevelProjectPtr project = loader->loadProject(defaultParameters); QVERIFY(!!project); const QHash products = productsFromProject(project); - const ResolvedProductPtr product = products.value("grouptest"); + ResolvedProductPtr product = products.value("grouptest"); QVERIFY(!!product); GroupConstPtr g1; GroupConstPtr g11; @@ -1498,6 +1498,27 @@ void TestLanguage::modulePropertiesInGroups() QEXPECT_FAIL(0, "re-eval not triggered", Continue); QCOMPARE(g211Gmod2List, QStringList() << "g2.1.1" << "commonName_in_gmod1" << "g2.1.1_gmod4_g2.1.1_gmod3" << "g2.1.1_gmod3" << "gmod2_list_proto"); + + product = products.value("grouptest2"); + QVERIFY(!!product); + g1.reset(); + g11.reset(); + foreach (const GroupConstPtr &g, product->groups) { + if (g->name == "g1") + g1= g; + else if (g->name == "g1.1") + g11 = g; + } + QVERIFY(!!g1); + QVERIFY(!!g11); + QCOMPARE(moduleProperty(g1->properties->value(), "gmod.gmod1", "gmod1_list2") + .toStringList(), QStringList({"G1"})); + QCOMPARE(moduleProperty(g11->properties->value(), "gmod.gmod1", "gmod1_list2") + .toStringList(), + moduleProperty(g1->properties->value(), "gmod.gmod1", "gmod1_list2") + .toStringList()); + QCOMPARE(moduleProperty(g11->properties->value(), "gmod.gmod1", "gmod1_string").toString(), + QString("G1.1")); } catch (const ErrorInfo &e) { exceptionCaught = true; qDebug() << e.toString(); -- cgit v1.2.3 From adc28c434853cf0fa17e95cc207e5a1c6eb761de Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Mon, 14 Aug 2017 03:21:33 -0700 Subject: Don't set the *_DEPLOYMENT_TARGET environment variables to empty string This is a partial revert of a7247ff1cde96864243eba3bf5d36d6b5bded2d6, which caused Qbs to set the *_DEPLOYMENT_TARGET environment variables to the empty string if no value was provided for the deployment target. The empty string causes problems for some tools like `strip`, which passes the empty string verbatim to the -*_version_min flag of an internal invocation of `ld`, which is not allowed. Presumably the original intent was to influence the target platform that the compiler would use, but this does not work (at least with current toolchains) if the value is the empty string. It also shouldn't matter since we use -target now, which explicitly states the platform. In that case, the compiler will choose a minimum version internally if one is not explicitly given. Change-Id: I7d9f12bb52bf3289c0c5e3353a928c8cb0be9531 Reviewed-by: Christian Kandeler --- share/qbs/modules/cpp/DarwinGCC.qbs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/share/qbs/modules/cpp/DarwinGCC.qbs b/share/qbs/modules/cpp/DarwinGCC.qbs index c1c92e740..015fb71f5 100644 --- a/share/qbs/modules/cpp/DarwinGCC.qbs +++ b/share/qbs/modules/cpp/DarwinGCC.qbs @@ -182,14 +182,14 @@ UnixGCC { // Set the corresponding environment variable even if the minimum OS version is undefined, // because this indicates the default deployment target for that OS - if (qbs.targetOS.contains("ios")) - env["IPHONEOS_DEPLOYMENT_TARGET"] = minimumIosVersion || ""; - if (qbs.targetOS.contains("macos")) - env["MACOSX_DEPLOYMENT_TARGET"] = minimumMacosVersion || ""; - if (qbs.targetOS.contains("watchos")) - env["WATCHOS_DEPLOYMENT_TARGET"] = minimumWatchosVersion || ""; - if (qbs.targetOS.contains("tvos")) - env["TVOS_DEPLOYMENT_TARGET"] = minimumTvosVersion || ""; + if (qbs.targetOS.contains("ios") && minimumIosVersion) + env["IPHONEOS_DEPLOYMENT_TARGET"] = minimumIosVersion; + if (qbs.targetOS.contains("macos") && minimumMacosVersion) + env["MACOSX_DEPLOYMENT_TARGET"] = minimumMacosVersion; + if (qbs.targetOS.contains("watchos") && minimumWatchosVersion) + env["WATCHOS_DEPLOYMENT_TARGET"] = minimumWatchosVersion; + if (qbs.targetOS.contains("tvos") && minimumTvosVersion) + env["TVOS_DEPLOYMENT_TARGET"] = minimumTvosVersion; if (xcode.present) env["TARGETED_DEVICE_FAMILY"] = DarwinTools.targetedDeviceFamily(xcode.targetDevices); -- cgit v1.2.3