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

Added the core plugin to the sample app. #72

Merged
merged 3 commits into from
Jul 14, 2023
Merged
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
2 changes: 2 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ repositories {
mavenCentral()
google()
gradlePluginPortal()
maven("https://s01.oss.sonatype.org/content/groups/staging/")
}

configurations.all {
Expand All @@ -22,4 +23,5 @@ dependencies {
implementation("com.android.tools.build:gradle:7.4.1")
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.22.0")
implementation("org.jacoco:org.jacoco.core:0.8.8")
implementation("com.openmobilehub.android:omh-core:1.0")
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ org.gradle.configuration-cache=true
minimunCoverageAllowed=0.8

# Libraries configuration
group=com.omh.android
group=com.openmobilehub.android
2 changes: 1 addition & 1 deletion storage-api-drive-gms/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ android {
}

dependencies {
api(project(":storage-api"))
api("com.openmobilehub.android:storage-api:1.0.1-rc")

// GMS
implementation(Libs.googlePlayServicesAuth)
Expand Down
2 changes: 1 addition & 1 deletion storage-api-drive-gms/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
artifactId=storage-api-drive-gms
version=1.0-rc
version=1.0.1-rc
description=The GMS implementation of the OMH Storage API
2 changes: 1 addition & 1 deletion storage-api-drive-nongms/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {
}

dependencies {
api(project(":storage-api"))
api("com.openmobilehub.android:storage-api:1.0.1-rc")

// Retrofit setup
implementation(Libs.retrofit)
Expand Down
2 changes: 1 addition & 1 deletion storage-api-drive-nongms/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
artifactId=storage-api-drive-nongms
version=1.0-rc
version=1.0.1-rc
googleStorageUrl="https://www.googleapis.com/"
description=The non GMS implementation of the OMH Storage API
2 changes: 1 addition & 1 deletion storage-api/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
artifactId=storage-api
version=1.0-rc
version=1.0.1-rc
description=The base API for the OMH storage libraries.
63 changes: 46 additions & 17 deletions storage-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,52 @@ plugins {
`android-application`
id("kotlin-kapt")
id("com.google.dagger.hilt.android") version "2.44" apply true
id("com.openmobilehub.android.omh-core")
}

omhConfig {
bundle("singleBuild") {
storage() {
gmsService {
dependency = "com.openmobilehub.android:storage-api-drive-gms:1.0.1-rc"
}
nonGmsService {
dependency = "com.openmobilehub.android:storage-api-drive-nongms:1.0.1-rc"
}
}
auth {
gmsService {
dependency = "com.openmobilehub.android:auth-api-gms:1.0"
}
nonGmsService {
dependency = "com.openmobilehub.android:auth-api-non-gms:1.0"
}
}
}
bundle("gms") {
storage {
gmsService {
dependency = "com.openmobilehub.android:storage-api-drive-gms:1.0.1-rc"
}
}
auth {
gmsService {
dependency = "com.openmobilehub.android:auth-api-gms:1.0"
}
}
}
bundle("nongms") {
storage {
nonGmsService {
dependency = "com.openmobilehub.android:storage-api-drive-nongms:1.0.1-rc"
}
}
auth {
nonGmsService {
dependency = "com.openmobilehub.android:auth-api-non-gms:1.0"
}
}
}
}

@Suppress("UnstableApiUsage")
Expand Down Expand Up @@ -40,13 +86,6 @@ android {
}
}

flavorDimensions += "google_services"
productFlavors {
create("ngms") {
dimension = "google_services"
}
}

kotlinOptions {
jvmTarget = "1.8"
}
Expand All @@ -60,17 +99,7 @@ android {
}
}

val ngmsImplementation by configurations

dependencies {
implementation(project(":storage-api"))

// Omh Auth
ngmsImplementation(Libs.omhNonGmsAuthLibrary)
ngmsImplementation(Libs.omhGmsAuthLibrary)
ngmsImplementation(project(":storage-api-drive-nongms"))
ngmsImplementation(project(":storage-api-drive-gms"))

implementation(Libs.coreKtx)
implementation(Libs.lifecycleKtx)
implementation(Libs.viewModelKtx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class SingletonModule {
@Provides
fun providesOmhAuthClient(@ApplicationContext context: Context): OmhAuthClient {
return OmhAuthProvider.Builder()
.addNonGmsPath()
.addGmsPath()
.addNonGmsPath(BuildConfig.AUTH_NON_GMS_PATH)
.addGmsPath(BuildConfig.AUTH_GMS_PATH)
.build()
.provideAuthClient(
context = context,
Expand All @@ -41,8 +41,8 @@ class SingletonModule {
@ApplicationContext context: Context
): OmhStorageClient {
return OmhStorageProvider.Builder()
.addGmsPath()
.addNonGmsPath()
.addGmsPath(BuildConfig.STORAGE_GMS_PATH)
.addNonGmsPath(BuildConfig.STORAGE_NON_GMS_PATH)
.build()
.provideStorageClient(omhAuthClient, context)
}
Expand Down