-
Notifications
You must be signed in to change notification settings - Fork 21
/
build.gradle
72 lines (59 loc) · 2.14 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
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 = 'solace-samples-mqtt'
version = ''
jar {
archiveBaseName = 'solace-samples-mqtt'
archiveVersion = ''
manifest {
attributes 'Implementation-Title': 'Solace Getting Started Samples',
'Implementation-Version': ''
}
}
repositories {
mavenCentral()
}
dependencies {
implementation "org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.0"
//implementation "com.googlecode.json-simple:json-simple:1.1.1"
implementation group: 'org.json', name: 'json', version: '20211205'
}
tasks.withType(JavaCompile).all {
options.compilerArgs.add("-Xlint:all")
}
def scripts = [ 'topicPublisher':'com.solace.samples.TopicPublisher',
'topicSubscriber':'com.solace.samples.TopicSubscriber',
'basicRequestor':'com.solace.samples.BasicRequestor',
'basicReplier':'com.solace.samples.BasicReplier',
'confirmedPublish':'com.solace.samples.ConfirmedDeliveryProducer',
'QoS1Producer':'com.solace.samples.QoS1Producer',
'QoS1Consumer':'com.solace.samples.QoS1Consumer'
]
scripts.each() { scriptName, className ->
def t = tasks.create(name: scriptName+'StartScript', type: CreateStartScripts) {
mainClass = className
applicationName = scriptName
outputDir = new File(project.buildDir, 'scripts')
classpath = jar.outputs.files + project.configurations.runtimeClasspath
}
applicationDistribution.into("bin") {
from(t)
fileMode = 0755
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}
installDist {
destinationDir = new File(project.buildDir, 'staged')
}
assemble.dependsOn installDist