-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
executable file
·104 lines (86 loc) · 2.85 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
plugins {
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '2.0.2'
id "com.moowork.node" version "1.2.0" //https://github.com/srs/gradle-node-plugin
id "de.undercouch.download" version "3.4.1" //https://github.com/michel-kraemer/gradle-download-task
id "com.github.jruby-gradle.base" version "1.5.0"
}
import com.github.jrubygradle.JRubyExec
repositories {
jcenter()
}
version = '0.1.0'
sourceCompatibility = '1.8'
mainClassName = 'io.vertx.core.Launcher'
def vertxVersion = '3.5.1'
def mainVerticleName = 'MyJavaScriptVerticle.js'
def watchForChange = 'app/**'
def doOnChange = './gradlew classes'
def vertxConfigFile = 'vertx-config.json'
dependencies {
compile "io.vertx:vertx-core:$vertxVersion"
compile "io.vertx:vertx-lang-js:$vertxVersion" // JS Lang
compile "io.vertx:vertx-lang-ruby:$vertxVersion" // Ruby Lang
compile "io.vertx:vertx-hazelcast:$vertxVersion"
compile "io.vertx:vertx-config:$vertxVersion"
jrubyExec 'rubygems:bundler:1.15.4'
testCompile "junit:junit:4.12"
testCompile "io.vertx:vertx-unit:$vertxVersion"
}
processResources {
from 'app'
from ('node_modules') {into 'node_modules'}
from ('build/ruby_gems') {into 'ruby_gems'}
// from ('build/node_modules') {into 'node_modules'}
}
shadowJar {
classifier = 'fat'
manifest {
attributes "Main-Verticle": mainVerticleName
}
mergeServiceFiles {
include 'META-INF/services/io.vertx.core.spi.VerticleFactory'
}
}
run {
args = ['run', mainVerticleName,
"--redeploy=$watchForChange",
"--launcher-class=$mainClassName",
"--on-redeploy=$doOnChange",
"-conf $vertxConfigFile"
]
}
task run_Cluster(type: JavaExec) {
classpath sourceSets.main.runtimeClasspath
main = mainClassName
args = ['run', mainVerticleName,
"--redeploy=$watchForChange",
"--launcher-class=$mainClassName",
"--on-redeploy=$doOnChange",
"-conf $vertxConfigFile",
"-cluster"
]
}
task wrapper(type: Wrapper) {
gradleVersion = '4.6.0'
}
// Disabled until ability to have custom package.json and node_modules folder.
// node {
// // Version of node to use.
// version = '8.10.0'
// // Version of npm to use.
// npmVersion = '5.7.1'
// // Base URL for fetching node distributions (change if you have a mirror).
// distBaseUrl = 'https://nodejs.org/dist'
// // If true, it will download node using above parameters.
// // If false, it will try to use globally installed node.
// download = true
// // Set the work directory where node_modules should be located
// nodeModulesDir = file("${project.projectDir}/build")
// }
task bundleInstall(type: JRubyExec) {
workingDir file('./') //Path to gemfile
script 'bundle'
scriptArgs 'install', "--path=${project.projectDir}/build/ruby_gems/vendor/bundle"
}