lib/motion/project/vendor.rb
# This removes the various build dirs that may exist in either `:static` or
# `:xcode` vendored projects.
#
# In the case of an `:xcode` vendored project, it will first run
# `xcodebuild clean` with the exact same options as it was build with. This
# to ensure that cached build artefacts that are outside of the build dir
# are cleaned up as well. For instance those in:
# `$TMPDIR/../C/com.apple.DeveloperTools/*/Xcode/SharedPrecompiledHeaders`.
#
# @param [Array<String>] platforms
#        The platform identifiers for which to perform a clean.
#
# @return [void]
#
# @todo Seeing as this method gets the exact platforms to clean for, we can
#       get rid of the list of all build dirs and ask for the exact build
#       dir from the `config`.
#
This removes the various build dirs that may exist in either `:static` or
`:xcode` vendored projects.

In the case of an `:xcode` vendored project, it will first run
`xcodebuild clean` with the exact same options as it was build with. This
to ensure that cached build artefacts that are outside of the build dir
are cleaned up as well.
This removes the various build dirs that may exist in either ` : static ` or ` : xcode ` vendored projects . In the case of an ` : xcode ` vendored project it will first run ` xcodebuild clean ` with the exact same options as it was build with . This to ensure that cached build artefacts that are outside of the build dir are cleaned up as well .
def clean(platforms)
      if @type == :xcode && File.exist?(@path)
        Dir.chdir(@path) do
          platforms.each do |platform|
            path = relative_path("./#{xcodeproj_path}")
            App.info 'Clean', "#{path} for platform `#{platform}'"
            xcodebuild(platform, 'clean')
          end
        end
      end
      [XcodeBuildDir, 'build', 'build-iPhoneSimulator', 'build-iPhoneOS', 'build-WatchSimulator', 'build-WatchOS', 'build-AppleTVSimulator', 'build-AppleTVOS', 'build-MacOSX'].each do |build_dir|
        build_dir = File.join(@path, build_dir)
        if File.exist?(build_dir)
          App.info 'Delete', relative_path(build_dir)
          FileUtils.rm_rf build_dir
          if File.exist?(build_dir)
            App.fail "Failed to remove `#{relative_path(build_dir)}'. Please remove this path manually."
          end
        end
      end
      Dir.chdir(@path) do
        if File.exist?(bridgesupport_build_path)
          FileUtils.rm bridgesupport_build_path
        end
      end
    end
def clean ( platforms ) if @type == :xcode && File . exist? ( @path ) Dir . chdir ( @path ) do platforms . each do | platform | path = relative_path ( "./#{xcodeproj_path}" ) App . info 'Clean' , "#{path} for platform `#{platform}'" xcodebuild ( platform , 'clean' ) end end end [ XcodeBuildDir , 'build' , 'build-iPhoneSimulator' , 'build-iPhoneOS' , 'build-WatchSimulator' , 'build-WatchOS' , 'build-AppleTVSimulator' , 'build-AppleTVOS' , 'build-MacOSX' ] . each do | build_dir | build_dir = File . join ( @path , build_dir ) if File . exist? ( build_dir ) App . info 'Delete' , relative_path ( build_dir ) FileUtils . rm_rf build_dir if File . exist? ( build_dir ) App . fail "Failed to remove `#{relative_path(build_dir)}'. Please remove this path manually." end end end Dir . chdir ( @path ) do if File . exist? ( bridgesupport_build_path ) FileUtils . rm bridgesupport_build_path end end end
This removes the various build dirs that may exist in either `:static` or
`:xcode` vendored projects.
This removes the various build dirs that may exist in either ` : static ` or ` : xcode ` vendored projects .
# It can happen that because of file permissions a dir/file is not # actually removed, which can lead to confusing issues.
None
void
platforms
platforms The platform identifiers for which to perform a clean.
platforms The platform identifiers for which to perform a clean .
todo
Seeing as this method gets the exact platforms to clean for, we can get rid of the list of all build dirs and ask for the exact build dir from the `config`.
Seeing as this method gets the exact platforms to clean for we can get rid of the list of all build dirs and ask for the exact build dir from the ` config ` .