Rakefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Rakefile
  2. # Copyright (C) 2018 Mike JS Choi
  3. # Copyright (C) 2018 VLC authors and VideoLAN
  4. # $Id$
  5. #
  6. # Authors: Mike JS. Choi <mkchoi212 # icloud.com>
  7. #
  8. # This program is free software; you can redistribute it and/or modify it
  9. # under the terms of the GNU Lesser General Public License as published by
  10. # the Free Software Foundation; either version 2.1 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU Lesser General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU Lesser General Public License
  19. # along with this program; if not, write to the Free Software Foundation,
  20. # Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  21. #
  22. # ------------------------------------------------------------- Constants ------
  23. SDK_SIM = 'iphonesimulator11.3'
  24. SDK_SIM_DEST = "'platform=iOS Simulator,name=iPhone 7,OS=11.3'"
  25. SCHEME_IOS = 'MobileVLCKitTests'
  26. PROJECT_IOS = 'MobileVLCKit.xcodeproj'
  27. VLC_FLAGS_IOS = '-dva x86_64'
  28. # ----------------------------------------------------------------- Tasks ------
  29. desc 'Build VLCKit (iOS)'
  30. task 'build:vlckit:ios' do
  31. puts 'Building VLCKit (iOS)'
  32. plugin_file = 'Resources/MobileVLCKit/vlc-plugins-iPhone.h'
  33. required_dirs = ['./libvlc/vlc/install-iPhoneSimulator', './libvlc/vlc/build-iPhoneSimulator']
  34. if File.exist?(plugin_file) && dirs_exist?(required_dirs)
  35. puts 'Found pre-existing build directory. Skipping build'
  36. else
  37. sh "./compileAndBuildVLCKit.sh #{VLC_FLAGS_IOS}"
  38. end
  39. end
  40. desc 'Run MobileVLCKit tests'
  41. task 'test:ios' do
  42. puts 'Running tests for MobileVLCKit'
  43. sh "xcodebuild -project #{PROJECT_IOS} -scheme #{SCHEME_IOS} -sdk #{SDK_SIM} -destination #{SDK_SIM_DEST} test"
  44. end
  45. # ------------------------------------------------------------- Functions ------
  46. def dirs_exist?(directories)
  47. directories.each do |dir|
  48. return false unless Dir.exist?(dir)
  49. end
  50. end