Skip to content

Commit 795046e

Browse files
authored
DOC-9047-C1 -- Include Kotlin in Android Install page (#504)
https://issues.couchbase.com/browse/DOC-9047
1 parent 1ed354e commit 795046e

File tree

2 files changed

+45
-17
lines changed

2 files changed

+45
-17
lines changed

modules/android/pages/_partials/gsBuildGradleAndroid.adoc

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,46 @@
44
application {mainClassName = 'gettingstarted.GettingStarted'}
55

66
plugins {
7-
id 'java'
8-
id 'application'
7+
id 'java'
8+
id 'application'
99
// ... other section content as required by user
1010
}
1111

1212

1313
// tag::compileOptions[]
14+
15+
// Set Couchbase Lite version
16+
def version = '3.0.0' // <1>
17+
18+
// Set minimum JVM level to ensure availability of, for example, lambda expressions
19+
def jvmversion = '1.8'
20+
1421
android {
15-
// Required only if your project has some Kotlin source code
16-
kotlinOptions { jvmTarget = '1.8' }
22+
// Required only if your project has some Kotlin source code
23+
kotlinOptions { jvmTarget = ${jvmversion}`}
1724

18-
// Set minimum JVM level to ensure availability of, for example, lambda expressions
19-
compileOptions {
20-
targetCompatibility 1.8
21-
sourceCompatibility 1.8
22-
25+
compileOptions {
26+
targetCompatibility ${jvmversion}
27+
sourceCompatibility ${jvmversion}
28+
2329

2430
// ... other section content as required by user
2531
}
2632
// end::compileOptions[]
2733

2834
// tag::dependencies[]
2935
dependencies {
30-
implementation "com.couchbase.lite:couchbase-lite-android-ee:${version}"
36+
37+
implementation "com.couchbase.lite.kotlin:couchbase-lite-kt-android-ee:${version}" // <2>
38+
implementation "com.couchbase.lite.kotlin:couchbase-lite-android-ee:${version}" // <3>
3139

3240
// ... other section content as required by user
3341
}
3442
// end::dependencies[]
3543

3644
// tag::repositories[]
3745
repositories {
38-
maven { url 'https://mobile.maven.couchbase.com/maven2/dev/' }
39-
google()
40-
jcenter()
46+
maven { url 'https://mobile.maven.couchbase.com/maven2/dev/' }
4147

4248
// ... other section content as required by user
4349
}
@@ -47,7 +53,9 @@ repositories {
4753

4854
// tag::dependenciesCE[]
4955
dependencies {
50-
implementation "com.couchbase.lite:couchbase-lite-android:${version}"
56+
57+
implementation "com.couchbase.lite.kotlin:couchbase-lite-kt-android:${version}" // <2>
58+
implementation "com.couchbase.lite.kotlin:couchbase-lite-android:${version}" // <3>
5159

5260
// ... other section content as required by user
5361
}

modules/android/pages/gs-install.adoc

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,25 @@ include::{root-partials}block-abstract.adoc[]
1111
// include::{root-partials}block-related-get-started.adoc[]
1212
// DO NOT EDIT
1313

14+
== Introduction
15+
16+
Couchbase Lite on Android 3.x supports the development of applications in Java or {kotlin--xref}.
17+
You can install Kotlin and-or Java from (separate) downloads or by using the Maven repository.
18+
19+
When using Maven, selecting Kotlin will also pull-in the pure Java version.
20+
Users requiring only Java can choose to just pull the Java version.
21+
22+
== Install
23+
1424
Create or open an existing Android Studio project and install Couchbase Lite using the following method.
1525

16-
Make the following additions to the module-level `build.gradle` file (typically in the *app* folder).
17-
*Note:* In the gradle examples replace the `${version}` token with the required Couchbase Lite version number.
26+
Add the following entries to the module-level `build.gradle` file (typically in the *app* folder).
27+
1828

1929

20-
[{tabs}]
2130
====
31+
[{tabs}]
32+
=====
2233
Community::
2334
+
2435
--
@@ -61,6 +72,15 @@ include::partial$gsBuildGradleAndroid.adoc[tag=dependencies]
6172
include::partial$gsBuildGradleAndroid.adoc[tag=repositories]
6273
----
6374
--
75+
76+
=====
77+
78+
<1> Set the variable `\{version\}` to the Couchbase Lite version number, for example 3.0.0.
79+
80+
<2> If you require Kotlin, add only this line to dependencies; it will also include the Java version
81+
82+
<3> If you require just Java, add only this line to dependencies
83+
6484
====
6585

6686
include::{root-partials}block-related-content-start.adoc[]

0 commit comments

Comments
 (0)