|
@@ -65,6 +65,7 @@ task build: [:cmake] do
|
|
|
concurrent = '/maxCpuCount'
|
|
concurrent = '/maxCpuCount'
|
|
|
else
|
|
else
|
|
|
concurrent = "-j #{$max_jobs}"
|
|
concurrent = "-j #{$max_jobs}"
|
|
|
|
|
+ filter = "2>#{lint_err_file}" if ENV['URHO3D_LINT']
|
|
|
end
|
|
end
|
|
|
system %Q{cmake --build "#{build_tree}" #{build_config} #{target} -- #{concurrent} #{ENV['BUILD_PARAMS']} #{filter}} or abort
|
|
system %Q{cmake --build "#{build_tree}" #{build_config} #{target} -- #{concurrent} #{ENV['BUILD_PARAMS']} #{filter}} or abort
|
|
|
system "ccache -s" if ENV['USE_CCACHE']
|
|
system "ccache -s" if ENV['USE_CCACHE']
|
|
@@ -75,6 +76,9 @@ task :test do
|
|
|
if ENV['PLATFORM'] == 'android'
|
|
if ENV['PLATFORM'] == 'android'
|
|
|
Rake::Task['gradle'].invoke('test')
|
|
Rake::Task['gradle'].invoke('test')
|
|
|
next
|
|
next
|
|
|
|
|
+ elsif ENV['URHO3D_LINT']
|
|
|
|
|
+ Rake::Task['lint'].invoke
|
|
|
|
|
+ next
|
|
|
end
|
|
end
|
|
|
dir = build_tree
|
|
dir = build_tree
|
|
|
wrapper = ENV['CI'] && ENV['PLATFORM'] == 'linux' ? 'xvfb-run' : ''
|
|
wrapper = ENV['CI'] && ENV['PLATFORM'] == 'linux' ? 'xvfb-run' : ''
|
|
@@ -89,6 +93,12 @@ task :gradle, [:task] do |_, args|
|
|
|
system "./gradlew #{args[:task]} #{ENV['CI'] ? '--console plain' : ''}" or abort
|
|
system "./gradlew #{args[:task]} #{ENV['CI'] ? '--console plain' : ''}" or abort
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
+task :lint do
|
|
|
|
|
+ lint_err = File.read(lint_err_file)
|
|
|
|
|
+ puts lint_err
|
|
|
|
|
+ abort 'Failed to pass linter checks' unless lint_err.empty?
|
|
|
|
|
+ puts 'Passed the linter checks'
|
|
|
|
|
+end
|
|
|
|
|
|
|
|
### Internal methods ###
|
|
### Internal methods ###
|
|
|
|
|
|
|
@@ -127,6 +137,10 @@ def init_default
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
+def lint_err_file
|
|
|
|
|
+ 'build/clang-tidy.out'
|
|
|
|
|
+end
|
|
|
|
|
+
|
|
|
|
|
|
|
|
# Load custom rake scripts
|
|
# Load custom rake scripts
|
|
|
Dir['.github/workflows/*.rake'].each { |r| load r }
|
|
Dir['.github/workflows/*.rake'].each { |r| load r }
|