-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
126 lines (110 loc) · 3.75 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://nexus.bertramlabs.com/content/repositories/snapshots" }
maven { url "https://nexus.bertramlabs.com/content/repositories/releases" }
maven { url "https://nexus.bertramlabs.com/content/repositories/publicReleases" }
}
dependencies {
classpath 'com.github.johnrengelman:shadow:8.1.1'
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:$assetPipelineVersion"
classpath "com.morpheusdata:morpheus-plugin-gradle:$morphPluginGradleVersion"
}
}
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'asset-pipeline'
apply plugin: 'com.morpheusdata.morpheus-plugin-gradle'
group 'com.morpheusdata.digitalocean'
sourceCompatibility = '1.11'
targetCompatibility = '1.11'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven { url "https://nexus.bertramlabs.com/content/repositories/snapshots" }
maven { url "https://nexus.bertramlabs.com/content/repositories/releases" }
maven { url "https://nexus.bertramlabs.com/content/repositories/publicReleases" }
}
configurations {
provided
}
dependencies {
provided "com.morpheusdata:morpheus-plugin-api:$morphPluginApiVersion"
provided "org.codehaus.groovy:groovy-all:$groovyVersion"
implementation "org.slf4j:slf4j-api:$slf4jVersion"
implementation "org.slf4j:slf4j-parent:$slf4jVersion"
implementation 'org.apache.httpcomponents:httpclient:4.5.3'
implementation 'org.apache.httpcomponents:httpcore:4.4.5'
// Include morpheus-core and it's dependencies
testImplementation "com.morpheusdata:morpheus-plugin-api:$morphPluginApiVersion"
testImplementation 'io.reactivex.rxjava3:rxjava:3.1.8'
testImplementation "org.slf4j:slf4j-nop:$slf4jVersion"
testImplementation "org.slf4j:slf4j-parent:$slf4jVersion"
testImplementation("com.bertramlabs.plugins:karman-core:2.0.9") {
exclude module: 'groovy-all'
}
testImplementation "org.codehaus.groovy:groovy-all:$groovyVersion"
testImplementation 'net.bytebuddy:byte-buddy:1.9.3'
testImplementation 'org.objenesis:objenesis:2.6'
testImplementation "org.spockframework:spock-core:$spockVersion"
testImplementation 'cglib:cglib-nodep:3.2.12'
}
sourceSets {
main {
compileClasspath += configurations.provided
}
}
jar {
manifest {
attributes(
'Plugin-Class': 'com.morpheusdata.digitalocean.DigitalOceanPlugin',
'Plugin-Version': version,
'Morpheus-Name': 'DigitalOcean',
'Morpheus-Organization': 'morpheus',
'Morpheus-Code': 'digital-ocean-plugin',
'Morpheus-Description': 'Plugin for DigitalOcean',
'Morpheus-Logo': 'assets/digitalocean.svg',
'Morpheus-Logo-Dark': 'assets/digitalocean.svg',
'Morpheus-Color': '#ffffff',
'Morpheus-Labels': 'Plugin, cloud',
'Morpheus-Repo': 'https://github.com/gomorpheus/morpheus-digital-ocean-plugin',
'Morpheus-Min-Appliance-Version': morphApplianceMinVersion,
)
}
}
task(console, dependsOn: 'classes', type: JavaExec) {
main = 'groovy.ui.Console'
classpath = sourceSets.main.runtimeClasspath
}
test {
testLogging {
exceptionFormat = 'full'
showStandardStreams = true
}
}
shadowJar {
// archiveFileName = "${project.name}-${version}.jar"
}
task copyRuntimeLibs(type: Copy) {
into "lib"
from project.configurations.runtimeClasspath - project.configurations.provided
}
tasks.assemble.dependsOn tasks.shadowJar
tasks.register('moveToPlugin') {
doLast {
ant.move file: "${buildDir}/libs/${project.name}-${version}-all.jar",
todir: "../morpheus-plugins"
}
}
// Runs assemble and copyToMorpheus
tasks.register('publishToMorpheus') {
dependsOn tasks.shadowJar
dependsOn 'moveToPlugin'
tasks.findByName('moveToPlugin').mustRunAfter 'shadowJar'
}