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

[feature/fix-build-issues] CI 빌드 이슈 해결하기 #864

Merged
merged 8 commits into from
Sep 24, 2024
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
7 changes: 2 additions & 5 deletions .github/workflows/develop_PR_builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
distribution: 'zulu'
java-version: 17

- name: Change gradlew permissions
Expand Down Expand Up @@ -67,8 +67,5 @@ jobs:
- name: Access Firebase Service
run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > ./app/google-services.json

# - name: Lint Check
# run: ./gradlew ktlintCheck --exclude '**/*.kts' src

- name: Build debug APK
run: ./gradlew assembleDebug --stacktrace
run: ./gradlew :app:assembleDebug --stacktrace
7 changes: 2 additions & 5 deletions .github/workflows/develop_merge_builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
distribution: 'zulu'
java-version: 17

- name: Change gradlew permissions
Expand Down Expand Up @@ -67,8 +67,5 @@ jobs:
- name: Access Firebase Service
run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > ./app/google-services.json

# - name: Lint Check
# run: ./gradlew ktlintCheck --exclude '**/*.kts' src

- name: Build debug APK
run: ./gradlew assembleDebug --stacktrace
run: ./gradlew :app:assembleDebug --stacktrace
Original file line number Diff line number Diff line change
Expand Up @@ -30,85 +30,98 @@ import android.content.Intent
import android.net.Uri
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import dagger.hilt.android.AndroidEntryPoint
import dagger.hilt.android.EntryPointAccessors
import org.sopt.official.auth.model.UserStatus
import org.sopt.official.common.navigator.DeepLinkType
import org.sopt.official.common.util.extractQueryParameter
import org.sopt.official.common.util.isExpiredDate
import org.sopt.official.common.util.serializableExtra
import org.sopt.official.feature.home.HomeActivity
import org.sopt.official.feature.notification.detail.NotificationDetailActivity
import org.sopt.official.network.persistence.SoptDataStore
import org.sopt.official.network.persistence.SoptDataStoreEntryPoint
import timber.log.Timber
import java.io.Serializable
import javax.inject.Inject

@AndroidEntryPoint
class SchemeActivity : AppCompatActivity() {
@Inject
lateinit var dataStore: SoptDataStore
private val args by serializableExtra(Argument("", ""))

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
handleDeepLink()
}
private val dataStore by lazy {
EntryPointAccessors
.fromApplication<SoptDataStoreEntryPoint>(applicationContext)
.soptDataStore()
}
private val args by serializableExtra(Argument("", ""))

private fun handleDeepLink() {
val link = args?.link
val linkIntent = when (link.isNullOrBlank()) {
true -> NotificationDetailActivity.getIntent(this, args?.notificationId.orEmpty())
false -> checkLinkExpiration(link)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
handleDeepLink()
}

when (!isTaskRoot) {
true -> startActivity(linkIntent)
false -> TaskStackBuilder.create(this).apply {
if (!isIntentToHome(linkIntent)) {
addNextIntentWithParentStack(
DeepLinkType.getHomeIntent(UserStatus.of(dataStore.userStatus))
)
private fun handleDeepLink() {
val link = args?.link
val linkIntent = if (link.isNullOrBlank()) {
NotificationDetailActivity.getIntent(
this,
args?.notificationId.orEmpty()
)
} else {
checkLinkExpiration(link)
}

when (!isTaskRoot) {
true -> startActivity(linkIntent)
false -> TaskStackBuilder.create(this).apply {
if (!isIntentToHome()) {
addNextIntentWithParentStack(
DeepLinkType.getHomeIntent(UserStatus.of(dataStore.userStatus))
)
}
addNextIntent(linkIntent)
}.startActivities()
}
addNextIntent(linkIntent)
}.startActivities()
finish()
}
finish()
}

private fun checkLinkExpiration(link: String): Intent {
return try {
val expiredAt = link.extractQueryParameter("expiredAt")
when (expiredAt.isExpiredDate()) {
true -> DeepLinkType.getHomeIntent(
UserStatus.of(dataStore.userStatus), DeepLinkType.EXPIRED
)
private fun checkLinkExpiration(link: String): Intent {
return try {
val expiredAt = link.extractQueryParameter("expiredAt")
when (expiredAt.isExpiredDate()) {
true -> DeepLinkType.getHomeIntent(
UserStatus.of(dataStore.userStatus),
DeepLinkType.EXPIRED
)

else -> when (link.contains("http://") || link.contains("https://")) {
true -> Intent(
Intent.ACTION_VIEW,
Uri.parse(link)
)

else -> when (link.contains("http://") || link.contains("https://")) {
true -> Intent(Intent.ACTION_VIEW, Uri.parse(link))
false -> DeepLinkType.of(link).getIntent(
this, UserStatus.of(dataStore.userStatus), link
)
false -> DeepLinkType.of(link).getIntent(
this,
UserStatus.of(dataStore.userStatus),
link
)
}
}
} catch (exception: Exception) {
Timber.e(exception)
DeepLinkType.getHomeIntent(
UserStatus.of(dataStore.userStatus),
DeepLinkType.UNKNOWN
)
}
}
} catch (exception: Exception) {
Timber.e(exception)
DeepLinkType.getHomeIntent(
UserStatus.of(dataStore.userStatus), DeepLinkType.UNKNOWN
)
}
}

private fun Intent.isIntentToHome(): Boolean =
intent.component?.className == HomeActivity::class.java.name
private fun isIntentToHome(): Boolean {
return intent.action == Intent.ACTION_MAIN && (intent.categories?.contains(Intent.CATEGORY_LAUNCHER) == true)
}
}

data class Argument(
val notificationId: String, val link: String
) : Serializable
data class Argument(
val notificationId: String,
val link: String
) : Serializable

companion object {
@JvmStatic
fun getIntent(context: Context, args: Argument) = Intent(context, SchemeActivity::class.java).putExtra("args", args)
}
companion object {
@JvmStatic
fun getIntent(context: Context, args: Argument) = Intent(context, SchemeActivity::class.java)
.putExtra("args", args)
}
}
2 changes: 1 addition & 1 deletion build-logic/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jan 13 12:46:38 KST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ package org.sopt.official.network.persistence

import android.content.Context
import androidx.core.content.edit
import dagger.hilt.EntryPoint
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject
import javax.inject.Singleton
import dagger.hilt.components.SingletonComponent
import org.sopt.official.common.di.LocalStore
import org.sopt.official.common.file.createSharedPreference
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class SoptDataStore @Inject constructor(
Expand Down Expand Up @@ -77,3 +80,9 @@ class SoptDataStore @Inject constructor(
private const val UNAUTHENTICATED = "UNAUTHENTICATED"
}
}

@EntryPoint
@InstallIn(SingletonComponent::class)
interface SoptDataStoreEntryPoint {
fun soptDataStore(): SoptDataStore
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ org.gradle.jvmargs=-Xmx4092m -Dfile.encoding\=UTF-8
android.useAndroidX=true
kotlin.incremental.usePreciseJavaTracking=true
android.enableJetifier=false
ksp.useKSP2=false
14 changes: 7 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ corektx = "1.13.1"
appcompat = "1.7.0"
activity = "1.9.2"
fragmentKtx = "1.8.3"
lifecycle = "2.8.5"
lifecycle = "2.8.6"
swipe-refresh-layout = "1.1.0"
navigation = "2.8.0"
startup = "1.1.1"
navigation = "2.8.1"
startup = "1.2.0"
customtab = "1.8.0"
exifinterface = "1.3.7"
compose-bom = "2024.09.01"
compose-bom = "2024.09.02"
androidx-paging = "3.3.2"
desugarJdk = "2.1.2"

Expand Down Expand Up @@ -66,9 +66,9 @@ process-pheonix = "3.0.0"
amplitude = "1.18.0"
spotless = "6.25.0"
constraintlayout = "2.1.4"
benchmark-macro-junit4 = "1.3.0"
androidx-baselineprofile = "1.3.0"
profileinstaller = "1.3.1"
benchmark-macro-junit4 = "1.3.1"
androidx-baselineprofile = "1.3.1"
profileinstaller = "1.4.0"

[libraries]
agp = { module = "com.android.tools.build:gradle", version.ref = "gradleplugin" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading