Skip to content

Commit

Permalink
#23 fix rake deletion. clean and deep clean do what they're supposed to
Browse files Browse the repository at this point in the history
  • Loading branch information
andystanton committed May 15, 2016
1 parent cfde993 commit 53d8e0e
Showing 1 changed file with 24 additions and 47 deletions.
71 changes: 24 additions & 47 deletions rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,25 @@ rescue Exception => problem
end

deep_clean_list = [
"lib/*/*.build",
"lib/*/cmake_install.cmake",
"lib/*/CMakeFiles",
"lib/*/CMakeScripts",
"lib/*/build",
"lib/*/Makefile",
"lib/*/cmake_uninstall.cmake",
"lib/*/CTestTestfile.cmake",
"lib/*/*/cmake_install.cmake",
"lib/*/*/CMakeFiles",
"lib/*/*/CMakeScripts",
"lib/*/*/build",
"lib/*/*/Makefile",
"lib/*/*/cmake_uninstall.cmake",
"lib/*/*/CTestTestfile.cmake",
"build",
"build/lib/*.a",
"build/lib/*/cmake_install.cmake",
"build/lib/*/CMakeFiles",
"build/lib/*/Makefile",
"build/lib/gmock/gtest",
"lib/*.a",
"lib/gmock/gtest",
"lib/freetype2/include/ftconfig.hpp",
"lib/Debug",
"lib/Release",
"build"
]

laundry_list = [
"cmake",
"cmake_install.cmake",
"CMakeCache.txt",
"CMakeFiles",
"CMakeScripts",
"CPackConfig.cmake",
"CPackSourceConfig.cmake",
"CTestTestfile.cmake",
"src/cmake_install.cmake",
"src/CMakeCache.txt",
"src/CMakeFiles",
"src/CMakeScripts",
"src/CTestTestfile.cmake",
"test/cmake_install.cmake",
"test/CMakeCache.txt",
"test/CMakeFiles",
"test/CMakeScripts",
"test/CTestTestfile.cmake",
"Makefile",
"build/CMakeCache.txt",
"build/CMakeFiles",
"build/CTestTestfile.cmake",
"build/Makefile",
"build/Testing",
"build/bin",
"*.build"
"build/cmake_install.cmake",
"build/src",
"build/test"
]

desc 'Cleans the project by deleting everything listed in the laundry list'
Expand All @@ -69,6 +43,7 @@ end

desc 'Deep cleans the project by deleting everything listed in the laundry list and the deep clean list (includes libraries)'
task :deepclean do
Rake::Task["clean"].invoke
puts 'Executing deep clean...'

count = 0
Expand All @@ -81,13 +56,16 @@ task :deepclean do
end

desc 'Generates makefiles using CMake'
task :configure do
puts 'Executing configure...'
task :configure, :toolchain do |t, args|
toolchain = args[:toolchain]

mkdir_p('build')
Dir.chdir('build') do
sh "cmake .."
end
toolchain_setting = "-DCMAKE_TOOLCHAIN_FILE=../toolchains/#{toolchain}" unless toolchain.nil?

puts 'Executing configure...'
mkdir_p('build')
Dir.chdir('build') do
sh "cmake #{toolchain_setting} .."
end
end

desc 'Builds the application and unit tests using Make'
Expand All @@ -109,7 +87,6 @@ task :test do
sh "cat build/Testing/Temporary/LastTest.log"
exit 1
end

end

desc 'Starts the application'
Expand Down

0 comments on commit 53d8e0e

Please sign in to comment.