-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Gamedge Remote Api plugin (#226)
- Loading branch information
Showing
7 changed files
with
62 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
buildSrc/src/main/java/com/paulrybitskyi/gamedge/plugins/GamedgeRemoteApiPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.paulrybitskyi.gamedge.plugins | ||
|
||
import com.android.build.api.dsl.LibraryExtension | ||
import com.paulrybitskyi.gamedge.extensions.libs | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
|
||
class GamedgeRemoteApiPlugin : Plugin<Project> { | ||
|
||
override fun apply(project: Project) = with(project) { | ||
setupPlugins() | ||
configurePlugins() | ||
addDependencies() | ||
} | ||
|
||
private fun Project.setupPlugins(): Unit = with(plugins) { | ||
apply(libs.plugins.androidLibrary.get().pluginId) | ||
apply(libs.plugins.gamedgeAndroid.get().pluginId) | ||
apply(libs.plugins.gamedgeDaggerHilt.get().pluginId) | ||
apply(libs.plugins.kotlinxSerialization.get().pluginId) | ||
} | ||
|
||
private fun Project.configurePlugins() { | ||
configure<LibraryExtension> { | ||
buildFeatures { | ||
buildConfig = true | ||
} | ||
} | ||
} | ||
|
||
private fun Project.addDependencies(): Unit = with(dependencies) { | ||
add("api", project(localModules.commonApi)) | ||
add("implementation", project(localModules.core)) | ||
|
||
add("implementation", libs.coroutines.get()) | ||
add("implementation", libs.kotlinxSerialization.get()) | ||
add("implementation", libs.retrofit.get()) | ||
add("implementation", libs.kotlinResult.get()) | ||
|
||
add("testImplementation", project(localModules.commonTesting)) | ||
add("testImplementation", libs.jUnit.get()) | ||
add("testImplementation", libs.truth.get()) | ||
add("testImplementation", libs.mockk.get()) | ||
add("testImplementation", libs.coroutinesTesting.get()) | ||
|
||
add("androidTestImplementation", libs.testRunner.get()) | ||
add("androidTestImplementation", libs.jUnitExt.get()) | ||
add("androidTestImplementation", libs.truth.get()) | ||
add("androidTestImplementation", libs.mockWebServer.get()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters