author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Wed, 31 May 2017 09:53:13 +0300 | |
changeset 2141 | 4f0427df770d |
parent 2130 | 511c1dd5b010 |
child 2156 | de9f7c02b6e9 |
permissions | -rw-r--r-- |
2078 | 1 |
|
2 |
======== |
|
3 |
Gradle |
|
4 |
======== |
|
5 |
.. contents:: |
|
6 |
:local: |
|
7 |
||
8 |
Getting help |
|
9 |
============ |
|
10 |
:: |
|
11 |
||
12 |
$ gradle --help |
|
13 |
||
2094
33c10259cb4d
Running build on specific subproject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2086
diff
changeset
|
14 |
Working with subprojects |
33c10259cb4d
Running build on specific subproject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2086
diff
changeset
|
15 |
======================== |
33c10259cb4d
Running build on specific subproject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2086
diff
changeset
|
16 |
|
33c10259cb4d
Running build on specific subproject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2086
diff
changeset
|
17 |
Getting list of subprojects:: |
2083
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
18 |
|
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
19 |
$ gradle projects |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
20 |
|
2094
33c10259cb4d
Running build on specific subproject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2086
diff
changeset
|
21 |
Running build on specific subproject:: |
33c10259cb4d
Running build on specific subproject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2086
diff
changeset
|
22 |
|
33c10259cb4d
Running build on specific subproject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2086
diff
changeset
|
23 |
$ gradle :$SUB:clean |
33c10259cb4d
Running build on specific subproject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2086
diff
changeset
|
24 |
$ gradle -p $SUB clean |
2095
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
25 |
|
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
26 |
If subproject lies in hierarchy:: |
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
27 |
|
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
28 |
$ gradle :$SUB/$SUBSUB:clean |
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
29 |
$ gradle -p $SUB/$SUBSUB clean |
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
30 |
|
2104
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
31 |
Skip building dependent modules, build just current module:: |
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
32 |
|
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
33 |
$ gradle -a build |
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
34 |
$ gradle --no-rebuild build |
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
35 |
$ gradle -a :client:build |
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
36 |
|
2095
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
37 |
Creating multilevel project:: |
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
38 |
|
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
39 |
$ mkdir $PRJROOT |
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
40 |
$ cd $PRJROOT |
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
41 |
$ mkdir lvl1 lvl1/lvl2 |
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
42 |
$ touch build.gradle lvl1/build.gradle lvl1/lvl2/build.gradle |
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
43 |
$ { echo include "'lvl1'"; echo include "'lvl1/lvl2'"; } >settings.gradle |
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
44 |
$ gradle projects |
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
45 |
|
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
46 |
``settings.gradle`` can include per line or a list of subprojects:: |
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
47 |
|
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
48 |
include 'sub1', 'sub2', 'sub2' |
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
49 |
include 'lvl1' |
b9bf144836b8
Creating multilevel project.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2094
diff
changeset
|
50 |
include 'lvl1/lvl2' |
2094
33c10259cb4d
Running build on specific subproject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2086
diff
changeset
|
51 |
|
33c10259cb4d
Running build on specific subproject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2086
diff
changeset
|
52 |
https://docs.gradle.org/current/userguide/intro_multi_project_builds.html |
33c10259cb4d
Running build on specific subproject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2086
diff
changeset
|
53 |
http://stackoverflow.com/questions/16976214/gradle-build-only-one-module |
33c10259cb4d
Running build on specific subproject.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2086
diff
changeset
|
54 |
|
2130
511c1dd5b010
Running completely isolated build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2120
diff
changeset
|
55 |
Running completely isolated build |
511c1dd5b010
Running completely isolated build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2120
diff
changeset
|
56 |
================================= |
511c1dd5b010
Running completely isolated build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2120
diff
changeset
|
57 |
|
511c1dd5b010
Running completely isolated build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2120
diff
changeset
|
58 |
To avoid using global cache and for really clean build use:: |
511c1dd5b010
Running completely isolated build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2120
diff
changeset
|
59 |
|
511c1dd5b010
Running completely isolated build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2120
diff
changeset
|
60 |
$ gradle --no-daemon --gradle-user-home ./.gradle.local |
511c1dd5b010
Running completely isolated build.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2120
diff
changeset
|
61 |
|
2104
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
62 |
Managing tasks |
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
63 |
============== |
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
64 |
|
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
65 |
List tasks:: |
2078 | 66 |
|
67 |
$ gradle tasks |
|
68 |
||
2083
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
69 |
Getting list of supported tasks in each subproject:: |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
70 |
|
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
71 |
$ gradle tasks --all |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
72 |
|
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
73 |
Getting help on task:: |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
74 |
|
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
75 |
$ gradle -q help --task build |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
76 |
|
2086 | 77 |
Similar but to each task:: |
78 |
||
79 |
$ gradle model |
|
80 |
||
2104
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
81 |
Skip task during build with ``-x`` option:: |
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
82 |
|
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
83 |
$ gradle -x test build |
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
84 |
$ gradle -x :core:build :client:build |
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
85 |
|
2078 | 86 |
Build sources |
87 |
============= |
|
88 |
:: |
|
89 |
||
90 |
$ gradle compileJava |
|
91 |
$ gradle compileTestJava |
|
92 |
||
2118
df69c36275d6
Build with additional options and checks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2117
diff
changeset
|
93 |
Build with additional options and checks:: |
df69c36275d6
Build with additional options and checks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2117
diff
changeset
|
94 |
|
df69c36275d6
Build with additional options and checks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2117
diff
changeset
|
95 |
compileJava { |
df69c36275d6
Build with additional options and checks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2117
diff
changeset
|
96 |
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" |
df69c36275d6
Build with additional options and checks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2117
diff
changeset
|
97 |
} |
df69c36275d6
Build with additional options and checks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2117
diff
changeset
|
98 |
compileTestJava { |
df69c36275d6
Build with additional options and checks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2117
diff
changeset
|
99 |
options.encoding = 'UTF-8' |
df69c36275d6
Build with additional options and checks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2117
diff
changeset
|
100 |
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" |
df69c36275d6
Build with additional options and checks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2117
diff
changeset
|
101 |
} |
df69c36275d6
Build with additional options and checks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2117
diff
changeset
|
102 |
|
2119
3fd683bb6af2
Apply change recursively to subprojects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2118
diff
changeset
|
103 |
To apply change recursively to subprojects:: |
3fd683bb6af2
Apply change recursively to subprojects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2118
diff
changeset
|
104 |
|
3fd683bb6af2
Apply change recursively to subprojects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2118
diff
changeset
|
105 |
subprojects { |
3fd683bb6af2
Apply change recursively to subprojects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2118
diff
changeset
|
106 |
tasks.withType(JavaCompile) { |
3fd683bb6af2
Apply change recursively to subprojects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2118
diff
changeset
|
107 |
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" |
3fd683bb6af2
Apply change recursively to subprojects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2118
diff
changeset
|
108 |
} |
3fd683bb6af2
Apply change recursively to subprojects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2118
diff
changeset
|
109 |
} |
3fd683bb6af2
Apply change recursively to subprojects.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2118
diff
changeset
|
110 |
|
2078 | 111 |
Run main class |
112 |
============== |
|
113 |
:: |
|
114 |
||
115 |
$ gradle run |
|
116 |
||
2086 | 117 |
Run tests |
118 |
========= |
|
2104
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
119 |
|
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
120 |
To run test:: |
2086 | 121 |
|
122 |
$ gradle test |
|
123 |
||
2104
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
124 |
To skip tests in build:: |
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
125 |
|
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
126 |
$ gradle -x test build |
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
127 |
|
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
128 |
Better solution involves passing system property with ``build.gradle``:: |
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
129 |
|
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
130 |
test.onlyIf { ! Boolean.getBoolean('skip.tests') } |
6931c02bbc0e
Skipping tasks and dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2095
diff
changeset
|
131 |
|
2086 | 132 |
To run tests with additional registered checks:: |
133 |
||
134 |
$ gradle check |
|
135 |
||
136 |
.. note:: |
|
137 |
``--rerun-tasks`` option *specifies that any task optimization is ignored*. |
|
138 |
In that way you may rerun tests even if there are no changed files:: |
|
139 |
||
140 |
$ gradle test --rerun-tasks |
|
141 |
||
2120 | 142 |
By default ``System.out`` and ``Sysyem.err`` redirected so you wouldn't see |
143 |
anything about test on console. |
|
144 |
||
145 |
Quick way to see test output is:: |
|
146 |
||
147 |
$ gradle test -i |
|
148 |
||
149 |
Alternatively configure ``test`` task:: |
|
150 |
||
151 |
test { |
|
152 |
testLogging { |
|
153 |
events "passed", "skipped", "failed" //, "standardOut", "standardError" |
|
154 |
||
155 |
showExceptions true |
|
156 |
exceptionFormat "full" |
|
157 |
showCauses true |
|
158 |
showStackTraces true |
|
159 |
||
160 |
showStandardStreams = false |
|
161 |
} |
|
162 |
} |
|
163 |
||
2078 | 164 |
Stopping server |
165 |
=============== |
|
166 |
:: |
|
167 |
||
168 |
$ gradle --stop |
|
169 |
||
2083
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
170 |
List project dependencies |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
171 |
========================= |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
172 |
|
2086 | 173 |
List of project execution dependencies (it also download dependencies):: |
2083
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
174 |
|
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
175 |
$ gradle dependencies |
2086 | 176 |
$ gradle dependencies --configuration compile |
2083
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
177 |
$ gradle dependencies -p $SUBPROJ |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
178 |
$ gradle :$SUBPROJ:dependencies |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
179 |
$ gradle :$SUBPROJ:dependencies --configuration testCompile |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
180 |
|
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
181 |
List of project plugin dependencies:: |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
182 |
|
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
183 |
$ gradle buildEnvironment |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
184 |
$ gradle buildEnvironment -p $SUBPROJ |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
185 |
$ gradle :$SUBPROJ:buildEnvironment |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
186 |
|
2086 | 187 |
Paths to dependencies can be printed via task:: |
188 |
||
189 |
task printDepPaths { |
|
190 |
doLast { configurations.runtime.each { println it } } |
|
191 |
} |
|
192 |
||
193 |
All dependencies can be copied to single directory via task:: |
|
194 |
||
195 |
task copyRuntimeLibs(type: Copy) { |
|
196 |
into "lib" |
|
197 |
from configurations.runtime |
|
198 |
// from configurations.testRuntime - configurations.runtime |
|
199 |
} |
|
200 |
||
2083
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
201 |
List project properties |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
202 |
======================= |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
203 |
:: |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
204 |
|
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
205 |
$ gradle properties |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
206 |
$ gradle :$SUBPROJ:properties |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
207 |
$ gradle properties -p $SUBPROJ |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
208 |
|
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
209 |
Dry tun |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
210 |
======= |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
211 |
|
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
212 |
``-m`` option allow parsing build scripts without actually executing them:: |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
213 |
|
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
214 |
$ gradle -m clean compile |
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
215 |
|
2108
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
216 |
Managing Gradle cache |
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
217 |
===================== |
2083
75ae6a4ad500
Getting list of supported tasks. List project dependencies. List project properties.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2078
diff
changeset
|
218 |
|
2108
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
219 |
Work in offline mode with ``--offline`` option. |
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
220 |
|
2120 | 221 |
Invalidate cache (force re-downloading dependencies) with |
222 |
``--refresh-dependencies`` option. |
|
2108
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
223 |
|
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
224 |
Alternatively remove ``~/.m2/repository/`` and ``~/.gradle/caches`` directories. |
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
225 |
|
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
226 |
Gradle cached modules declared as *changing*:: |
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
227 |
|
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
228 |
dependencies { |
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
229 |
compile("com.evil:evil-api:1.0.1-SNAPSHOT") { changing=true } |
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
230 |
} |
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
231 |
|
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
232 |
Default timeout is 24 hours and can be reset/changed via:: |
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
233 |
|
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
234 |
configurations.all { |
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
235 |
resolutionStrategy.cacheChangingModulesFor 0, 'seconds' |
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
236 |
} |
651a45561a46
Managing Gradle cache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2104
diff
changeset
|
237 |
|
2117
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
238 |
Download sources and javadoc of dependencies |
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
239 |
============================================ |
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
240 |
|
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
241 |
To download sources and javadoc of dependencies to local ``~/.gradle`` cache add |
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
242 |
``idea`` plugin to your ``build.gradle``:: |
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
243 |
|
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
244 |
apply plugin: 'idea' |
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
245 |
idea.module.downloadJavadoc = true |
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
246 |
idea.module.downloadSources = true |
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
247 |
|
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
248 |
and invoke plugin:: |
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
249 |
|
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
250 |
$ gradle idea |
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
251 |
|
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
252 |
To wipe out Idea projects file after plug-in run:: |
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
253 |
|
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
254 |
$ gradle cleanIdea |
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
255 |
|
22f21cc41569
Download sources and javadoc of dependencies.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2108
diff
changeset
|
256 |