-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
60 lines (51 loc) · 1.58 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
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'application'
// Don't need these task, so disabling them. Makes it possible to avoid
// declaring a single application main class.
startScripts.enabled = false
run.enabled = false
// Also don't need the regular application distribution packages since
// this is just a set of samples. So disabling to make the build output
// cleaner
distTar.enabled=false
distZip.enabled=false
applicationName = 'SampleMqttClient'
version = ''
jar {
baseName = 'SampleMqttClient'
version = version
manifest {
attributes 'Implementation-Title': 'Solace MQTT 3.1.1 Example',
'Implementation-Version': version
}
}
repositories {
mavenCentral()
}
dependencies {
compile("org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.0")
}
task createAllStartScripts() << {
// just a placeholder
}
def scripts = [ 'SampleMqttClient':'com.solace.labs.mqtt.SampleMqttClient' ]
scripts.each() { scriptName, className ->
def t = tasks.create(name: scriptName+'StartScript', type: CreateStartScripts) {
mainClassName = className
applicationName = scriptName
outputDir = new File(project.buildDir, 'scripts')
classpath = jar.outputs.files + project.configurations.runtime
}
applicationDistribution.into("bin") {
from(t)
fileMode = 0755
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
createAllStartScripts.dependsOn(t)
}
installDist {
destinationDir = new File(project.buildDir, 'staged')
}
assemble.dependsOn installDist