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

[FE] Towards Composite Build #45

Merged
merged 26 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
929ccca
Init composite build, move build-logic to top level
Kshitij09 Oct 6, 2024
dbfb1ea
Remove top level build.gradle.kts, no enforcement
Kshitij09 Oct 6, 2024
07dd5a6
Update build-logic path for compose-app project
Kshitij09 Oct 6, 2024
746937d
Use shared libs.versions.toml
Kshitij09 Oct 6, 2024
94f7f16
Init common project
Kshitij09 Oct 6, 2024
41b63a8
Temporarily remove lint plugin from jvm-library plugin
Kshitij09 Oct 6, 2024
59f6a1c
Remove toolchain plugin from common project
Kshitij09 Oct 6, 2024
6daea12
Configure top level plugins for common project
Kshitij09 Oct 6, 2024
5056927
Configure group and version for all common modules
Kshitij09 Oct 6, 2024
12642d5
Move ktor-client & inject to common project
Kshitij09 Oct 6, 2024
25e7a4c
Move json to common project
Kshitij09 Oct 6, 2024
f10813b
Remove lint from AndroidLibraryConventionPlugin
Kshitij09 Oct 6, 2024
3eae751
Move imageloading & test mdules to common project
Kshitij09 Oct 6, 2024
a27057b
Cleanup local refs of moved modules
Kshitij09 Oct 6, 2024
13cb60a
Duplicate android props to common project
Kshitij09 Oct 6, 2024
fed852a
Make project naming generic
Kshitij09 Oct 7, 2024
4d91482
Move feed networking to common
Kshitij09 Oct 7, 2024
6fcd119
Move post networking to common
Kshitij09 Oct 7, 2024
5ec528c
Move profile networking to common
Kshitij09 Oct 7, 2024
fade53d
Move fake network api module to common
Kshitij09 Oct 7, 2024
99e1a65
Cleanup data project paths from compose-app
Kshitij09 Oct 7, 2024
40250ab
Move domain modules to common
Kshitij09 Oct 7, 2024
ca369f6
Fix common project dependencies
Kshitij09 Oct 7, 2024
34f7d81
Delete top level project, move version-catalog to build-logic
Kshitij09 Oct 7, 2024
cfe121f
Rename compose project
Kshitij09 Oct 7, 2024
5a89b1b
Delete unused file
Kshitij09 Oct 7, 2024
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: 0 additions & 8 deletions frontend/.idea/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
with(pluginManager) {
apply("com.android.library")
apply("org.jetbrains.kotlin.android")
apply("snakechat.android.lint")
}

extensions.configure<LibraryExtension> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class JvmLibraryConventionPlugin : Plugin<Project> {
with(target) {
with(pluginManager) {
apply("org.jetbrains.kotlin.jvm")
apply("snakechat.android.lint")
}
configureKotlinJvm()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ class KotlinInjectConventionPlugin : Plugin<Project> {
dependencies {
add("ksp", libs.findLibrary("kotlininject.compiler").get())
add("implementation", libs.findLibrary("kotlininject.runtime").get())
add("implementation", project(":libraries:inject"))
if (rootProject.name == "snakechat-common") {
add("implementation", project(":library:library-inject"))
} else {
add("implementation", "cc.snakechat:library-inject:1.0.0")
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,27 @@ lyricist = { module = "cafe.adriel.lyricist:lyricist", version.ref = "lyricist"
lyricist-processor = { module = "cafe.adriel.lyricist:lyricist-processor", version.ref = "lyricist" }
result = { module = "com.michael-bull.kotlin-result:kotlin-result", version.ref = "result" }
slf4j-android = { module = "org.slf4j:slf4j-android", version.ref = "slf4jAndroid" }
snakechat-data-network-common = { module = "cc.snakechat:data-network-common", version = "1.0.0" }
snakechat-data-network-fake = { module = "cc.snakechat:data-network-fake", version = "1.0.0" }
snakechat-data-network-feed-api = { module = "cc.snakechat:data-network-feed-api", version = "1.0.0" }
snakechat-data-network-feed-impl = { module = "cc.snakechat:data-network-feed-impl", version = "1.0.0" }
snakechat-data-network-post-api = { module = "cc.snakechat:data-network-post-api", version = "1.0.0" }
snakechat-data-network-post-impl = { module = "cc.snakechat:data-network-post-impl", version = "1.0.0" }
snakechat-data-network-profile-api = { module = "cc.snakechat:data-network-profile-api", version = "1.0.0" }
snakechat-data-network-profile-impl = { module = "cc.snakechat:data-network-profile-impl", version = "1.0.0" }

snakechat-domain-common = { module = "cc.snakechat:domain-common", version = "1.0.0" }
snakechat-domain-common-model = { module = "cc.snakechat:domain-common-model", version = "1.0.0" }
snakechat-domain-feed = { module = "cc.snakechat:domain-feed", version = "1.0.0" }
snakechat-domain-model-likers = { module = "cc.snakechat:domain-model-likers", version = "1.0.0" }
snakechat-domain-post = { module = "cc.snakechat:domain-post", version = "1.0.0" }
snakechat-domain-profile = { module = "cc.snakechat:domain-profile", version = "1.0.0" }

snakechat-library-imageLoading = { module = "cc.snakechat:library-imageloading", version = "1.0.0" }
snakechat-library-inject = { module = "cc.snakechat:library-inject", version = "1.0.0" }
snakechat-library-json = { module = "cc.snakechat:library-json", version = "1.0.0" }
snakechat-library-ktorClient = { module = "cc.snakechat:library-ktor-client", version = "1.0.0" }
snakechat-library-test = { module = "cc.snakechat:library-test", version = "1.0.0" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
Expand Down
Binary file not shown.
6 changes: 6 additions & 0 deletions frontend/build-logic/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Sun Oct 06 20:23:49 IST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ dependencyResolutionManagement {
google()
mavenCentral()
}
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}

rootProject.name = "build-logic"
Expand Down
43 changes: 43 additions & 0 deletions frontend/common/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.gradle
local.properties
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Kotlin ###
.kotlin

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
14 changes: 14 additions & 0 deletions frontend/common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.module.graph) apply true // Plugin applied to allow module graph generation
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.parcelize) apply false
}

allprojects {
group = "cc.snakechat"
version = "1.0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ plugins {

dependencies {
api(libs.result)
api(projects.libraries.ktorClient)
api(projects.library.libraryKtorClient)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ plugins {
android.namespace = "cc.snakechat.data"

dependencies {
api(projects.data.network.feed.api)
api(projects.data.network.post.api)
api(projects.data.network.profile.api)
api(projects.data.network.feed.dataNetworkFeedApi)
api(projects.data.network.post.dataNetworkPostApi)
api(projects.data.network.profile.dataNetworkProfileApi)
api(libs.result)
implementation(libs.kotlinx.serialization)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ plugins {
dependencies {
implementation(libs.kotlinx.serialization)
implementation(libs.kotlinx.coroutines.core)
implementation(projects.libraries.ktorClient)
api(projects.data.network.profile.api)
implementation(projects.library.libraryKtorClient)
api(projects.data.network.feed.dataNetworkFeedApi)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ plugins {
dependencies {
implementation(libs.kotlinx.serialization)
implementation(libs.kotlinx.coroutines.core)
implementation(projects.libraries.ktorClient)
api(projects.data.network.post.api)
implementation(projects.library.libraryKtorClient)
api(projects.data.network.post.dataNetworkPostApi)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ plugins {

dependencies {
implementation(libs.kotlinx.serialization)
api(projects.data.network.common)
api(projects.data.network.dataNetworkCommon)
api(libs.result)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ plugins {
dependencies {
implementation(libs.kotlinx.serialization)
implementation(libs.kotlinx.coroutines.core)
implementation(projects.libraries.ktorClient)
api(projects.data.network.feed.api)
implementation(projects.library.libraryKtorClient)
api(projects.data.network.profile.dataNetworkProfileApi)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(projects.data.network.feed.api)
implementation(projects.data.network.feed.dataNetworkFeedApi)
implementation(libs.androidx.paging.common)
api(projects.domain.common)
api(projects.domain.domainCommon)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ plugins {

dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(projects.data.network.post.api)
implementation(projects.data.network.post.dataNetworkPostApi)
implementation(libs.androidx.paging.common)
api(projects.domain.common)
api(projects.domain.commonModel)
api(projects.domain.domainCommon)
api(projects.domain.domainCommonModel)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ plugins {

dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(projects.data.network.profile.api)
implementation(projects.data.network.profile.dataNetworkProfileApi)
implementation(libs.androidx.paging.common)
api(projects.domain.common)
api(projects.domain.commonModel)
api(projects.domain.domainCommon)
api(projects.domain.domainCommonModel)
}
13 changes: 13 additions & 0 deletions frontend/common/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
kotlin.code.style=official
android.useAndroidX=true
# Disable build features that are enabled by default,
# https://developer.android.com/build/releases/gradle-plugin#default-changes
android.defaults.buildfeatures.resvalues=false
android.defaults.buildfeatures.shaders=false

# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true

android.enableR8.fullMode=true
Binary file added frontend/common/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions frontend/common/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Sun Oct 06 20:23:49 IST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading