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

Reformat.

This commit is contained in:
Cedric Beust 2016-01-01 10:02:11 -08:00
parent 5bce778234
commit 6dd5fea093

View file

@ -150,23 +150,23 @@ compileFreeDebug
===== packaging ===== ===== packaging =====
assembleFreeRelease assembleFreeRelease
assembleFreeDebug</pre> assembleFreeDebug</pre>
<p> <p>
For example, if you define two flavors, "pro" and "free", and two build types, "debug" and "release", four tasks will be added that combine these: "proDebug", "proRelease", "freeDebug" and "freeRelease". If you assemble any of these, an artifact named after that combination will be created, e.g. "kobalt-0.273-free-debug.jar". For example, if you define two flavors, "pro" and "free", and two build types, "debug" and "release", four tasks will be added that combine these: "proDebug", "proRelease", "freeDebug" and "freeRelease". If you assemble any of these, an artifact named after that combination will be created, e.g. "kobalt-0.273-free-debug.jar".
</p> </p>
<h3 class="section" id="build-config" indent="1">BuildConfig</h3> <h3 class="section" id="build-config" indent="1">BuildConfig</h3>
<p> <p>
If you defined at least one variant defined, a special file called <code>BuildConfig.java</code> (or If you defined at least one variant defined, a special file called <code>BuildConfig.java</code> (or
<code>BuildConfig.kt</code>) will be automatically generated. <code>BuildConfig.kt</code>) will be automatically generated.
</p> </p>
<div class="bs-callout bs-callout-warning"> <div class="bs-callout bs-callout-warning">
<h4>Note</h4> <h4>Note</h4>
You need to define <code>packageName</code> in your project in order for this file to be generated or You need to define <code>packageName</code> in your project in order for this file to be generated or
Kobalt will fail. Kobalt will fail.
</div> </div>
<p> <p>
This class contains at least two fields defining the current variant: This class contains at least two fields defining the current variant:
</p> </p>
<pre class="brush:java"> <pre class="brush:java">
class BuildConfig { class BuildConfig {
companion object { companion object {
@ -174,11 +174,11 @@ class BuildConfig {
val BUILD_TYPE : String = "debug" val BUILD_TYPE : String = "debug"
} }
}</pre> }</pre>
<p> <p>
You can add your own custom fields to this file by calling the <code>buildConfig</code> directive You can add your own custom fields to this file by calling the <code>buildConfig</code> directive
inside your inside your
flavor: flavor:
</p> </p>
<pre class="brush:java"> <pre class="brush:java">
productFlavor("free") { productFlavor("free") {
buildConfig { buildConfig {
@ -186,9 +186,9 @@ productFlavor("free") {
field("anIntField", "Int", "42") field("anIntField", "Int", "42")
} }
}</pre> }</pre>
<p> <p>
The generated file will then contain: The generated file will then contain:
</p> </p>
<pre class="brush:java"> <pre class="brush:java">
class BuildConfig { class BuildConfig {
companion object { companion object {