Skip to content

Commit ac1082d

Browse files
authored
DOC-8371 -- Code Example Repo updates (couchbase#466)
Query Builder revamp https://issues.couchbase.com/browse/DOC-8371 (cherry picked from commit 5d7d3c8671bc4fdf75aad5b98c5e67eeb4f74350) DOC-8371-P1 -- BACKPORT -- Query Builder revamp https://issues.couchbase.com/browse/DOC-8371 DOC-8371-P1 -- BACKPORT -- Query Builder revamp https://issues.couchbase.com/browse/DOC-8371 DOC-8371-P1 -- sort out source-languge DOC-8371 -P1 -- Pagintion bits DOC-8371 -- Fix swift variable name typo DOC-8371 -- Fix mis-editted thisDocsProps string DOC-8371 -- Interim 25May21-1 DOC-8371 -- Interim 26May21 DOC-8371 -- Code Example Repos DOC-8371 -- toJSON chanes (cherry picked from commit af9db012d31e8d632bc3e46ffa6dd081341da6c6)
1 parent 4529c27 commit ac1082d

File tree

64 files changed

+2741
-62
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2741
-62
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,7 @@ deploy/.vagrant/
9494
.vscode/
9595
.vs/
9696
*.user
97+
98+
modules/ROOT/holding-bin/*.*
99+
modules/ROOT/temp-bin/*.*
100+
modules/swift/examples/thisbin/Untitled-1.swift
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
2+
3+
// DATA FORMAT RETURNED WHEN SELECTING SPECIFIC ID
4+
// tag::query-result-format-id[]
5+
[
6+
{
7+
"id": "hotel123"
8+
},
9+
{
10+
"id": "hotel456"
11+
},
12+
]
13+
// end::query-result-format-id[]
14+
15+
16+
// DATA FORMAT RETURNED WHEN SELECTING SPECIFIC PROPS
17+
// tag::query-result-format-props[]
18+
[
19+
{ // <.>
20+
"id": "hotel123",
21+
"type": "hotel",
22+
"name": "Hotel Ghia"
23+
},
24+
{ // <.>
25+
"id": "hotel456",
26+
"type": "hotel",
27+
"name": "Hotel Deluxe",
28+
}
29+
]
30+
// end::query-result-format-props[]
31+
32+
33+
// DATA FORMAT RETURNED WHEN SELECTING COUNT ONLY
34+
// tag::query-result-format-count[]
35+
{
36+
"mycount": 6
37+
}
38+
39+
// end::query-result-format-count[]
40+
41+
42+
// DATA FORMAT RETURNED WHEN SELECTING SPECIFIC all
43+
// tag::query-result-format-all[]
44+
[
45+
{
46+
"travel-sample": { // <.>
47+
"callsign": "MILE-AIR",
48+
"country": "United States",
49+
"iata": "Q5",
50+
"icao": "MLA",
51+
"id": 10,
52+
"name": "40-Mile Air",
53+
"type": "airline"
54+
}
55+
},
56+
{
57+
"travel-sample": { // <.>
58+
"callsign": "ALASKAN-AIR",
59+
"country": "United States",
60+
"iata": "AA",
61+
"icao": "AAA",
62+
"id": 10,
63+
"name": "Alaskan Airways",
64+
"type": "airline"
65+
}
66+
}
67+
]
68+
69+
// end::query-result-format-all[]
70+
71+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
arguments=
2+
auto.sync=false
3+
build.scans.enabled=false
4+
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
5+
connection.project.dir=
6+
eclipse.preferences.version=1
7+
gradle.user.home=/Users/ianbridge/.gradle
8+
java.home=/Library/Java/JavaVirtualMachines/jdk-13.0.1.jdk/Contents/Home
9+
jvm.arguments=
10+
offline.mode=false
11+
override.workspace.settings=true
12+
show.console.view=true
13+
show.executions.view=true
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-13/"/>
4+
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
5+
<classpathentry kind="output" path="bin/default"/>
6+
</classpath>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
connection.project.dir=..
2+
eclipse.preferences.version=1
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
apply plugin: 'com.android.application'
2+
apply plugin: 'kotlin-android'
3+
apply plugin: 'kotlin-android-extensions'
4+
5+
android {
6+
compileSdkVersion 30
7+
8+
defaultConfig {
9+
applicationId "com.example.docsnippet"
10+
minSdkVersion 26
11+
targetSdkVersion 30
12+
versionCode 1
13+
versionName "1.0"
14+
15+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16+
}
17+
18+
buildTypes {
19+
release {
20+
minifyEnabled false
21+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22+
}
23+
}
24+
compileOptions {
25+
sourceCompatibility JavaVersion.VERSION_1_8
26+
targetCompatibility JavaVersion.VERSION_1_8
27+
}
28+
kotlinOptions {
29+
jvmTarget = '1.8'
30+
}
31+
}
32+
33+
repositories {
34+
maven { url 'https://mobile.maven.couchbase.com/maven2/dev/' }
35+
}
36+
37+
dependencies {
38+
implementation fileTree(dir: "libs", include: ["*.jar"])
39+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
40+
implementation 'androidx.core:core-ktx:1.3.2'
41+
implementation 'androidx.appcompat:appcompat:1.2.0'
42+
implementation 'com.google.android.material:material:1.3.0'
43+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
44+
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.3'
45+
implementation 'androidx.navigation:navigation-ui-ktx:2.3.3'
46+
testImplementation 'junit:junit:4.12'
47+
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
48+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
49+
implementation "com.couchbase.lite:couchbase-lite-android-ee:2.8.5"
50+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.example.docsnippet
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.example.docsnippet", appContext.packageName)
23+
}
24+
}

0 commit comments

Comments
 (0)