1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt-doc.git synced 2025-04-25 03:57:11 -07:00

JCenter -> Bintray.

This commit is contained in:
Cedric Beust 2016-01-08 23:39:12 +04:00
parent b25fd5faea
commit b8512f073c
4 changed files with 27 additions and 27 deletions

View file

@ -294,7 +294,7 @@ $ ./kobaltw --tasks
===== publish ===== ===== publish =====
generatePom Generate the .pom file generatePom Generate the .pom file
uploadJcenter Upload the artifacts to JCenter uploadBintray Upload the artifacts to Bintray
===== packaging ===== ===== packaging =====
assemble Package the artifacts assemble Package the artifacts
@ -320,7 +320,7 @@ $ ./kobaltw --tasks
===== publish ===== ===== publish =====
generatePom Generate the .pom file generatePom Generate the .pom file
uploadJcenter Upload the artifacts to JCenter uploadBintray Upload the artifacts to Bintray
===== kobalt-example-plugin ===== ===== kobalt-example-plugin =====
coverage Run coverage coverage Run coverage
@ -457,7 +457,7 @@ New versions found:
<h2 class="section" id="publishing">Publishing</h2> <h2 class="section" id="publishing">Publishing</h2>
<p> <p>
Kobalt supports JCenter natively so you can upload your project and make it available on JCenter very easily. Kobalt supports Bintray/JCenter natively so making your projects available there is very easy.
</p> </p>
<p> <p>

View file

@ -96,14 +96,14 @@ val jcommander = javaProject {
} }
} }
jcenter { bintray {
publish = false publish = false
} }
} }
</pre> </pre>
<p> <p>
This build file also includes a directive to upload your artifacts to JCenter automatically. This build file also includes a directive to upload your artifacts to Bintray automatically.
</p> </p>
<h2 class="section" id="design-goals">Design goals</h2> <h2 class="section" id="design-goals">Design goals</h2>

View file

@ -388,10 +388,10 @@ assemble {
<h2 class="section" id="publishing">Publishing</h2> <h2 class="section" id="publishing">Publishing</h2>
<p> <p>
The Publishing plug-in lets you upload files to JCenter and Github. These files can be either generic ones (e.g. a zip file, a README, etc...) or a Maven-compatible form of your project. The Publishing plug-in lets you upload files to Bintray and Github. These files can be either generic ones (e.g. a zip file, a README, etc...) or a Maven-compatible form of your project.
</p> </p>
<h3 class="section" indent="1" id="jcenter">JCenter</h3> <h3 class="section" indent="1" id="bintray">Bintray / JCenter</h3>
<p> <p>
Before you can upload, you need to create a file <code>local.properties</code> in the root directory of your project with the following keys: Before you can upload, you need to create a file <code>local.properties</code> in the root directory of your project with the following keys:
</p> </p>
@ -414,11 +414,11 @@ you are ready to do your first upload.
</p> </p>
<p> <p>
You define what to upload with the <code>jcenter</code> directive: You define what to upload with the <code>bintray</code> directive:
</p> </p>
<pre class="brush:java"> <pre class="brush:java">
jcenter { bintray {
publish = true publish = true
file("${kobalt.buildDirectory}/libs/${kobalt.name}-${kobalt.version}.zip", file("${kobalt.buildDirectory}/libs/${kobalt.name}-${kobalt.version}.zip",
"${kobalt.name}/${kobalt.version}/${kobalt.name}-${kobalt.version}.zip") "${kobalt.name}/${kobalt.version}/${kobalt.name}-${kobalt.version}.zip")
@ -431,15 +431,15 @@ jcenter {
mavenJars {} mavenJars {}
</pre> </pre>
<p> <p>
This directive <a href="#mavenJars">is described here</a> and is a shortcut to upload all the files that are required in a Maven repo (jar file, javadocs, source files and POM file). You can take a look at <a href="https://github.com/cbeust/jcommander/blob/master/kobalt/src/Build.kt">this build file</a> for a full example of how to package and publish a project to JCenter. This directive <a href="#mavenJars">is described here</a> and is a shortcut to upload all the files that are required in a Maven repo (jar file, javadocs, source files and POM file). You can take a look at <a href="https://github.com/cbeust/jcommander/blob/master/kobalt/src/Build.kt">this build file</a> for a full example of how to package and publish a project to Bintray / JCenter.
</p> </p>
<p> <p>
The <code>jcenter</code> directive accepts the following parameters: The <code>bintray</code> directive accepts the following parameters:
</p> </p>
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>publish (<code>false</code>)</dt> <dt>publish (<code>false</code>)</dt>
<dd>If true, the uploaded file will be published in your personal space (e.g. <code>https://dl.bintray.com/cbeust/maven</code>). Once the file is uploaded there, it can be automatically synchronized to JCenter by linking your project to JCenter on the bintray web site. By default, files are <strong>not</strong> published. <dd>If true, the uploaded file will be published in your personal space (e.g. <code>https://dl.bintray.com/cbeust/maven</code>). Once the file is uploaded there, it can be automatically synchronized to JCenter by linking your project to JCenter on the Bintray web site. By default, files are <strong>not</strong> published.
</dd> </dd>
<dt>sign (<code>false</code>)</dt> <dt>sign (<code>false</code>)</dt>
<dd>If true, sign the files with GPG. This is only required if you plan to later synchronize these files from JCenter to Maven Central. Keep this to <code>false</code>if you are only interested in uploading to JCenter.</dd> <dd>If true, sign the files with GPG. This is only required if you plan to later synchronize these files from JCenter to Maven Central. Keep this to <code>false</code>if you are only interested in uploading to JCenter.</dd>
@ -448,9 +448,9 @@ jcenter {
</dl> </dl>
<pre class="brush:plain"> <pre class="brush:plain">
$ ./kobaltw uploadJcenter $ ./kobaltw uploadBintray
... ...
========== kobalt-line-count:uploadJcenter ========== kobalt-line-count:uploadBintray
kobalt-line-count: Found 2 artifacts to upload kobalt-line-count: Found 2 artifacts to upload
All artifacts successfully uploaded All artifacts successfully uploaded
</pre> </pre>

View file

@ -152,9 +152,9 @@ public class Main : BasePlugin() {
</p> </p>
<pre class="brush:plain"> <pre class="brush:plain">
$ ./kobaltw uploadJcenter $ ./kobaltw uploadBintray
... ...
========== kobalt-line-count:uploadJcenter ========== kobalt-line-count:uploadBintray
Found 12 artifacts to upload: Found 12 artifacts to upload:
Uploading 12 / 12 |............| Uploading 12 / 12 |............|
BUILD SUCCESSFUL (15 seconds) BUILD SUCCESSFUL (15 seconds)
@ -165,7 +165,7 @@ BUILD SUCCESSFUL (15 seconds)
</p> </p>
<pre class="brush:java"> <pre class="brush:java">
jcenter { bintray {
publish = true publish = true
} }
</pre> </pre>
@ -206,19 +206,19 @@ public class Main : BasePlugin() {
</pre> </pre>
<p> <p>
Let's bump our version to 0.2 (since version 0.1 is already uploaded and JCenter won't allow us to overwrite it) and upload our new plug-in: Let's bump our version to 0.2 (since version 0.1 is already uploaded and Bintray won't allow us to overwrite it) and upload our new plug-in:
</p> </p>
<pre class="brush:plain"> <pre class="brush:plain">
$ ./kobaltw uploadJcenter $ ./kobaltw uploadBintray
... ...
kobalt-line-count: Compilation succeeded kobalt-line-count: Compilation succeeded
========== kobalt-line-count:assemble ========== kobalt-line-count:assemble
Created /Users/beust/kotlin/kobalt-line-count/kobaltBuild/libs/kobalt-line-count-0.2.jar Created /Users/beust/kotlin/kobalt-line-count/kobaltBuild/libs/kobalt-line-count-0.2.jar
========== kobalt-line-count:generatePom ========== kobalt-line-count:generatePom
Wrote /Users/beust/kotlin/kobalt-line-count/kobaltBuild/libs/kobalt-line-count-0.2.pom Wrote /Users/beust/kotlin/kobalt-line-count/kobaltBuild/libs/kobalt-line-count-0.2.pom
========== kobalt-line-count:uploadJcenter ========== kobalt-line-count:uploadBintray
Found 12 artifacts to upload: Found 12 artifacts to upload:
Uploading 12 / 12 |............| Uploading 12 / 12 |............|
BUILD SUCCESSFUL (15 seconds) BUILD SUCCESSFUL (15 seconds)
@ -259,7 +259,7 @@ Found 4972 lines in 65 files
</pre> </pre>
<p> <p>
And that's it! You can now iterate on your plug-in and upload it with additional <code>./kobaltw uploadJcenter</code>. This plug-in is <a href="https://github.com/cbeust/kobalt-linecount">available on github</a>. Note that the plug-in in the repo And that's it! You can now iterate on your plug-in and upload it with additional <code>./kobaltw uploadBintray</code>. This plug-in is <a href="https://github.com/cbeust/kobalt-linecount">available on github</a>. Note that the plug-in in the repo
illustrates a few other concepts not discussed here, such as adding dynamic tasks, so I encourage you take a look at its source. illustrates a few other concepts not discussed here, such as adding dynamic tasks, so I encourage you take a look at its source.
</p> </p>
@ -295,12 +295,12 @@ public class Main : BasePlugin() {
Now you can simply create a launch configuration for your main class, which will invoke Kobalt. Now you can simply create a launch configuration for your main class, which will invoke Kobalt.
</p> </p>
<p> <p>
The next step is to have Kobalt invoke your plug-in, so you will have to modify your build file 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 to call it. As long as you haven't deployed your plug-in to Bintray, you might want to use the
<code>file()</code> directive to declare your dependency, so that Kobalt will use the jar file <code>file()</code> directive to declare your dependency, so that Kobalt will use the jar file
on your file system: on your file system:
</p> </p>
<pre class="brush:java"> <pre class="brush:java">
val p = plugins( val p = plugins(