|
1 | 1 | buildscript { |
2 | | - ext.kotlin_version = '1.3.61' |
3 | | - |
4 | 2 | repositories { |
5 | 3 | mavenCentral() |
| 4 | + maven { url "https://dl.bintray.com/spinnaker/gradle/" } |
6 | 5 | } |
7 | 6 | dependencies { |
8 | | - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
| 7 | + classpath("com.netflix.spinnaker.gradle:spinnaker-extensions:$spinnakerGradleVersion") |
9 | 8 | } |
10 | 9 | } |
11 | 10 |
|
12 | | -apply plugin: 'kotlin' |
13 | | -apply plugin: 'kotlin-kapt' |
14 | | - |
15 | | -repositories { |
16 | | - mavenLocal() |
17 | | - mavenCentral() |
18 | | - jcenter() |
19 | | - maven{ |
20 | | - url "https://jitpack.io" |
21 | | - } |
| 11 | +plugins { |
| 12 | + id("com.palantir.git-version").version("0.12.2") |
| 13 | + id("com.moowork.node").version("1.3.1").apply(false) |
22 | 14 | } |
| 15 | +apply plugin: "io.spinnaker.plugin.bundler" |
23 | 16 |
|
24 | | -dependencies { |
25 | | - compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" |
26 | | - compileOnly (group: 'org.springframework', name: 'spring-context', version: '5.2.1.RELEASE') |
27 | | - compileOnly (group: 'com.netflix.spinnaker.kork', name: 'kork-plugins-spring-api', version: '7.17.0') |
28 | | - compileOnly (group: 'org.springframework', name: 'spring-web', version: '5.2.2.RELEASE') |
29 | | - compileOnly (group: 'com.netflix.spinnaker.orca', name: 'orca-core', version: '7.83.0') { |
30 | | - exclude group: "org.slf4j" |
31 | | - } |
32 | | - compile("com.github.canal-pipelines:canal:v0.1.1") { |
33 | | - exclude group: "org.slf4j" |
34 | | - exclude group: "com.netflix.spinnaker.orca" |
35 | | - } |
36 | | - implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.28' |
37 | | - |
38 | | - testImplementation "org.junit.jupiter:junit-jupiter-api:5.3.2" |
39 | | - testImplementation group: 'io.strikt', name: 'strikt-core', version: '0.22.1' |
40 | | - testImplementation group: 'dev.minutest', name: 'minutest', version: '1.10.0' |
41 | | - |
42 | | - testRuntime "org.junit.jupiter:junit-jupiter-engine:5.3.2" |
43 | | - testRuntime "org.junit.platform:junit-platform-launcher:1.3.2" |
| 17 | +spinnakerBundle { |
| 18 | + pluginId = "Armory.SpringExamplePlugin" |
| 19 | + description = "An example of a Spring based plugin that requires no extension points." |
| 20 | + provider = "https://github.com/claymccoy" |
| 21 | + version = rootProject.version |
44 | 22 | } |
45 | 23 |
|
46 | | -jar { |
47 | | - manifest { |
48 | | - attributes 'Plugin-Class': "${pluginClass}", |
49 | | - 'Plugin-Id': "${pluginId}", |
50 | | - 'Plugin-Version': "${version}", |
51 | | - 'Plugin-Provider': "${pluginProvider}", |
52 | | - 'Plugin-Unsafe': "${pluginUnsafe}" |
53 | | - } |
54 | | -} |
| 24 | +version = normalizedVersion() |
55 | 25 |
|
56 | | -tasks { |
57 | | - test { |
58 | | - useJUnitPlatform() |
59 | | - afterTest { descriptor, result -> |
60 | | - // work around a bug in Gradle versions before 6.1, see https://github.com/junit-team/junit5/issues/2041 |
61 | | - println "\n$descriptor.className [$descriptor.classDisplayName] > $descriptor.name [$descriptor.displayName]: $result.resultType" |
62 | | - } |
63 | | - } |
| 26 | +subprojects { |
| 27 | + group = "io.armory.plugin.example.spring" |
| 28 | + version = rootProject.version |
64 | 29 | } |
65 | 30 |
|
66 | | -task assemblePlugin(type: Zip) { |
67 | | - baseName = "${pluginId}" |
68 | | - into('classes') { |
69 | | - with jar |
| 31 | +String normalizedVersion() { |
| 32 | + String fullVersion = gitVersion() |
| 33 | + String normalized = fullVersion.split("-").first() |
| 34 | + if (fullVersion.contains("dirty")) { |
| 35 | + return "$normalized-SNAPSHOT" |
| 36 | + } else { |
| 37 | + return normalized |
70 | 38 | } |
71 | | - into('lib') { |
72 | | - from configurations.compile |
73 | | - } |
74 | | -} |
75 | | -assemble.dependsOn project.tasks.assemblePlugin |
76 | | - |
77 | | -task copyPluginJars(type: Copy) { |
78 | | - from configurations.compile |
79 | | - into rootProject.buildDir.path + '\\' +'jars' |
80 | | -} |
81 | | - |
82 | | -task copyPluginIdxs(type: Copy) { |
83 | | - from rootProject.buildDir.path + '\\tmp\\kapt3\\classes' |
84 | | - into rootProject.buildDir.path + '\\classes\\kotlin' |
85 | 39 | } |
86 | | - |
87 | | -build.dependsOn project.tasks.copyPluginJars |
88 | | -build.dependsOn project.tasks.copyPluginIdxs |
0 commit comments