Skip to content

Commit 825da44

Browse files
committed
Gradle templates 2014-04-25 rename to run, add <<
1 parent a7c9320 commit 825da44

File tree

7 files changed

+59
-8
lines changed

7 files changed

+59
-8
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
src
12
build
23
.gradle

org.nodeclipse.enide.editors.gradle/docs/android/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* 2014-03-13 android plugin updated to 0.9, see http://tools.android.com/tech-docs/new-build-system/migrating_to_09
1414
* 2014-04-01 check for gradle version
1515
* 2014-04-10 wrapper and runAndroidApplication tasks
16+
* 2014-04-25 rename to run, add <<
1617
* @author Paul Verest
1718
*/
1819
println GradleVersion.current().prettyPrint()
@@ -67,7 +68,9 @@ android {
6768
}
6869
}
6970

70-
task runAndroidApplication(type: Exec, dependsOn: ':installDebug') {
71+
// runAndroidApplication
72+
task run (type: Exec, dependsOn: ':installDebug') << {
73+
println 'asdasd'
7174
//TODO update Activity name below or find a way to get it from AndroidManifest.xml
7275
if (System.properties['os.name'].toLowerCase().contains('windows')) {
7376
// windows
@@ -77,5 +80,3 @@ task runAndroidApplication(type: Exec, dependsOn: ':installDebug') {
7780
commandLine 'adb', 'shell', 'am', 'start', '-n', "com.example.androidapptorun.MainActivity"
7881
}
7982
}
80-
81-

org.nodeclipse.enide.editors.gradle/docs/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// JavaQuickStart example from Pivotal Gradle IDE
2+
13
apply plugin: 'java'
24
apply plugin: 'eclipse'
35

org.nodeclipse.enide.editors.gradle/docs/java/basic/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@
66
* Usage
77
* 1. create folder (or general Eclipse project) and put this file inside
88
* 2. run `gradle initSourceFolders eclipse` or `gradle initSourceFolders idea`
9-
* @author Paul Verest;
109
* based on `gradle init --type basic`, that does not create source folders
10+
* History
11+
* 2014-04-25 remove <<
12+
* @author Paul Verest;
1113
*/
1214
println GradleVersion.current().prettyPrint()
1315

1416
apply plugin: 'java'
1517
apply plugin: 'eclipse'
1618
apply plugin: 'idea'
1719

18-
task initSourceFolders << {
20+
task initSourceFolders { // add << before { to prevent executing during configuration phase
1921
sourceSets*.java.srcDirs*.each { it.mkdirs() }
2022
sourceSets*.resources.srcDirs*.each { it.mkdirs() }
2123
}

org.nodeclipse.enide.editors.gradle/docs/java/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ println GradleVersion.current().prettyPrint()
1111
apply plugin: 'java'
1212
apply plugin: 'eclipse'
1313

14-
task initSourceFolders << {
14+
task initSourceFolders { // add << before { to prevent executing during configuration phase
1515
sourceSets*.java.srcDirs*.each { it.mkdirs() }
1616
sourceSets*.resources.srcDirs*.each { it.mkdirs() }
1717
}

org.nodeclipse.enide.gradle/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,45 @@ or with [(Enide) Gradle for Eclipse, Jetty, Android](http://marketplace.eclipse.
9292
[1]: http://i.stack.imgur.com/q9RHN.png
9393
[2]: http://i.stack.imgur.com/ZGOah.png
9494

95+
## Notes about tasks and Build Lifecycle
96+
97+
from Chapter 55. The Build Lifecycle http://www.gradle.org/docs/current/userguide/build_lifecycle.html
98+
99+
// in `settings.gradle`
100+
// println 'This is executed during the initialization phase.'
101+
102+
println 'This is executed during the configuration phase.'
103+
104+
task configure {
105+
println 'This is also executed during the configuration phase.'
106+
}
107+
108+
task execute << {
109+
println 'This is executed during the execution phase.'
110+
}
111+
112+
run with `gradle help`
113+
114+
output:
115+
116+
This is executed during the initialization phase.
117+
This is executed during the configuration phase.
118+
This is also executed during the configuration phase.
119+
:help
120+
121+
Welcome to Gradle 1.10.
122+
123+
To run a build, run gradle <task> ...
124+
125+
To see a list of available tasks, run gradle tasks
126+
127+
To see a list of command-line options, run gradle --help
128+
129+
BUILD SUCCESSFUL
130+
131+
Total time: 1.882 secs
132+
133+
95134
## Jetty
96135

97136
As with Maven, your `build.gradle` should have jetty configuration

org.nodeclipse.ui/templates/hello-world/build.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* 3. use from command line `gradle run` or with http://marketplace.eclipse.org/content/gradle Run As ->
99
* Support for this template
1010
* https://github.com/nodeclipse/nodeclipse-1/issues/
11+
* History
12+
* 2014-04-25 rename to run, add <<
1113
* @author Paul Verest
1214
*/
1315
println GradleVersion.current().prettyPrint()
@@ -44,16 +46,20 @@ sourceSets {
4446
}
4547
}
4648
}
49+
task initSourceFolders { // add << before { to prevent executing during configuration phase
50+
sourceSets*.java.srcDirs*.each { it.mkdirs() }
51+
sourceSets*.resources.srcDirs*.each { it.mkdirs() }
52+
}
4753
*/
4854

4955
//http://stackoverflow.com/questions/23148214/gradle-task-to-run-nashorn-javascript
50-
task run(type: Exec) {
56+
task run(type: Exec) <<{
5157
println 'runHelloWorld1'
5258
// java -Djava.library.path=lib -jar lib/avatar-js.jar hello-world-server.js
5359
commandLine 'java', '-Djava.library.path=lib', '-jar', 'lib/avatar-js.jar', 'hello-world-server.js'
5460
println 'runHelloWorld1 finished'
5561
}
56-
task run2(type: JavaExec) {
62+
task run2(type: JavaExec) <<{
5763
println 'runHelloWorld2'
5864
args 'hello-world-server.js'
5965
main 'com.oracle.avatar.js.Server'

0 commit comments

Comments
 (0)