-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.gradle
62 lines (53 loc) · 1.97 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
def reguiredGradleVersionMajor = 2
def requiredGradleVersionMinor = 0
def (gradleVersionMajor, gradleVersionMinor) =
getGradle().gradleVersion.tokenize('.').collect { it.toInteger() }
if (gradleVersionMajor < reguiredGradleVersionMajor ||
(gradleVersionMajor == reguiredGradleVersionMajor &&
gradleVersionMinor < requiredGradleVersionMinor)) {
throw new GradleException("Gradle version " +
"$reguiredGradleVersionMajor.$requiredGradleVersionMinor and higher required.")
}
allprojects {
apply plugin: 'java'
apply plugin: 'idea'
repositories {
mavenCentral()
}
}
task octopusTools(type: Exec) {
workingDir './python/octopus-tools'
commandLine 'python3', 'setup.py', 'install', '--user'
}
task bjoernTools(type: Exec, dependsOn: octopusTools) {
workingDir './python/bjoern-tools'
commandLine 'python3', 'setup.py', 'install', '--user'
}
task deploy(dependsOn: build) << {
copy {
into "projects/octopus/octopus-server/plugins"
from fileTree("projects/bjoern-plugins").files
include '**/*.jar'
exclude '**/*-plain.jar'
includeEmptyDirs = false
}
}
build.dependsOn subprojects.build
build.dependsOn bjoernTools
configure(project(':projects:bjoern-plugins').subprojects) {
task jarWithDep(type: Jar) {
doFirst {
def pluginJars = configurations.runtime.minus(project(':projects:octopus:octopus-server').configurations.runtime).asCollection()
pluginJars.remove(new File(project(':projects:octopus:octopus-server').buildDir.toString() + '/libs/octopus-server.jar'))
pluginJars.add(new File(project.buildDir.toString() + '/libs/' + project.name + '-plain.jar'))
baseName = project.name
from { pluginJars.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
}
jar {
baseName = project.name + '-plain'
}
jarWithDep.dependsOn(jar)
assemble.dependsOn(jarWithDep)
}