Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ pipeline {
stage("Validate C#") {
agent { label 's61113u16 (litecore)' }
steps {
sh 'jenkins/dotnet_build.sh 4.0.0 2.0.0'
sh 'jenkins/dotnet_build.sh 4.1.0 2.0.0'
}
}
stage("Validate C") {
agent { label 's61113u16 (litecore)' }
steps {
sh 'jenkins/c_build.sh 4.0.0'
sh 'jenkins/c_build.sh 4.1.0'
}
}
stage("Validate iOS") {
agent { label 'mobile-builder-ios-pull-request' }
steps {
sh 'jenkins/ios.sh 4.0.0 2.0.0'
sh 'jenkins/ios.sh 4.1.0 2.0.0'
}
}
stage("Validate Android") {
agent { label 'cbl-android' }
steps {
sh 'jenkins/android_build.sh 4.0.0 2.0.0'
sh 'jenkins/android_build.sh 4.1.0 2.0.0'
}
}
}
Expand Down
33 changes: 30 additions & 3 deletions jenkins/android_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,35 @@ fi
CBL_URL="http://proget.build.couchbase.com:8080/api/get_version?product=couchbase-lite-android&version=${CBL_VERSION}"
VS_URL="http://proget.build.couchbase.com:8080/api/get_version?product=couchbase-lite-android-vector-search&version=${VS_VERSION}"

CBL_BUILD=$(curl -s $CBL_URL | $JQ -r '.BuildNumber')
VS_BUILD=$(curl -s $VS_URL | $JQ -r '.BuildNumber')
CBL_RESPONSE=$(curl -s $CBL_URL)
CBL_IS_RELEASE=$(echo -n "$CBL_RESPONSE" | $JQ -r '.IsRelease')
CBL_BUILD=$(echo -n "$CBL_RESPONSE" | $JQ -r '.BuildNumber')

if [ "${CBL_BUILD}" == "" ] || [ "${CBL_BUILD}" == "null" ]; then
echo "No latest successful build found for CBL v${CBL_VERSION}"
exit 3
fi

VS_RESPONSE=$(curl -s $VS_URL)
VS_IS_RELEASE=$(echo -n "$VS_RESPONSE" | $JQ -r '.IsRelease')
VS_BUILD=$(echo -n "$VS_RESPONSE" | $JQ -r '.BuildNumber')

if [ "${VS_BUILD}" == "" ] || [ "${VS_BUILD}" == "null" ]; then
echo "No latest successful build found for VS v${VS_VERSION}"
exit 3
fi

if [ "${CBL_IS_RELEASE}" == "true" ]; then
CBL_VERSION_ARG="${CBL_VERSION}"
else
CBL_VERSION_ARG="${CBL_VERSION}-${CBL_BUILD}"
fi

if [ "${VS_IS_RELEASE}" == "true" ]; then
VS_VERSION_ARG="${VS_VERSION}"
else
VS_VERSION_ARG="${VS_VERSION}-${VS_BUILD}"
fi

pushd $ANDROID_DIR/examples/
./gradlew assembleDebug -PcblVersion=$CBL_VERSION-$CBL_BUILD -PextVersion=$VS_VERSION-$VS_BUILD
./gradlew assembleDebug -PcblVersion=${CBL_VERSION_ARG} -PextVersion=${VS_VERSION_ARG}
32 changes: 25 additions & 7 deletions jenkins/c_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,41 @@

if [[ "$#" -ne 1 ]]; then
echo "This script requires a version argument"
exit 1
fi

THIS_DIR=$( dirname -- $(realpath "$0"); )
version="$1"
THIS_DIR=$( dirname -- $(realpath "$0") )
CBL_VERSION="$1"
pushd "$THIS_DIR/../modules/c/examples/code_snippets"

build_num=$(curl -s http://dbapi.build.couchbase.com:8000/v1/products/couchbase-lite-c/releases/$version/versions/$version/builds?filter=last_complete | jq .build_num | bc)
RESPONSE=$(curl -s "http://proget.build.couchbase.com:8080/api/get_version?product=couchbase-lite-c&version=${CBL_VERSION}")
CBL_IS_RELEASE=$(echo -n "$RESPONSE" | jq .IsRelease)
CBL_BUILD_NO=$(echo -n "$RESPONSE" | jq .BuildNumber)

if [ "${CBL_BUILD_NO}" == "" ] || [ "${CBL_BUILD_NO}" == "null" ]; then
echo "No latest successful build found for CBL v${CBL_VERSION}"
exit 3
fi

if [ "${CBL_IS_RELEASE}" == "true" ]; then
PACKAGE_NAME="couchbase-lite-c-enterprise-${CBL_VERSION}-linux-x86_64.tar.gz"
DOWNLOAD_URL="https://latestbuilds.service.couchbase.com/builds/releases/mobile/couchbase-lite-c/${CBL_VERSION}/${PACKAGE_NAME}"
else
PACKAGE_NAME="couchbase-lite-c-enterprise-${CBL_VERSION}-${CBL_BUILD_NO}-linux-x86_64.tar.gz"
DOWNLOAD_URL="https://latestbuilds.service.couchbase.com/builds/latestbuilds/couchbase-lite-c/${CBL_VERSION}/${CBL_BUILD_NO}/${PACKAGE_NAME}"
fi

rm -rf downloaded
mkdir -p downloaded

pushd downloaded
DOWNLOAD_DIR=$(pwd)
wget http://latestbuilds.service.couchbase.com/builds/latestbuilds/couchbase-lite-c/$version/$build_num/couchbase-lite-c-enterprise-$version-$build_num-linux-x86_64.tar.gz
tar xf couchbase-lite-c-enterprise-$version-$build_num-linux-x86_64.tar.gz
rm couchbase-lite-c-enterprise-$version-$build_num-linux-x86_64.tar.gz
wget "${DOWNLOAD_URL}"
tar xf "${PACKAGE_NAME}"
rm "${PACKAGE_NAME}"
popd

mkdir -p build
pushd build
cmake -DCMAKE_PREFIX_PATH="$DOWNLOAD_DIR/libcblite-$version" ..
cmake -DCMAKE_PREFIX_PATH="$DOWNLOAD_DIR/libcblite-${CBL_VERSION}" ..
make -j12
66 changes: 35 additions & 31 deletions jenkins/ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,74 @@
CBL_VERSION=$1
VS_VERSION=$2

dir=$( dirname -- $(realpath "$0"); )

# Get latest good CBL iOS EE build for given version
CBL_URL="http://proget.build.couchbase.com:8080/api/open_latestbuilds?product=couchbase-lite-ios&version=${cbl_version}"
if [ -z "${CBL_VERSION}" ] || [ -z "${VS_VERSION}" ]; then
echo "Usage: $0 <CBL_VERSION> <VS_VERSION>"
exit 1
fi

# Grab the redirect url
CBL_SOURCE_URL=$(curl -s -L -o /dev/null -w '%{url_effective}' "${CBL_URL}")
dir=$( dirname -- $(realpath "$0") )

CBL="http://proget.build.couchbase.com:8080/api/get_version?product=couchbase-lite-ios&version=${CBL_VERSION}"
RESPONSE=$(curl -s $CBL)
CBL_IS_RELEASE=$(echo -n $RESPONSE | jq .IsRelease)
CBL_BUILD_NO=$(echo -n $RESPONSE | jq .BuildNumber)
CBL_IS_RELEASE=$(echo -n "$RESPONSE" | jq .IsRelease)
CBL_BUILD_NO=$(echo -n "$RESPONSE" | jq .BuildNumber)

if [ "${CBL_BUILD_NO}" == "" ]
if [ "${CBL_BUILD_NO}" == "" ] || [ "${CBL_BUILD_NO}" == "null" ]
then
echo "No latest successful build found for CBL v${CBL_VERSION}"
exit 3
fi

VS="http://proget.build.couchbase.com:8080/api/get_version?product=couchbase-lite-ios-vector-search&version=${VS_VERSION}&ee=true"
RESPONSE=$(curl -s $VS)
VS_BUILD_NO=$(echo -n $RESPONSE | jq .BuildNumber)
VS_IS_RELEASE=$(echo -n "$RESPONSE" | jq .IsRelease)
VS_BUILD_NO=$(echo -n "$RESPONSE" | jq .BuildNumber)

if [ "${VS_BUILD_NO}" == "" ]
if [ "${VS_BUILD_NO}" == "" ] || [ "${VS_BUILD_NO}" == "null" ]
then
echo "No latest successful build found for VS v${VS_VERSION}"
exit 3
fi

# Download VS extension once (platform-independent)
if [ "${VS_IS_RELEASE}" == "true" ]; then
VS_PACKAGE_NAME="couchbase-lite-vector-search-${VS_VERSION}-apple.zip"
VS_URL="https://latestbuilds.service.couchbase.com/builds/releases/mobile/couchbase-lite-vector-search/${VS_VERSION}/${VS_PACKAGE_NAME}"
else
VS_PACKAGE_NAME="couchbase-lite-vector-search-${VS_VERSION}-${VS_BUILD_NO}-apple.zip"
VS_URL="https://latestbuilds.service.couchbase.com/builds/latestbuilds/couchbase-lite-vector-search/${VS_VERSION}/${VS_BUILD_NO}/${VS_PACKAGE_NAME}"
fi

VS_DOWNLOAD_DIR="${dir}/../vs_downloaded"
rm -rf "${VS_DOWNLOAD_DIR}"
mkdir -p "${VS_DOWNLOAD_DIR}"
wget -P "${VS_DOWNLOAD_DIR}" "${VS_URL}"

for PLATFORM in "objc" "swift"
do
echo $PLATFORM
pushd "${dir}/../modules/${PLATFORM}/examples"

# In case script fails mid-way, cleanup on start
if [ -d "downloaded" ]; then
rm -rf "downloaded"
fi
rm -rf "downloaded"
mkdir -p downloaded

pushd downloaded
# Get CBL
CBL_SOURCE_URL=$(curl -s -L -o /dev/null -w '%{url_effective}' "http://proget.build.couchbase.com:8080/api/open_latestbuilds?product=couchbase-lite-ios&version=${CBL_VERSION}")

if [ $CBL_IS_RELEASE == true ]; then
# Get CBL
if [ "${CBL_IS_RELEASE}" == "true" ]; then
CBL_PACKAGE_NAME="couchbase-lite-${PLATFORM}_xc_enterprise_${CBL_VERSION}.zip"
CBL_URL="https://latestbuilds.service.couchbase.com/builds/releases/mobile/couchbase-lite-ios/${CBL_VERSION}/${CBL_PACKAGE_NAME}"
else
CBL_PACKAGE_NAME="couchbase-lite-${PLATFORM}_xc_enterprise_${CBL_VERSION}-${CBL_BUILD_NO}.zip"
CBL_URL="https://latestbuilds.service.couchbase.com/builds/latestbuilds/couchbase-lite-ios/${CBL_VERSION}/${CBL_BUILD_NO}/${CBL_PACKAGE_NAME}"
fi

wget "$CBL_SOURCE_URL$CBL_PACKAGE_NAME"
unzip -o $CBL_PACKAGE_NAME -d "../Frameworks/"
wget "${CBL_URL}"
unzip -o "${CBL_PACKAGE_NAME}" -d "../Frameworks/"

# Get VS extension
VS_SOURCE_URL=$(curl -s -L -o /dev/null -w '%{url_effective}' "http://proget.build.couchbase.com:8080/api/open_latestbuilds?product=couchbase-lite-ios-vector-search&version=${VS_VERSION}")
echo $VS_SOURCE_URL
VS_PACKAGE_NAME="couchbase-lite-vector-search-${VS_VERSION}-${VS_BUILD_NO}-apple.zip"
wget "$VS_SOURCE_URL$VS_PACKAGE_NAME"
unzip -o $VS_PACKAGE_NAME -d "../Frameworks/"

# Check if download was successful
if [ $? -eq 0 ]; then
echo "Package downloaded successfully."
else
echo "Failed to download the package."
fi
unzip -o "${VS_DOWNLOAD_DIR}/${VS_PACKAGE_NAME}" -d "../Frameworks/"

popd

Expand All @@ -79,3 +81,5 @@ do
popd

done

rm -rf "${VS_DOWNLOAD_DIR}"
2 changes: 1 addition & 1 deletion modules/android/examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20"
classpath 'com.android.tools.build:gradle:8.0.2'
classpath 'com.android.tools.build:gradle:8.13.2'
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 4 additions & 4 deletions modules/android/examples/java_snippets/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ android {
targetCompatibility JavaVersion.VERSION_11
}

lintOptions {
disable 'UseSparseArrays'
abortOnError false
}

sourceSets {
main {
Expand All @@ -46,6 +42,10 @@ android {
]
}
}
lint {
abortOnError false
disable 'UseSparseArrays'
}
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ class MultipeerExamples {
return config
}


fun createMultipeerReplicator() : MultipeerReplicator {
val config = createConfig()

Expand Down
Loading
Loading