-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
55 lines (48 loc) · 1.81 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
allprojects {
version = '1.0.6'
repositories {
mavenCentral()
}
apply plugin: 'maven-publish'
apply plugin: 'java'
}
subprojects {
publishing {
publications {
maven(MavenPublication) {
groupId = 'pt.lsts.imc4j'
from components.java
}
}
}
}
clean {
delete fileTree(dir: 'dist' , include: '**/*.jar')
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
}
def createLauncher(proj, String launcherName, String destFolder, String jarName, String classBackseat,
boolean synckClock, boolean runAsHttpServer, String classHttpServer, String httpPort,
boolean httpConfigHotReload) {
configure(proj) {
proj.tasks.create("launcher${launcherName.capitalize().replaceAll('[-_]+(\\w?)', '$1')}", Copy) {
description = "Generate $name launcher"
group = 'Distribution'
def workTmpDirectory = "${rootDir}/${destFolder}"
outputs.upToDateWhen { false }
from("${rootProject.projectDir}/stubs") {
include 'launcher.stub'
rename ".*", "${launcherName.uncapitalize()}.sh"
filter { it.replaceAll("@JARNAME@", "${jarName}") }
filter { it.replaceAll("@CLASS_BACKSEAT@", "${classBackseat}") }
filter { it.replaceAll("@SYNC_CLOCK@", synckClock ? "" : "#") }
filter { it.replaceAll("@RUN_AS_HTTP_SERVER@", runAsHttpServer ? "" : "#") }
filter { it.replaceAll("@CLASS_SERVER@", "${classHttpServer}") }
filter { it.replaceAll("@HTTP_PORT@", "${httpPort}") }
filter { it.replaceAll("@HOT_CONFIG@", httpConfigHotReload ? "" : "#") }
}
into workTmpDirectory
}
}
}