Skip to content

Commit e0dfa7e

Browse files
committed
Nodeclipse/Enide build.gradle template for Node.js/Avatar.js project
1 parent 8866883 commit e0dfa7e

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Nodeclipse/Enide build.gradle template for Node.js/Avatar.js project
3+
* https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/templates/hello-world/build.gradle
4+
* Usage
5+
* 1. put in project root
6+
* 2. check version numbers
7+
* 3. use from command line `gradle run` or http://marketplace.eclipse.org/content/gradle
8+
* Support for this template
9+
* https://github.com/nodeclipse/nodeclipse-1/issues/
10+
* @author Paul Verest, Opal
11+
*/
12+
apply plugin: 'java'
13+
apply plugin: 'eclipse'
14+
apply plugin: 'idea'
15+
16+
println "Gradle "+gradle.gradleVersion
17+
println "Java "+org.gradle.internal.jvm.Jvm.current()
18+
19+
repositories {
20+
maven {
21+
url "https://maven.java.net/content/repositories/public/"
22+
}
23+
}
24+
25+
dependencies {
26+
compile "com.oracle:avatar-js:0.10.25-SNAPSHOT"
27+
compile "com.oracle:libavatar-js-win-x64:0.10.25-SNAPSHOT"
28+
}
29+
30+
task copyLibs(type: Copy) {
31+
from configurations.compile
32+
into 'lib'
33+
//TODO files need to be renamed
34+
}
35+
36+
/*
37+
sourceSets {
38+
main {
39+
java {
40+
srcDir 'src'
41+
}
42+
resources {
43+
srcDir 'src'
44+
}
45+
}
46+
}
47+
*/
48+
49+
//http://stackoverflow.com/questions/23148214/gradle-task-to-run-nashorn-javascript
50+
task run(type: Exec) {
51+
println 'runHelloWorld1'
52+
// java -Djava.library.path=lib -jar lib/avatar-js.jar helloWorld.js
53+
commandLine 'java', '-Djava.library.path=lib', '-jar', 'lib/avatar-js.jar', 'hello-world-server.js'
54+
println 'runHelloWorld1 finished'
55+
}
56+
task run2(type: JavaExec) {
57+
println 'runHelloWorld2'
58+
args 'hello-world-server.js'
59+
main 'com.oracle.avatar.js.Server'
60+
systemProperties 'java.library.path':'lib'
61+
classpath 'lib/avatar-js.jar'
62+
println 'runHelloWorld2 finished'
63+
}

org.nodeclipse.ui/templates/hello-world/hello-world-server.njs renamed to org.nodeclipse.ui/templates/hello-world/hello-world-server.js

File renamed without changes.

0 commit comments

Comments
 (0)