Podfile DSL is backwards #1922

Closed
dblock opened this Issue Mar 25, 2014 · 10 comments

Projects

None yet

6 participants

@dblock
dblock commented Mar 25, 2014

The Podfile DSL seems backwards. I have two projects: Demo.xcproj and Tests.xcproj, so naturally I was writing:

workspace "ARASCIISwizzle"

...

xcodeproj "Tests.xcodeproj" do
  target "Tests" do
    pod 'Specta', '~> 0.2.1'
    pod 'Expecta', '~> 0.2.3'
    pod 'FBSnapshotTestCase', :head
  end
end

xcodeproj "Demo.xcodeproj" do
  target "Demo" do
    pod "FLKAutoLayout", "~> 0.1.1"
  end
end

This is also what you see when you open XCode, you have projects and within them, targets.

However, this doesn't work, the right syntax is backwards:

workspace "ARASCIISwizzle"

...

target "Tests" do
  pod 'Specta', '~> 0.2.1'
  pod 'Expecta', '~> 0.2.3'
  pod 'FBSnapshotTestCase', :head
  xcodeproj "Tests.xcodeproj"
end

target "Demo" do
  pod "FLKAutoLayout", "~> 0.1.1"
  xcodeproj "Demo.xcodeproj"
end

Since you're rethinking this DSL, @orta told me to open this :)

@fabiopelosin
Member

This topic has been already discussed with @alloy and it will be part of the new DSL. The DSL will have 3 layers:

workspace "MyWorkspace" do
  project "MyProject" do
    target "Tests" do
      configuration "Development" do
        pod 'Specta', '~> 0.2.1'
      end
    end
  end
end

Features:

  • If there is only one project in the directory the first two levels (workspace & project) are optional and will be inferred.
  • If you specify a dependency at a given level all the sub levels will inherit it.

Further feedback is very welcome in this topic! 🍻

@orta
Member
orta commented Mar 26, 2014

that is 4 layers ;)

But ^ is exactly the sort of thing I expected when we started making the Podfile. Which is great IMO.

@mokagio
mokagio commented Mar 26, 2014

@irrationalfab @alloy @orta 👍 I really like the layers approach!

@alloy
Member
alloy commented Mar 27, 2014

(Updated @irrationalfab’s comment to rename build_configuration to configuration.)

@fabiopelosin
Member

that is 4 layers ;)

🙊

@dblock
dblock commented Mar 27, 2014

What does 'configuration' correspond to in XCode?

@orta
Member
orta commented Mar 27, 2014

screen shot 2014-03-27 at 8 25 45 am

@dblock
dblock commented Mar 27, 2014

As much as I hate underscores, maybe it's worth keeping naming consistent and make it build_configuration? 0.02c.

@fabiopelosin fabiopelosin self-assigned this Mar 27, 2014
@alloy
Member
alloy commented Mar 30, 2014

You are correct. I wrongly remembered the Xcode UI referring to it as just ‘configuration’.

@kylef
Contributor
kylef commented Sep 14, 2014

Going to close this, it's already tracked by #840.

@kylef kylef closed this Sep 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment