This repository has been archived by the owner on Sep 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
76 lines (70 loc) · 2.42 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* Node.js
* http://www.nodeclipse.org/projects/gradle
* Nodeclipse/Enide build.gradle template/drop-in for Node.js/Avatar.js project, version 0.16
* https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/templates/hello-world/build.gradle
* This file lets you optionally run Node.js app as Java Avatar.js app
* Usage
* 1. put in project root
* 2. check version numbers, OS (no x32 bit OS support)
* 3. execute `gradle copyLibs` to get libraries locally (then you can proceed even without gradle)
* 4. use from command line `gradle run` or with http://marketplace.eclipse.org/content/gradle Run As ->
* Support for this template
* https://github.com/nodeclipse/nodeclipse-1/issues/
* History
* 2014-04-25 rename to run, add <<
* 2014-04-29 state that `gradle copyLibs` step is required
* 2014-05-20 =['src'] instead of 'src'
* @author Paul Verest
*/
println GradleVersion.current().prettyPrint()
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
repositories {
maven {
url "https://maven.java.net/content/repositories/public/"
}
//mavenCentral()
//jcenter()
}
dependencies {
compile "com.oracle:avatar-js:0.10.25-SNAPSHOT"
compile "com.oracle:libavatar-js-win-x64:0.10.25-SNAPSHOT"
//compile fileTree(dir: 'libs', include: '*.jar')
//testCompile "junit:junit:4.11"
}
task copyLibs(type: Copy) {
from configurations.compile
into 'lib' // ! not libs
//TODO files need to be renamed
}
/* uncomment for adding Java sources
sourceSets {
main {
java.srcDirs = ['src']
resources.srcDirs = ['src']
}
test {
java.srcDirs = ['tests']
resources.srcDirs = ['tests']
}
}
task initSourceFolders { // add << before { to prevent executing during configuration phase
sourceSets*.java.srcDirs*.each { it.mkdirs() }
sourceSets*.resources.srcDirs*.each { it.mkdirs() }
}
*/
task run(type: Exec) <<{
println 'runHelloWorld1'
// java -Djava.library.path=lib -jar lib/avatar-js.jar hello-world-server.js
commandLine 'java', '-Djava.library.path=lib', '-jar', 'lib/avatar-js.jar', 'hello-world-server.js'
println 'runHelloWorld1 finished'
}
task run2(type: JavaExec) <<{
println 'runHelloWorld2'
args 'hello-world-server.js'
main 'com.oracle.avatar.js.Server'
systemProperties 'java.library.path':'lib'
classpath 'lib/avatar-js.jar'
println 'runHelloWorld2 finished'
}