diff --git a/tools/oss-check b/tools/oss-check index 5566d39a3d5..e84485c04d8 100755 --- a/tools/oss-check +++ b/tools/oss-check @@ -164,7 +164,7 @@ def generate_reports(branch) print "Linting #{iterations} iterations of #{repo} with #{branch}: 1" durations = [] start = Time.now - command = "../builds/swiftlint-#{branch} lint --no-cache #{'--enable-all-rules' unless @only_rules_changed} --reporter xcode" + command = "../builds/.build/release/swiftlint lint --no-cache #{'--enable-all-rules' unless @only_rules_changed} --reporter xcode" File.open("../#{branch}_reports/#{repo}.txt", 'w') do |file| puts "\n#{command}" if @options[:verbose] Open3.popen2(command) do |_, stdout, wait_thr| @@ -208,7 +208,11 @@ def build(branch) perform("git worktree add --detach #{dir} #{target}") end - build_command = "cd #{dir}; bazel build -c opt @SwiftLint//:swiftlint && mv bazel-bin/swiftlint swiftlint-#{branch}" + Dir.chdir(dir) do + FileUtils.rm_rf %w[Packages .build] + end + + build_command = "cd #{dir}; swift build -c release" perform(build_command) return if $?.success? @@ -311,26 +315,12 @@ validate_state_to_run fetch_origin set_globals print_rules_changed +setup_repos make_directory_structure # Build & generate reports for branch & main %w[branch main].each do |branch| build(branch) -end - -full_version_branch = `#{@working_dir}/builds/swiftlint-branch version --verbose` -full_version_main = `#{@working_dir}/builds/swiftlint-main version --verbose` - -if full_version_branch == full_version_main - message "Skipping OSSCheck because SwiftLint hasn't changed compared to 'main'" - # Clean up - clean_up unless @options[:skip_clean] - exit -end - -setup_repos - -%w[branch main].each do |branch| generate_reports(branch) end