Skip to content

[build-script] Rename all do_* methods to simply *. #23871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
6 changes: 3 additions & 3 deletions utils/build-script
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ class BuildScriptInvocation(object):
toolchain=self.toolchain,
source_dir=self.workspace.source_dir("ninja"),
build_dir=self.workspace.build_dir("build", "ninja"))
ninja_build.do_build()
ninja_build.build()
self.toolchain.ninja = ninja_build.ninja_bin_path

def convert_to_impl_arguments(self):
Expand Down Expand Up @@ -980,8 +980,8 @@ class BuildScriptInvocation(object):
source_dir=self.workspace.source_dir(product_source),
build_dir=self.workspace.build_dir(
host_target, product_name))
product.do_build(host_target)
product.do_test(host_target)
product.build(host_target)
product.test(host_target)

# Extract symbols...
for host_target in all_hosts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ def product_source_name(cls):
def is_build_script_impl_product(cls):
return False

def do_build(self, host_target):
def build(self, host_target):
run_build_script_helper(host_target, self, self.args)

def do_test(self, host_target):
def test(self, host_target):
"""Just run a single instance of the command for both .debug and
.release.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def product_source_name(cls):
def is_build_script_impl_product(cls):
return False

def do_build(self, host_target):
def build(self, host_target):
run_build_script_helper('build', host_target, self, self.args)

def do_test(self, host_target):
def test(self, host_target):
if self.args.test and self.args.test_indexstoredb:
run_build_script_helper('test', host_target, self, self.args)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def is_build_script_impl_product(cls):
def ninja_bin_path(self):
return os.path.join(self.build_dir, 'ninja')

def do_build(self):
def build(self):
if os.path.exists(self.ninja_bin_path):
return

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ def is_build_script_impl_product(cls):
"""
return True

def do_build(self, host_target):
"""do_build() -> void
def build(self, host_target):
"""build() -> void

Perform the build, for a non-build-script-impl product.
"""
raise NotImplementedError

def do_test(self, host_target):
"""do_build() -> void
def test(self, host_target):
"""test() -> void

Run the tests, for a non-build-script-impl product.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ def product_source_name(cls):
def is_build_script_impl_product(cls):
return False

def do_build(self, host_target):
def build(self, host_target):
indexstoredb.run_build_script_helper(
'build', host_target, self, self.args)

def do_test(self, host_target):
def test(self, host_target):
if self.args.test and self.args.test_sourcekitlsp:
indexstoredb.run_build_script_helper(
'test', host_target, self, self.args)
4 changes: 2 additions & 2 deletions utils/swift_build_support/tests/products/test_ninja.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ def test_ninja_bin_path(self):

self.assertEqual(ninja_build.ninja_bin_path, '/path/to/build/ninja')

def test_do_build(self):
def test_build(self):
ninja_build = Ninja(
args=self.args,
toolchain=self.toolchain,
source_dir=self.workspace.source_dir('ninja'),
build_dir=self.workspace.build_dir('build', 'ninja'))

ninja_build.do_build()
ninja_build.build()

expect_env = ""
if platform.system() == "Darwin":
Expand Down