diff --git a/documentation/index.html b/documentation/index.html index ab9d044..b11f85f 100644 --- a/documentation/index.html +++ b/documentation/index.html @@ -454,10 +454,10 @@ New versions found:
--init
"java,myProject"
. Each archetype will be invoked in order so they can generate their files.--log
cd ~/java/project -$KOBALT_HOME/kobaltw --init +$KOBALT_HOME/kobaltw --init java
This command will do two things:
kobalt/src/Build.kt
file based on what was found in your project.
- kobaltw
) and a few additional files in the kobalt/wrapper
directory. From now on, you can just use ./kobaltw
to build and you can ignore $KOBALT_HOME
.
- - You can now attempt to build your project with Kobalt: -
+kobalt/src/Build.kt
suitable for a brand new Java project.
+kobaltw
) and a few additional files in the kobalt/wrapper
directory. From now on, you can just use ./kobaltw
to build and you can ignore $KOBALT_HOME
.
+
++You can now attempt to build your project with Kobalt: +
./kobaltw assemble- If your project follows a regular build structure (e.g. Maven's hierarchy), this should compile your file and create a .jar file. If not, you will have to make a few edits to your
Build.kt
.
- As of this writing, Kobalt supports Java and Kotlin projects.
-
- Build.kt
.
+As of this writing, Kobalt supports Java and Kotlin projects.
- Here is the Build.kt
for the Wasabi HTTP framework:
+The build file generated by default might need some editing before you can build your project, so take a look at it and adjust whatever is necessary (e.g. package name, version, etc...)
+
+Here is the Build.kt
for the JCommander project:
+
import com.beust.kobalt.* -import com.beust.kobalt.plugin.packaging.assemble -import com.beust.kobalt.plugin.kotlin.* +import com.beust.kobalt.plugin.java.* +import com.beust.kobalt.plugin.packaging.* +import com.beust.kobalt.plugin.publish.* -val kotlinVersion = "1.0.0-beta-4583" - -val p = kotlinProject { - - name = "wasabi" - group = "com.example" +val jcommander = project { + name = "jcommander" + group = "com.beust" artifactId = name - version = "0.1" + version = "1.54" - // Tell Kobalt to also search here for dependencies - val repos = repos("http://oss.sonatype.org/content/repositories/snapshots") - - dependencies { - compile("org.jetbrains.kotlin:kotlin-stdlib:" + kotlinVersion, - "org.jetbrains.kotlin:kotlin-reflect:" + kotlinVersion, - - "io.netty:netty-all:4.0.31.Final", - "commons-codec:commons-codec:1.6", - "commons-logging:commons-logging:1.1.1", - "joda-time:joda-time:2.3") - } - - // Test dependencies dependenciesTest { - compile("junit:junit:4.9", - "org.mockito:mockito-all:1.9.5", - "org.apache.httpcomponents:httpclient:4.5.1") + compile("org.testng:testng:6.9.9") } - // Tell kobalt to produce a fat jar and also the artifacts required for Maven assemble { - jar { - fatJar=true - name = "wasabi-fat-" + version + ".jar" - } - mavenJars{ + mavenJars { } } -} -+ + jcenter { + publish = true + } +}
diff --git a/plug-in-development/index.html b/plug-in-development/index.html index e96eb76..85dd34b 100644 --- a/plug-in-development/index.html +++ b/plug-in-development/index.html @@ -111,7 +111,7 @@ class JavaPlugin : ICompilerContributor, IDocContributor {
class JavaBuildGenerator: IInitContributor {
- This class is declaring that it wants to take part in the --init
selection process, discussed below.
+ This class is declaring that it wants to take part in the --init
process (i.e. it can generate an archetype), discussed below.
@@ -187,10 +187,11 @@ class JavaBuildGenerator: IInitContributor {
IInitContributor
IContributor
--init
command line parameter, which generates a default build file
- based on the files found in the current directory. Any plug-in that wants to be part of this process need
- to implement this interface. In this case, both the Java and Kotlin plug-ins define such a contributor
- but future plug-ins might use this contributor to generate their own build file: Android, Ceylon, Spring, etc...
+ --init
followed by archetype names separated by commas,
+ Kobalt will invoke each of these contributors so they can generate their files.
+ Archetypes are useful to create projects from scratch with a minimal number of
+ files to get started. For example, the "java" archetype will generate a `Build.kt`
+ file suitable for a brand new Java project.
- I create an empty Main.kt
in the example above so that calling ./kobaltw --init
will detect the project as a Kotlin one. This way, the Build.kt
file generated is already configured for Kotlin. Since we will be publishing this project to a Maven repository, we need to make sure that its group
, artifactId
and version
are correct. The only thing that the generator can't guess is the group
, so let's go ahead and fix it:
-
+ ./kobaltw --init kotlin
creates an empty Kotlin project. Since we will be publishing this project to a Maven repository, we need to make sure that its group
, artifactId
and version
are correct. The only thing that the generator can't guess is the group
, so let's go ahead and fix it:
+
val project = kotlinProject {