Skip to content

Commit 6ae5761

Browse files
committed
optimize build for debugging
updated kork and orca deps build now makes jars and .idx files available without creating a zip debugging instructions added to readme
1 parent e02c9f0 commit 6ae5761

File tree

2 files changed

+34
-10
lines changed

2 files changed

+34
-10
lines changed

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ Your plugin needs to extend PrivilegedSpringPlugin and implement registerBeanDef
1818

1919
We will probably need was way for registerBeanDefinitions(BeanDefinitionRegistry) to conditionally load beans based on the service that it is used in. I didn't see a good way to do that. It would be possible to cast BeanDefinitionRegistry to DefaultListableBeanFactory and look at the serializationId, but that relies on some implementation details.
2020

21-
Build with `./gradlew build` and copy that zip under `/build` into the plugins location of your service (by default the `/plugins` directory under your service root.
21+
<h2>Usage</h2>
2222

23-
The following should be added to your service yml config.
23+
1) Run `./gradlew assemblePlugin`
24+
2) Put the `/build/distributions/Armory.SpringExtensionPlugin-X.X.X.zip` in the configured plugins location for Orca.
25+
3) Configure Orca. Put the following in orca.yml.
2426
```
2527
spinnaker:
2628
extensibility:
@@ -32,3 +34,19 @@ newproperties:
3234
test: 'test1'
3335
```
3436

37+
To debug the plugin inside Orca using IntelliJ Idea follow these steps:
38+
39+
1) Create a `springPluginExample.plugin-ref` file under `orca\plugins\` that looks like this with the correct path to the plugin project.
40+
```
41+
{
42+
"pluginPath": "<plugin project path>",
43+
"classesDirs": [
44+
"<plugin project path>/build/classes/kotlin/main"],
45+
"libsDirs": [
46+
"<plugin project path>/build/jars"]
47+
}
48+
```
49+
2) Link the plugin project in IntelliJ (the `+` button in the Gradle tab and select the plugin build.gradle).
50+
3) Configure Orca the same way specified above.
51+
4) Create a new IntelliJ run configuration for Orca that has the VM option `-Dpf4j.mode=development` and does a `Build Project` before launch.
52+
5) Debug away...

build.gradle

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ repositories {
2424
dependencies {
2525
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
2626
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.13.0')
27+
compileOnly (group: 'com.netflix.spinnaker.kork', name: 'kork-plugins-spring-api', version: '7.17.0')
2828
compileOnly (group: 'org.springframework', name: 'spring-web', version: '5.2.2.RELEASE')
29-
compileOnly (group: 'com.netflix.spinnaker.orca', name: 'orca-core', version: '7.78.0') {
29+
compileOnly (group: 'com.netflix.spinnaker.orca', name: 'orca-core', version: '7.83.0') {
3030
exclude group: "org.slf4j"
3131
}
3232
compile("com.github.canal-pipelines:canal:v0.1.1") {
@@ -63,20 +63,26 @@ tasks {
6363
}
6464
}
6565

66-
task plugin(type: Jar) {
66+
task assemblePlugin(type: Zip) {
6767
baseName = "${pluginId}"
6868
into('classes') {
6969
with jar
7070
}
7171
into('lib') {
7272
from configurations.compile
7373
}
74-
extension('zip')
7574
}
75+
assemble.dependsOn project.tasks.assemblePlugin
7676

77-
task assemblePlugin(type: Copy) {
78-
from plugin
79-
into rootProject.buildDir.path
77+
task copyPluginJars(type: Copy) {
78+
from configurations.compile
79+
into rootProject.buildDir.path + '\\' +'jars'
8080
}
8181

82-
build.dependsOn project.tasks.assemblePlugin
82+
task copyPluginIdxs(type: Copy) {
83+
from rootProject.buildDir.path + '\\tmp\\kapt3\\classes'
84+
into rootProject.buildDir.path + '\\classes\\kotlin'
85+
}
86+
87+
build.dependsOn project.tasks.copyPluginJars
88+
build.dependsOn project.tasks.copyPluginIdxs

0 commit comments

Comments
 (0)