Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bcd7b636 authored by Hsin-chen Chuang's avatar Hsin-chen Chuang
Browse files

floss: build.py: Add clippy target

Bug: 343315863
Tag: #floss
Test: mmm packages/modules/Bluetooth
Test: ./build.py --target clippy
Flag: EXEMPT, Floss-only changes
Change-Id: Ia7bbcc4128b48ea0f69d97b11aa14a48d88bccf9
parent bc8d7d3e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ VALID_TARGETS = [
    'prepare',  # Prepare the output directory (gn gen + rust setup)
    'rust',  # Build only the rust components + copy artifacts to output dir
    'test',  # Run the unit tests
    'clippy',  # Run cargo clippy
    'utils',  # Build Floss utils
]

@@ -494,6 +495,12 @@ class HostBuild():
                             cwd=os.path.join(self.output_dir),
                             env=self.env)

    def _target_clippy(self):
        """ Runs cargo clippy, a collection of lints to catch common mistakes.
        """
        cmd = ['cargo', 'clippy']
        self.run_command('rust', cmd, cwd=os.path.join(self.platform_dir, 'bt'), env=self.env)

    def _target_utils(self):
        """ Builds the utility applications.
        """
@@ -605,6 +612,8 @@ class HostBuild():
            self._target_main()
        elif self.target == 'test':
            self._target_test()
        elif self.target == 'clippy':
            self._target_clippy()
        elif self.target == 'clean':
            self._target_clean()
        elif self.target == 'install':