Sha256: 457b9c088d4ace0512f6caecceeb708c09f961fa1035828ccaae6d2f4d3948ec

Contents?: true

Size: 634 Bytes

Versions: 25

Compression:

Stored size: 634 Bytes

Contents

require "fastlane_core"
require "xcodeproj"

module FastlaneCore
  class Project

    # Returns project targets
    def targets
      project_path = get_project_path
      return [] if project_path.nil?

      proj = Xcodeproj::Project.open(project_path)

      proj.targets.map do |target|
       target.name
     end
    end

    private

    def get_project_path
      # Given the workspace and scheme, we can compute project path
      if workspace?
        if options[:workspace] && options[:scheme]
          build_settings(key: "PROJECT_FILE_PATH")
        end
      else
        options[:project]
      end
    end

  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
xcov-1.8.1 lib/xcov/project_extensions.rb
xcov-1.8.0 lib/xcov/project_extensions.rb
xcov-1.7.5 lib/xcov/project_extensions.rb
xcov-1.7.4 lib/xcov/project_extensions.rb
xcov-1.7.3 lib/xcov/project_extensions.rb
xcov-1.7.2 lib/xcov/project_extensions.rb
xcov-1.7.1 lib/xcov/project_extensions.rb
xcov-1.7.0 lib/xcov/project_extensions.rb
xcov-1.6.0 lib/xcov/project_extensions.rb
xcov-1.5.1 lib/xcov/project_extensions.rb
xcov-1.5.0 lib/xcov/project_extensions.rb
xcov-1.4.3 lib/xcov/project_extensions.rb
xcov-1.4.2 lib/xcov/project_extensions.rb
xcov-1.4.1 lib/xcov/project_extensions.rb
xcov-1.4.0 lib/xcov/project_extensions.rb
xcov-1.3.5 lib/xcov/project_extensions.rb
xcov-1.3.4 lib/xcov/project_extensions.rb
xcov-1.3.3 lib/xcov/project_extensions.rb
xcov-1.3.2 lib/xcov/project_extensions.rb
xcov-1.3.1 lib/xcov/project_extensions.rb