Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

rswift 1.1.1 (new formula) #48357

Closed
wants to merge 6 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions Library/Formula/rswift.rb
@@ -0,0 +1,17 @@
class Rswift < Formula
desc "Get strong typed, autocompleted resources like images, fonts and segues"
homepage "https://github.com/mac-cain13/R.swift"
url "https://github.com/mac-cain13/R.swift.git",
:tag => "v1.1.1",
:revision => "3a6db62164d8f50ccdf43e59894fffb672fd5e3f"
depends_on :xcode => "7.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave an empty line between the :revision and first depends_on, Thanks!


def install
xcodebuild "-configuration", "Release", "-scheme", "rswift", "SYMROOT=symroot", "OBJROOT=objroot"
bin.install "symroot/Release/rswift"
end

test do
system "rswift", "-h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can’t we write a test that does something more substantial than e.g. -h/v? Also, use "#{bin}/rswift" instead of "rswift" to have the full path. Thanks!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point @bfontaine, @tomasharkema asked me to take a look at the possibilities for a better test.

I think it’s a bit hard to really use the tool in a test, since that would need a valid iOS Xcode project. Creating a fixture for that would be a bit of a hassle I think.

The project itself tests if it output is correct using CI, so if we know that the binary is functional by executing it with a -h flag then I’m pretty sure everything is ok. I agree a test that actually uses the tool is better, but I think it’s not worth the hassle and maintenance in this case.

Also, I noted some other tools also use this kind of tests, so it seems like a good fallback to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. If it’s too hard to create a resource for this it’s fine as is. Just replace "rswift" with "#{bin}/rswift".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end
end