Skip to content
This repository has been archived by the owner on Jun 22, 2019. It is now read-only.

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmp85 committed Jun 29, 2015
2 parents 9b7c347 + 6b12a54 commit d4d5493
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 28 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
sudo: false
language: objective-c
before_install:
- brew update
install:
- mkdir -p $(brew --repo)/Library/Taps/travis
- ln -s $PWD $(brew --repo)/Library/Taps/travis/homebrew-testtap
- brew tap --repair
- gem install rubocop
script:
- rubocop --config=$(brew --repo)/Library/.rubocop.yml iwyu.rb
- brew audit iwyu
- brew install -v iwyu
- brew test iwyu
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
### homebrew-iwyu v2.0.0 (June 28, 2015) ###

* Installs include-what-you-use 0.4

* Requires Xcode 6.1 or higher

* Compiles against LLVM 3.6

* Updates project page links

* Improves Travis CI build

### homebrew-iwyu v1.0.0 (December 6, 2014) ###

* Uses prebuilt tarball instead of compiling from source
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 Jason Petersen
Copyright (c) 2014–2015 Jason Petersen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Homebrew IWYU

This formula makes it easy to install `include-what-you-use` on any modern OS X system.

Just `brew tap jasonmp85/iwyu` and then `brew install iwyu`. Be patient: `include-what-you-use` depends on LLVM, which will take a while to build.
Just `brew tap jasonmp85/iwyu` and then `brew install iwyu`.

Using `iwyu`
------------
Expand All @@ -29,11 +29,11 @@ Tell make to use it as the C compiler: `make -k CC=iwyu`. It's necessary to use
Copyright
---------

Copyright (c) 2014 Jason Petersen
Copyright © 2014–2015 Jason Petersen

Code released under the [MIT License](LICENSE).

[status]: https://travis-ci.org/jasonmp85/homebrew-iwyu
[release]: https://github.com/jasonmp85/homebrew-iwyu/releases/latest
[license]: LICENSE
[iwyu-page]: http://include-what-you-use.com
[iwyu-page]: http://include-what-you-use.org
48 changes: 24 additions & 24 deletions iwyu.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
require 'English'
require 'formula'
require "English"
require "formula"

# include-what-you-use needs access to headers included with LLVM 3.5, which
# is only present in Xcode version 6.0 or higher.
class Xcode6 < Requirement
# include-what-you-use needs access to headers included with LLVM 3.6, which
# is only present in Xcode version 6.1 or higher.
class Xcode61 < Requirement
fatal true

satisfy { MacOS::Xcode.version >= '6.0' }
satisfy { MacOS::Xcode.version >= "6.1" }

def message
'Xcode 6.0 or newer is required for this package.'
"Xcode 6.1 or newer is required for this package."
end
end

Expand All @@ -18,43 +18,43 @@ def message
# build and install include-what-you-use, symlink it as iwyu, and install a
# Python wrapper to automatically correct includes (fix_include).
class Iwyu < Formula
CLANG_VERSION = '3.5'
CLANG_VERSION = "3.6"

homepage 'https://code.google.com/p/include-what-you-use/'
url 'http://include-what-you-use.com/downloads/' +
"include-what-you-use-#{Iwyu::CLANG_VERSION}-macosx-apple-darwin.tar.gz"
sha1 '7f38d22c3da1c9924179b522a9f4299373cddcd8'
version '0.3'
version "0.4"
homepage "http://include-what-you-use.org"
url "http://include-what-you-use.org/downloads/" \
"include-what-you-use-#{version}-x86_64-apple-darwin.tar.gz"
sha1 "616cc2cd39d068896a94a40fb761e135e64db840"

depends_on Xcode6
depends_on Xcode61

def install
clang_libs = "#{MacOS::Xcode.toolchain_path}/usr/lib/clang/6.0"
iwyu_clang_path = (lib / 'clang')
clang_libs = "#{MacOS::Xcode.toolchain_path}/usr/lib/clang/6.1.0"
iwyu_clang_path = (lib / "clang")

iwyu_clang_path.mkpath
iwyu_clang_path.install_symlink(clang_libs => "#{Iwyu::CLANG_VERSION}.0")

bin.install('fix_includes.py' => 'fix_include')
bin.install('include-what-you-use')
bin.install_symlink('include-what-you-use' => 'iwyu')
bin.install("fix_includes.py" => "fix_include")
bin.install("include-what-you-use")
bin.install_symlink("include-what-you-use" => "iwyu")
end

test do
# write out a header and a C file relying on transitive dependencies
(testpath / 'demo.h').write('#include <stdio.h>')
(testpath / 'demo.c').write <<-EOS.undent
(testpath / "demo.h").write("#include <stdio.h>")
(testpath / "demo.c").write <<-EOS.undent
#include "demo.h"
int main(void)
{ printf("hello world"); }
EOS

# iwyu always exits with status 1 so assert that and capture output
fixes = shell_output "iwyu #{testpath}/demo.c 2>&1", 1
# iwyu exits with a code equal to the number of suggested edits + 2
fixes = shell_output "iwyu #{testpath}/demo.c 2>&1", 4

# pass the output to the fixer script and assert that it fixed one file
results = pipe_output 'fix_include', fixes
results = pipe_output "fix_include", fixes

assert_match(/IWYU edited 1 file/, results)

Expand Down

0 comments on commit d4d5493

Please sign in to comment.