Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move chat demo to root project & improve chat demo #636

Merged
merged 8 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tests:

samples:
- changed-files:
- any-glob-to-any-file: samples/**
- any-glob-to-any-file: sample/**

serializers:
- changed-files:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
cache-read-only: false
- name: Test supabase-kt
run: ./gradlew build test --stacktrace --configuration-cache --scan
run: ./gradlew -DLibrariesOnly=true build test --stacktrace --configuration-cache --scan
2 changes: 1 addition & 1 deletion .github/workflows/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
cache-read-only: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' }}
- name: Analyze code using detekt
run: ./gradlew detektAll --stacktrace --configuration-cache
run: ./gradlew -DLibrariesOnly=true detektAll --stacktrace --configuration-cache
2 changes: 1 addition & 1 deletion .github/workflows/dokka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
cache-read-only: true
- name: Build multi-module GH pages
run: ./gradlew dokkaHtmlMultiModule
run: ./gradlew -DLibrariesOnly=true dokkaHtmlMultiModule
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
cache-read-only: true
- name: Publish
run: ./gradlew publishAllPublicationsToMavenCentral
run: ./gradlew -DLibrariesOnly=true publishAllPublicationsToMavenCentral
- name: Close and release
if: inputs.close_and_release
run: ./gradlew releaseRepository --configuration-cache
run: ./gradlew -DLibrariesOnly=true releaseRepository --configuration-cache
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
cache-read-only: true
- name: Test supabase-kt
run: ./gradlew ${{ matrix.command }} --stacktrace --configuration-cache
run: ./gradlew -DLibrariesOnly=true ${{ matrix.command }} --stacktrace --configuration-cache
2 changes: 1 addition & 1 deletion GoTrue/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ kotlin {
}
}

configureAndroidTarget()
configureLibraryAndroidTarget()
2 changes: 1 addition & 1 deletion Postgrest/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ kotlin {
}
}

configureAndroidTarget()
configureLibraryAndroidTarget()
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ val iosMain by getting {

# Samples

- [Chat Demo (Desktop/Android/iOS/Browser)](https://github.com/supabase-community/supabase-kt/tree/master/demos/chat-demo-mpp)
- [Chat Demo (Desktop/Android/iOS/Browser)](https://github.com/supabase-community/supabase-kt/tree/master/sample/chat-demo-mpp)
- [File Upload Demo (Desktop/Android)](https://github.com/supabase-community/supabase-kt/tree/master/demos/file-upload)
- [Android Native Google login & in-app OAuth (Android)](https://github.com/supabase-community/supabase-kt/tree/master/demos/android-login)
- [Multi-Factor Authentication (Desktop/Android/Browser)](https://github.com/supabase-community/supabase-kt/tree/master/demos/multi-factor-authentication)
Expand Down
2 changes: 1 addition & 1 deletion Realtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ kotlin {
}
}

configureAndroidTarget()
configureLibraryAndroidTarget()
2 changes: 1 addition & 1 deletion Storage/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ kotlin {
}
}

configureAndroidTarget()
configureLibraryAndroidTarget()
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ kotlin {
}
}

configureAndroidTarget()
configureLibraryAndroidTarget()
40 changes: 35 additions & 5 deletions buildSrc/src/main/kotlin/Android.kt
Original file line number Diff line number Diff line change
@@ -1,24 +1,54 @@
import com.android.build.gradle.LibraryExtension
import com.android.build.gradle.internal.dsl.BaseAppModuleExtension
import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.get

fun Project.configureAndroidTarget() {
fun Project.configureLibraryAndroidTarget(
namespace: String? = null,
minSdk: Int = 21,
javaVersion: JavaVersion = JavaVersion.VERSION_1_8
) {
extensions.configure(LibraryExtension::class) {
compileSdk = 34
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
namespace = "${extra["base-group"].toString().replace("-", ".")}.${this@configureAndroidTarget.name.replace("-", "")}.library"
this.namespace = namespace ?: "${extra["base-group"].toString().replace("-", ".")}.${this@configureLibraryAndroidTarget.name.replace("-", "")}.library"
defaultConfig {
minSdk = 21
this.minSdk = minSdk
}
lint {
abortOnError = false
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
}
}

fun Project.configureApplicationAndroidTarget() {
extensions.configure(BaseAppModuleExtension::class) {
compileSdk = 34
defaultConfig {
applicationId = "io.github.jan.supabase.android"
minSdk = 26
versionCode = 1
versionName = "1.0-SNAPSHOT"
}
namespace = "io.github.jan.supabase.android"
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
/*kotlinOptions {
jvmTarget = "11"
}*/
}
}
17 changes: 17 additions & 0 deletions buildSrc/src/main/kotlin/Sample.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler

enum class SupabaseModule(val module: String) {
GOTRUE("gotrue-kt"),
STORAGE("storage-kt"),
REALTIME("realtime-kt"),
FUNCTIONS("functions-kt"),
POSTGREST("postgrest-kt"),
COMPOSE_AUTH("plugins:compose-auth"),
COMPOSE_AUTH_UI("plugins:compose-auth-ui"),
}

fun KotlinDependencyHandler.addModules(vararg modules: SupabaseModule) {
modules.forEach {
api(project(":${it.module}"))
}
}
46 changes: 0 additions & 46 deletions demos/chat-demo-mpp/.gitignore

This file was deleted.

37 changes: 0 additions & 37 deletions demos/chat-demo-mpp/android/build.gradle.kts

This file was deleted.

19 changes: 0 additions & 19 deletions demos/chat-demo-mpp/build.gradle.kts

This file was deleted.

9 changes: 0 additions & 9 deletions demos/chat-demo-mpp/buildSrc/build.gradle.kts

This file was deleted.

8 changes: 0 additions & 8 deletions demos/chat-demo-mpp/buildSrc/src/main/kotlin/Versions.kt

This file was deleted.

6 changes: 0 additions & 6 deletions demos/chat-demo-mpp/gradle.properties

This file was deleted.

45 changes: 0 additions & 45 deletions demos/chat-demo-mpp/gradle/libs.versions.toml

This file was deleted.

Binary file not shown.

This file was deleted.

Loading