Skip to content

Commit

Permalink
Merge pull request #171 from Project-Unifest/develop
Browse files Browse the repository at this point in the history
release v0.1.3
  • Loading branch information
easyhooon authored May 14, 2024
2 parents 63d796d + bc2c022 commit 1c1fdd2
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/android-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ jobs:

- name: Generate secrets.properties
run: |
echo "SERVER_BASE_URL=${{ secrets.SERVER_BASE_URL }}" >> secrets.properties
echo "NAVER_MAP_CLIENT_ID=${{ secrets.NAVER_MAP_CLIENT_ID }}" >> secrets.properties
- name: Generate local.properties
run: |
echo "RELEASE_SERVER_BASE_URL=\"${{ secrets.RELEASE_SERVER_BASE_URL }}\"" >> local.properties
echo "DEBUG_SERVER_BASE_URL=\"${{ secrets.DEBUG_SERVER_BASE_URL }}\"" >> local.properties
- name: Generate keystore.properties
run: |
echo "STORE_FILE=${{ secrets.STORE_FILE }}" >> keystore.properties
Expand Down
4 changes: 2 additions & 2 deletions build-logic/src/main/kotlin/com/unifest/android/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ internal object ApplicationConfig {
const val MinSdk = 26
const val TargetSdk = 34
const val CompileSdk = 34
const val VersionCode = 3
const val VersionName = "0.1.2"
const val VersionCode = 4
const val VersionName = "0.1.3"
val JavaVersion = org.gradle.api.JavaVersion.VERSION_17
const val JavaVersionAsInt = 17
}
22 changes: 22 additions & 0 deletions core/network/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
@file:Suppress("INLINE_FROM_HIGHER_PLATFORM")

import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
import java.io.FileInputStream
import java.util.Properties

plugins {
alias(libs.plugins.unifest.android.library)
alias(libs.plugins.unifest.android.retrofit)
Expand All @@ -8,12 +12,26 @@ plugins {
id("kotlinx-serialization")
}

val localPropertiesFile = rootProject.file("local.properties")
val localProperties = Properties()
localProperties.load(FileInputStream(localPropertiesFile))

android {
namespace = "com.unifest.android.core.network"

buildFeatures {
buildConfig = true
}

buildTypes {
getByName("debug") {
buildConfigField("String", "SERVER_BASE_URL", getServerBaseUrl("DEBUG_SERVER_BASE_URL"))
}

getByName("release") {
buildConfigField("String", "SERVER_BASE_URL", getServerBaseUrl("DEBUG_SERVER_BASE_URL"))
}
}
}

dependencies {
Expand All @@ -27,3 +45,7 @@ dependencies {
secrets {
defaultPropertiesFileName = "secrets.properties"
}

fun getServerBaseUrl(propertyKey: String): String {
return gradleLocalProperties(rootDir).getProperty(propertyKey)
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.unifest.android.core.common.UiText
import com.unifest.android.core.common.handleException
import com.unifest.android.core.common.utils.matchesSearchText
import com.unifest.android.core.data.repository.BoothRepository
import com.unifest.android.core.data.repository.FestivalRepository
import com.unifest.android.core.data.repository.LikedBoothRepository
import com.unifest.android.core.data.repository.LikedFestivalRepository
import com.unifest.android.core.data.repository.OnboardingRepository
Expand All @@ -33,6 +34,7 @@ import javax.inject.Inject

@HiltViewModel
class MenuViewModel @Inject constructor(
private val festivalRepository: FestivalRepository,
private val likedFestivalRepository: LikedFestivalRepository,
private val boothRepository: BoothRepository,
private val likedBoothRepository: LikedBoothRepository,
Expand All @@ -47,6 +49,7 @@ class MenuViewModel @Inject constructor(
init {
observeLikedFestivals()
// observeLikedBooth()
getAllFestivals()
checkFestivalOnboardingCompletion()
}

Expand Down Expand Up @@ -100,6 +103,20 @@ class MenuViewModel @Inject constructor(
}
}

private fun getAllFestivals() {
viewModelScope.launch {
festivalRepository.getAllFestivals()
.onSuccess { festivals ->
_uiState.update {
it.copy(festivals = festivals.toImmutableList())
}
}
.onFailure { exception ->
handleException(exception, this@MenuViewModel)
}
}
}

fun getLikedBooths() {
viewModelScope.launch {
likedBoothRepository.getLikedBooths()
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ kotlin.code.style=official
android.nonTransitiveRClass=true
android.enableJetifier=true
UNIFEST_CONTACT_URL = "http://pf.kakao.com/_KxaaDG/chat"
UNIFEST_WEB_URL = "http://m.naver.com/"
UNIFEST_WEB_URL = "https://www.unifest.app"

0 comments on commit 1c1fdd2

Please sign in to comment.