Skip to content

Commit

Permalink
fix: 라이브러리 버전 업그레이드
Browse files Browse the repository at this point in the history
프로젝트 수준 build.gradle kts 로 전환
projectDependencyGraph.gradle 의존성 추가
  • Loading branch information
easyhooon committed Apr 17, 2023
1 parent 75a9d56 commit 533038c
Show file tree
Hide file tree
Showing 11 changed files with 149 additions and 25 deletions.
6 changes: 0 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ dependencies {
// Splash API
implementation libs.splash.api

// Mongo DB Realm
// implementation('org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0-native-mt') {
// version {
// strictly("1.6.0-native-mt")
// }
// }
implementation libs.coroutines.core
implementation libs.realm.sync

Expand Down
13 changes: 0 additions & 13 deletions build.gradle

This file was deleted.

11 changes: 11 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apply(from = "gradle/projectDependencyGraph.gradle")

plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.realm.kotlin) apply false
alias(libs.plugins.hilt.android) apply false
alias(libs.plugins.google.services) apply false
alias(libs.plugins.kotlin.kapt) apply false
}
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/ProjectConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ object ProjectConfig {
const val compileSdk = 33
const val minSdk = 24
const val targetSdk = 33
const val extensionVersion = "1.3.1"
const val extensionVersion = "1.4.0"
}

1 change: 1 addition & 0 deletions core/ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ dependencies {
implementation libs.activity.compose
implementation libs.material3.compose
implementation libs.compose.tooling.preview

implementation libs.realm.sync
implementation libs.coroutines.core
}
1 change: 0 additions & 1 deletion core/ui/src/main/java/com/example/ui/GalleryState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class GalleryState {
}



/**
* A class that represents a single image within a Gallery.
* @param image The image that inside a gallery
Expand Down
2 changes: 2 additions & 0 deletions core/util/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ dependencies {
implementation libs.material3.compose
implementation libs.compose.tooling.preview
implementation libs.coil

implementation libs.firebase.storage

implementation libs.realm.sync
implementation libs.coroutines.core
}
3 changes: 3 additions & 0 deletions core/util/src/main/java/com/example/util/Gallery.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ fun Gallery(
spaceBetween: Dp = 10.dp,
imageShape: CornerBasedShape = Shapes().small
) {
// TODO 눈으로 확인했을 때 이미지를 분명 한 칸 더 넣을 수 있을 것 같은데 (5장), 4장 밖에 넣지 못하는 이유 찾기
BoxWithConstraints(modifier = modifier) {
val numberOfVisibleImages = remember {
// store the result of a simple calculation within this variable
Expand Down Expand Up @@ -86,6 +87,8 @@ fun Gallery(
}
}

//TODO swipe 기능을 추가하여 해당 diary 에 올린 모든 image 를 확인할 수 있는 기능을 구현해볼 것
// mood 를 수정할때 썼던 로직을 응용해보면 될듯!
@ExperimentalMaterial3Api
@Composable
fun GalleryUpLoader(
Expand Down
6 changes: 4 additions & 2 deletions feature/write/src/main/java/com/example/write/WriteContent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ internal fun WriteContent(
focusedIndicatorColor = Color.Unspecified,
disabledIndicatorColor = Color.Unspecified,
unfocusedIndicatorColor = Color.Unspecified,
placeholderColor = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.38f)
focusedPlaceholderColor = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.38f),
unfocusedPlaceholderColor = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.38f)
),
keyboardOptions = KeyboardOptions(
imeAction = ImeAction.Next
Expand Down Expand Up @@ -132,7 +133,8 @@ internal fun WriteContent(
focusedIndicatorColor = Color.Unspecified,
disabledIndicatorColor = Color.Unspecified,
unfocusedIndicatorColor = Color.Unspecified,
placeholderColor = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.38f)
focusedPlaceholderColor = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.38f),
unfocusedPlaceholderColor = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.38f)
),
keyboardOptions = KeyboardOptions(
imeAction = ImeAction.Next
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
compose = "1.4.0"
kotlin = "1.7.10"
kotlin = "1.8.0"
core-ktx = "1.9.0"
agp = "7.4.2"
lifecycle-runtime = "2.5.1"
Expand All @@ -16,7 +16,7 @@ firebase-storage = "20.1.0"
room = "2.5.1"
runtime-compose = "2.6.1"
splash = "1.0.0"
realm = "1.0.2"
realm = "1.7.0"
kotlin-coroutines-core = { strictly = "1.6.4" }
dagger-hilt = "2.45"
hilt-navigation-compose = "1.0.0"
Expand Down
125 changes: 125 additions & 0 deletions gradle/projectDependencyGraph.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
task projectDependencyGraph {
doLast {
def dot = new File(rootProject.rootDir, 'project.dot')
dot.parentFile.mkdirs()
dot.delete()

dot << 'digraph {\n'
dot << " graph [label=\"${rootProject.name}\\n \",labelloc=t,fontsize=30,ranksep=1.4];\n"
dot << ' node [style=filled, fillcolor="#bbbbbb"];\n'
dot << ' rankdir=TB;\n'

def rootProjects = []
def queue = [rootProject]
while (!queue.isEmpty()) {
def project = queue.remove(0)
rootProjects.add(project)
queue.addAll(project.childProjects.values())
}

def projects = new LinkedHashSet<Project>()
def dependencies = new LinkedHashMap<Tuple2<Project, Project>, List<String>>()
def multiplatformProjects = []
def jsProjects = []
def androidProjects = []
def androidDynamicFeatureProjects = []
def javaProjects = []

queue = [rootProject]
while (!queue.isEmpty()) {
def project = queue.remove(0)
queue.addAll(project.childProjects.values())

if (project.plugins.hasPlugin('org.jetbrains.kotlin.multiplatform')) {
multiplatformProjects.add(project)
}
if (project.plugins.hasPlugin('kotlin2js')) {
jsProjects.add(project)
}
if (project.plugins.hasPlugin('com.android.library') ||
project.plugins.hasPlugin('com.android.application')) {
androidProjects.add(project)
}
if (project.plugins.hasPlugin('com.android.dynamic-feature')) {
androidDynamicFeatureProjects.add(project)
}
if (project.plugins.hasPlugin('java-library') || project.plugins.hasPlugin('java')) {
javaProjects.add(project)
}

project.configurations.all { config ->
if (config.name.toLowerCase().contains("test")) return
config.dependencies
.withType(ProjectDependency)
.collect { it.dependencyProject }
.each { dependency ->
projects.add(project)
projects.add(dependency)
rootProjects.remove(dependency)

def graphKey = new Tuple2<Project, Project>(project, dependency)
def traits = dependencies.computeIfAbsent(graphKey) { new ArrayList<String>() }

if (config.name.toLowerCase().endsWith('implementation')) {
traits.add('style=dotted')
}
}
}
}

projects = projects.sort { it.path }

dot << '\n # Projects\n\n'
for (project in projects) {
def traits = []

if (rootProjects.contains(project)) {
traits.add('shape=box')
}

if (multiplatformProjects.contains(project)) {
traits.add('fillcolor="#ffd2b3"')
} else if (jsProjects.contains(project)) {
traits.add('fillcolor="#ffffba"')
} else if (androidProjects.contains(project)) {
traits.add('fillcolor="#baffc9"')
} else if (androidDynamicFeatureProjects.contains(project)) {
traits.add('fillcolor="#c9baff"')
} else if (javaProjects.contains(project)) {
traits.add('fillcolor="#ffb3ba"')
} else {
traits.add('fillcolor="#eeeeee"')
}

dot << " \"${project.path}\" [${traits.join(", ")}];\n"
}

dot << '\n {rank = same;'
for (project in projects) {
if (rootProjects.contains(project)) {
dot << " \"${project.path}\";"
}
}
dot << '}\n'

dot << '\n # Dependencies\n\n'
dependencies.forEach { key, traits ->
dot << " \"${key.first.path}\" -> \"${key.second.path}\""
if (!traits.isEmpty()) {
dot << " [${traits.join(", ")}]"
}
dot << '\n'
}

dot << '}\n'

def p = 'dot -Tpng -O project.dot'.execute([], dot.parentFile)
p.waitFor()
if (p.exitValue() != 0) {
throw new RuntimeException(p.errorStream.text)
}
dot.delete()

println("Project module dependency graph created at ${dot.absolutePath}.png")
}
}

0 comments on commit 533038c

Please sign in to comment.