Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

pylint scripts under sky, remove dead scripts under sky/tools/roll #38334

Merged
merged 1 commit into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions ci/licenses_golden/excluded_files
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,6 @@
../../../flutter/sky/tools/dist_dart_pkg.py
../../../flutter/sky/tools/install_framework_headers.py
../../../flutter/sky/tools/objcopy.py
../../../flutter/sky/tools/roll/patch.py
../../../flutter/sky/tools/roll/roll.py
../../../flutter/sky/tools/roll/utils.py
../../../flutter/testing
../../../flutter/third_party/accessibility/README.md
../../../flutter/third_party/accessibility/ax/ax_enum_util_unittest.cc
Expand Down
1 change: 0 additions & 1 deletion ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -5571,7 +5571,6 @@ FILE: ../../../flutter/shell/profiling/sampling_profiler.h
FILE: ../../../flutter/shell/version/version.cc
FILE: ../../../flutter/shell/version/version.h
FILE: ../../../flutter/shell/vmservice/empty.dart
FILE: ../../../flutter/sky/tools/roll/patches/chromium/android_build.patch
FILE: ../../../flutter/third_party/accessibility/base/color_utils.h
FILE: ../../../flutter/third_party/accessibility/base/compiler_specific.h
FILE: ../../../flutter/third_party/accessibility/base/container_utils.h
Expand Down
1 change: 1 addition & 0 deletions ci/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ pylint-2.7 --rcfile=.pylintrc \
"build/" \
"ci/" \
"impeller/" \
"sky/" \
"tools/gn" \
"testing/"

Expand Down
27 changes: 15 additions & 12 deletions sky/tools/create_full_ios_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import subprocess
import sys

from create_xcframework import create_xcframework
from create_xcframework import create_xcframework # pylint: disable=import-error

DSYMUTIL = os.path.join(
os.path.dirname(__file__), '..', '..', '..', 'buildtools', 'mac-x64',
Expand All @@ -39,8 +39,8 @@ def main():
parser.add_argument('--arm64-out-dir', type=str, required=True)
parser.add_argument('--simulator-x64-out-dir', type=str, required=True)
parser.add_argument('--simulator-arm64-out-dir', type=str, required=False)
parser.add_argument('--strip', action="store_true", default=False)
parser.add_argument('--dsym', action="store_true", default=False)
parser.add_argument('--strip', action='store_true', default=False)
parser.add_argument('--dsym', action='store_true', default=False)

args = parser.parse_args()

Expand Down Expand Up @@ -108,9 +108,10 @@ def main():
process_framework(args, dst, framework, framework_binary)
generate_gen_snapshot(args, dst, x64_out_dir, arm64_out_dir)
zip_archive(dst)
return 0


def create_framework(
def create_framework( # pylint: disable=too-many-arguments
args, dst, framework, arm64_framework, simulator_framework,
simulator_x64_framework, simulator_arm64_framework
):
Expand All @@ -122,7 +123,7 @@ def create_framework(
return 1

if not os.path.isfile(simulator_x64_dylib):
print('Cannot find iOS simulator dylib at %s' % simulator_dylib)
print('Cannot find iOS simulator dylib at %s' % simulator_x64_dylib)
return 1

shutil.rmtree(framework, True)
Expand All @@ -143,12 +144,12 @@ def create_framework(
process_framework(
args, dst, simulator_framework, simulator_framework_binary
)
simulator_framework = simulator_framework
else:
simulator_framework = simulator_x64_framework

# Create XCFramework from the arm-only fat framework and the arm64/x64 simulator frameworks, or just the
# x64 simulator framework if only that one exists.
# Create XCFramework from the arm-only fat framework and the arm64/x64
# simulator frameworks, or just the x64 simulator framework if only that one
# exists.
xcframeworks = [simulator_framework, framework]
create_xcframework(location=dst, name='Flutter', frameworks=xcframeworks)

Expand All @@ -158,10 +159,12 @@ def create_framework(
framework_binary
])

return 0


def embed_codesign_configuration(config_path, contents):
with open(config_path, 'w') as f:
f.write('\n'.join(contents) + '\n')
with open(config_path, 'w') as file:
file.write('\n'.join(contents) + '\n')


def zip_archive(dst):
Expand Down Expand Up @@ -189,7 +192,7 @@ def zip_archive(dst):
'without_entitlements.txt',
],
cwd=dst)
if (os.path.exists(os.path.join(dst, 'Flutter.dSYM'))):
if os.path.exists(os.path.join(dst, 'Flutter.dSYM')):
subprocess.check_call(['zip', '-r', 'Flutter.dSYM.zip', 'Flutter.dSYM'],
cwd=dst)

Expand All @@ -204,7 +207,7 @@ def process_framework(args, dst, framework, framework_binary):
unstripped_out = os.path.join(dst, 'Flutter.unstripped')
shutil.copyfile(framework_binary, unstripped_out)

subprocess.check_call(["strip", "-x", "-S", framework_binary])
subprocess.check_call(['strip', '-x', '-S', framework_binary])


def generate_gen_snapshot(args, dst, x64_out_dir, arm64_out_dir):
Expand Down
17 changes: 9 additions & 8 deletions sky/tools/create_ios_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import sys
import os

from create_xcframework import create_xcframework
from create_xcframework import create_xcframework # pylint: disable=import-error

DSYMUTIL = os.path.join(
os.path.dirname(__file__), '..', '..', '..', 'buildtools', 'mac-x64',
Expand All @@ -31,8 +31,8 @@ def main():
'--simulator-x64-out-dir', '--simulator-out-dir', type=str, required=True
)
parser.add_argument('--simulator-arm64-out-dir', type=str, required=False)
parser.add_argument('--strip', action="store_true", default=False)
parser.add_argument('--dsym', action="store_true", default=False)
parser.add_argument('--strip', action='store_true', default=False)
parser.add_argument('--dsym', action='store_true', default=False)

args = parser.parse_args()

Expand Down Expand Up @@ -64,7 +64,7 @@ def main():
return 1

if not os.path.isfile(simulator_x64_dylib):
print('Cannot find iOS simulator dylib at %s' % simulator_dylib)
print('Cannot find iOS simulator dylib at %s' % simulator_x64_dylib)
return 1

if not os.path.isfile(DSYMUTIL):
Expand All @@ -88,12 +88,12 @@ def main():
'-output', simulator_framework_binary
])
process_framework(args, simulator_framework, simulator_framework_binary)
simulator_framework = simulator_framework
else:
simulator_framework = simulator_x64_framework

# Create XCFramework from the arm-only fat framework and the arm64/x64 simulator frameworks, or just the
# x64 simulator framework if only that one exists.
# Create XCFramework from the arm-only fat framework and the arm64/x64
# simulator frameworks, or just the x64 simulator framework if only that one
# exists.
xcframeworks = [simulator_framework, framework]
create_xcframework(location=args.dst, name='Flutter', frameworks=xcframeworks)

Expand All @@ -104,6 +104,7 @@ def main():
])

process_framework(args, framework, framework_binary)
return 0


def process_framework(args, framework, framework_binary):
Expand All @@ -116,7 +117,7 @@ def process_framework(args, framework, framework_binary):
unstripped_out = os.path.join(args.dst, 'Flutter.unstripped')
shutil.copyfile(framework_binary, unstripped_out)

subprocess.check_call(["strip", "-x", "-S", framework_binary])
subprocess.check_call(['strip', '-x', '-S', framework_binary])


if __name__ == '__main__':
Expand Down
12 changes: 6 additions & 6 deletions sky/tools/create_macos_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import sys
import os

from create_xcframework import create_xcframework

buildroot_dir = os.path.abspath(
os.path.join(os.path.realpath(__file__), '..', '..', '..', '..')
)
Expand All @@ -32,10 +30,10 @@ def main():
parser.add_argument('--dst', type=str, required=True)
parser.add_argument('--arm64-out-dir', type=str, required=True)
parser.add_argument('--x64-out-dir', type=str, required=True)
parser.add_argument('--strip', action="store_true", default=False)
parser.add_argument('--dsym', action="store_true", default=False)
parser.add_argument('--strip', action='store_true', default=False)
parser.add_argument('--dsym', action='store_true', default=False)
# TODO(godofredoc): Remove after recipes v2 have landed.
parser.add_argument('--zip', action="store_true", default=False)
parser.add_argument('--zip', action='store_true', default=False)

args = parser.parse_args()

Expand Down Expand Up @@ -93,6 +91,8 @@ def main():
])
process_framework(dst, args, fat_framework, fat_framework_binary)

return 0


def regenerate_symlinks(fat_framework):
"""Regenerates the symlinks structure.
Expand Down Expand Up @@ -142,7 +142,7 @@ def process_framework(dst, args, fat_framework, fat_framework_binary):
unstripped_out = os.path.join(dst, 'FlutterMacOS.unstripped')
shutil.copyfile(fat_framework_binary, unstripped_out)

subprocess.check_call(["strip", "-x", "-S", fat_framework_binary])
subprocess.check_call(['strip', '-x', '-S', fat_framework_binary])

# Zip FlutterMacOS.framework.
if args.zip:
Expand Down
2 changes: 1 addition & 1 deletion sky/tools/create_macos_gen_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def main():
parser.add_argument('--x64-out-dir', type=str)
parser.add_argument('--arm64-out-dir', type=str)
parser.add_argument('--armv7-out-dir', type=str)
parser.add_argument('--zip', action="store_true", default=False)
parser.add_argument('--zip', action='store_true', default=False)

args = parser.parse_args()

Expand Down
4 changes: 2 additions & 2 deletions sky/tools/create_xcframework.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# found in the LICENSE file.

import argparse
import errno
import os
import shutil
import subprocess
Expand Down Expand Up @@ -46,7 +45,8 @@ def create_xcframework(location, name, frameworks):
# Remove old xcframework.
shutil.rmtree(output_xcframework)

# xcrun xcodebuild -create-xcframework -framework foo/baz.framework -framework bar/baz.framework -output output/
# xcrun xcodebuild -create-xcframework -framework foo/baz.framework \
# -framework bar/baz.framework -output output/
command = ['xcrun', 'xcodebuild', '-quiet', '-create-xcframework']

for framework in frameworks:
Expand Down
7 changes: 3 additions & 4 deletions sky/tools/install_framework_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import errno
import os
import shutil
import subprocess
import sys


Expand All @@ -31,10 +30,10 @@ def main():
# Remove old headers.
try:
shutil.rmtree(os.path.normpath(args.location))
except OSError as e:
except OSError as err:
# Ignore only "not found" errors.
if e.errno != errno.ENOENT:
raise e
if err.errno != errno.ENOENT:
raise err

# Create the directory to copy the files to.
if not os.path.isdir(args.location):
Expand Down
46 changes: 0 additions & 46 deletions sky/tools/roll/patch.py

This file was deleted.

33 changes: 0 additions & 33 deletions sky/tools/roll/patches/chromium/android_build.patch

This file was deleted.

Loading