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 +4 -4
- data/README.md +13 -1
- data/lib/guard/gradle.rb +2 -2
- data/lib/guard/gradle/version.rb +1 -1
- data/test/guard_gradle_test.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfd3695ea8f4aa6b55bf39505e482c3ab4134c7a
|
4
|
+
data.tar.gz: af822d9c0f4a9cfc6ac096c50345902c3232b13e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 :
|
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.
|
data/lib/guard/gradle.rb
CHANGED
@@ -10,8 +10,8 @@ module Guard
|
|
10
10
|
@multi_projs = false
|
11
11
|
|
12
12
|
def initialize(options = {})
|
13
|
-
if options.has_key? :
|
14
|
-
@multi_projs = options[:
|
13
|
+
if options.has_key? :multi_project
|
14
|
+
@multi_projs = options[:multi_project]
|
15
15
|
end
|
16
16
|
super
|
17
17
|
end
|
data/lib/guard/gradle/version.rb
CHANGED
data/test/guard_gradle_test.rb
CHANGED
@@ -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
|