+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/js/kobalt.js b/js/kobalt.js
index f967e9d..94673d2 100644
--- a/js/kobalt.js
+++ b/js/kobalt.js
@@ -16,12 +16,8 @@ var content = [
title: "Plug-ins"
},
{
- url: "../write-plug-in-10mn/index.html",
- title: "A plug-in in 10mn"
- },
- {
- url: "../write-plug-in/index.html",
- title: "Plug-in development"
+ url: "../plug-in-development/index.html",
+ title: "Writing a Kobalt plug-in"
}
];
diff --git a/write-plug-in-10mn/index.html b/plug-in-development/index.html
similarity index 81%
rename from write-plug-in-10mn/index.html
rename to plug-in-development/index.html
index 06d2f90..a71335a 100644
--- a/write-plug-in-10mn/index.html
+++ b/plug-in-development/index.html
@@ -45,16 +45,18 @@
-
A Kobalt plug-in in ten minutes
-
This article demonstrates how to wrote a Kobalt plug-in from scratch and have it published on JCenter in less than ten minutes.
+
Plug-in development
+
How to set up your environment to write a Kobalt plug-in.
+
Writing and publishing a plug-in in ten minutes
-In tnis example, we'll write a Kobalt plug-in that simply counts the number of source files and lines in your project. Starting from scratch, we'll have this plug-in published to JCenter and ready to use in ten minutes.
+In this example, we'll write a Kobalt plug-in that simply counts the number of source files and lines in your project.
+ Starting from scratch, we'll have this plug-in published to JCenter and ready to use in ten minutes.
@@ -233,8 +235,47 @@ Found 4972 lines in 65 files
And that's it! You can now iterate on your plug-in and upload it with additional ./kobaltw uploadJcenter. This plug-in is available on github.
-
+
Debugging a Kobalt plug-in
+
+ The simplest way to run your plug-in in your IDE is to create a main function in the main class of your
+ plug-in as follows:
+
+
+fun main(argv: Array<String>) {
+ com.beust.kobalt.main(argv)
+}
+
+public class Main : BasePlugin(), KobaltLogger {
+// ...
+
+
+
+ Now you can simply create a launch configuration for your main class, which will invoke Kobalt.
+
+
+
+ The next step is to have Kobalt invoke your plug-in, so you will have to modify your build file
+ to call it. As long as you haven't deployed your plug-in to JCenter, you might want to use the
+ file() directive to declare your dependency, so that Kobalt will use the jar file
+ on your file system:
+
+
+
+val p = plugins(
+ file(homeDir("kotlin/kobalt-line-count/kobaltBuild/libs/kobalt-line-count-0.8.jar"))
+)
+
+
+
+ You can now set a breakpoint in your plug-in and launch the configuration you created above.
+
+
+
+
+
+
+
@@ -249,4 +290,5 @@ And that's it! You can now iterate on your plug-in and upload it with additional
-->
+