guard-gradle 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2375d2d250302e9a6462d77e78859075603d914
4
- data.tar.gz: 9685635149c0654588f5be5f12d46f775619dde7
3
+ metadata.gz: bfd3695ea8f4aa6b55bf39505e482c3ab4134c7a
4
+ data.tar.gz: af822d9c0f4a9cfc6ac096c50345902c3232b13e
5
5
  SHA512:
6
- metadata.gz: 54274d938a34d1ab3753d294924f39d54ff2c35ac8edfcaaf70077891e12d4dfa2ae0f3083a4ccb2be063818291524873a4d848eb97e954e6b5314d2e1fc9203
7
- data.tar.gz: c1fe46c6c4cfd7dbdebaabe2efa303f2f12a5730f4f3afd42580aaf509094eac67ed928179a3b59dfe69650878e01a243164f56673666e5243bdc5b4ac00342e
6
+ metadata.gz: 7983230c702ad23e8c42f0870d196336c6c9df124a4795c87b6a0da31328f8ab2c30474bd52e33c0df833ba0590558288074455972bed9f3230a7f196667bdc6
7
+ data.tar.gz: e02f26953d514ede284a0724856bc46cda73fc382063443ca6b79ffd944a3679ec2f67a63cc8e29bdd27727900c7b17e93e8ded2699654d023790c5a136e11c7
data/README.md CHANGED
@@ -69,7 +69,7 @@ $ bundle exec guard init gradle
69
69
  The default `Guardfile` will look like this:
70
70
 
71
71
  ```ruby
72
- guard :nebula do
72
+ guard :gradle do
73
73
  watch(%r{^src/main/(.+)\.*$}) { |m| m[1].split('.')[0].split('/')[-1] }
74
74
  end
75
75
  ```
@@ -97,6 +97,18 @@ Note, the plugin will try and execute the exact corresponding test for a changed
97
97
 
98
98
  For example, if you change the file `DataCentuar.groovy`, if there is a corresponding `DataCentuarTest` or `DataCentuarSpec` _only_ that test is executed via the `-Dsingle.run` Gradle parameter. Otherwise, if no analogous test is found, the entire test suite is run.
99
99
 
100
+ ### Multi-project builds
101
+
102
+ If you have a multi-project build, you can still use Guard:Gradle. You'll need to edit your `Guardfile` slightly by adding a special `multi_project` flag and passing in the project names. For instance, if you have a multi-project with two projects named "Foo" and "Bar", your `Guardfile` will need to look like so:
103
+
104
+ ```ruby
105
+ guard :gradle, multi_project: true do
106
+ watch(%r{^Foo/src/main/(.+)\.*$}) { |m| "Foo/" + m[1].split('.')[0].split('/')[-1]}
107
+ watch(%r{^Bar/src/main/(.+)\.*$}) { |m| "Bar/" + m[1].split('.')[0].split('/')[-1] }
108
+ end
109
+ ```
110
+ Be sure to have this `Guardfile` in the root of your project.
111
+
100
112
  ## Notifications
101
113
 
102
114
  Guard works natively with Growl. There are other options as well -- feel free to check out the [Guard wiki page](https://github.com/guard/guard/wiki/System-notifications) for more information.
@@ -10,8 +10,8 @@ module Guard
10
10
  @multi_projs = false
11
11
 
12
12
  def initialize(options = {})
13
- if options.has_key? :multi_projects
14
- @multi_projs = options[:multi_projects]
13
+ if options.has_key? :multi_project
14
+ @multi_projs = options[:multi_project]
15
15
  end
16
16
  super
17
17
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module GradleVersion
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
5
5
  end
@@ -21,4 +21,12 @@ class GuardGradleTest < Test::Unit::TestCase
21
21
  Dir.expects(:glob).returns([])
22
22
  plugin.run_on_changes [expected]
23
23
  end
24
+
25
+ def test_for_multi_projects
26
+ plugin = Guard::Gradle.new({multi_project: true})
27
+ expected = 'Foo/User'
28
+ plugin.expects(:fire_command).with('./gradlew test -p Foo -Dtest.single=User --daemon')
29
+ Dir.expects(:glob).returns([true])
30
+ plugin.run_on_changes [expected]
31
+ end
24
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-gradle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Ricker