Skip to content

Commit

Permalink
Merge branch 'develop' into docs/#50-README.md-update
Browse files Browse the repository at this point in the history
  • Loading branch information
nagaeng authored Jul 19, 2024
2 parents 9e75923 + 3b6f0bb commit c2756a2
Show file tree
Hide file tree
Showing 341 changed files with 12,133 additions and 507 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
max_line_length = 150
max_line_length = 350
insert_final_newline = true
trim_trailing_whitespace = true

Expand Down
50 changes: 26 additions & 24 deletions .github/workflows/android-pull-request-ci.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
name: Android Pull Request CI
on:
pull_request:
branches: [ develop ]
pull_request:
branches: [ develop ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'

- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Add Local Properties
env:
BASE_URL: ${{ secrets.BASE_URL }}
KAKAO_NATIVE_KEY: ${{ secrets.KAKAO_NATIVE_KEY }}
run: |
echo base.url=\"$BASE_URL\" >> ./local.properties
- name: Add Local Properties
env:
BASE_URL: ${{ secrets.BASE_URL }}
KAKAO_NATIVE_KEY: ${{ secrets.KAKAO_NATIVE_KEY }}
run: |
echo base.url=\"$BASE_URL\" >> ./local.properties
echo kakao.native.key=\"KAKAO_NATIVE_KEY\" >> ./local.properties
echo kakaoNativeKey=\"$KAKAO_NATIVE_KEY\" >> ./local.properties
- name: Run ktlint
run: ./gradlew ktlintCheck
- name: Run ktlint
run: ./gradlew ktlintCheck

10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@
## 🪽 의존성 그래프
<img src="https://github.com/user-attachments/assets/174dcaf5-1be6-40b2-b4b1-db560b67c92e" alt="img_module_graph" style="width: 100%;"></br>


## 📂 폴더링
## 🗂️ 폴더링

```bash
├── Recordy
Expand All @@ -65,13 +64,6 @@
│ ├── 📁 convention
├── 📁:core
│ ├── 🗂️ buildconfig
│ ├── 🗂️ cache
│ ├── 🗂️ common
│ ├── 🗂️ datastore
│ ├── 🗂️ model
│ ├── 🗂️ network
│ ├── 🗂️ ui
│ ├── 🗂️ designsystem
├── 📁:data
│ ├── 🗂️ auth
│ ├── 🗂️ keyword
Expand Down
14 changes: 14 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
alias(libs.plugins.recordy.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.recordy.android.hilt)
}

android {
Expand All @@ -13,5 +14,18 @@ dependencies {
implementation(projects.core.buildconfig)
implementation(projects.core.datastore)
implementation(projects.core.network)
implementation(projects.core.cache)
implementation(projects.data.auth)
implementation(projects.data.oauth)
implementation(projects.data.video)
implementation(projects.data.user)
implementation(projects.data.keyword)
implementation(projects.local.auth)
implementation(projects.local.user)
implementation(projects.remote.auth)
implementation(projects.remote.user)
implementation(projects.remote.video)
implementation(projects.remote.keyword)
implementation(projects.feature.navigator)
implementation(libs.kakao.login)
}
27 changes: 25 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28"
tools:ignore="ScopedStorage" />

<application
android:name=".RecordyApplication"
android:largeHeap="true"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
Expand All @@ -16,6 +26,19 @@
android:theme="@style/Theme.Recordy"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<!-- Redirect URI: "kakao${NATIVE_APP_KEY}://oauth" -->
<data android:host="oauth"
android:scheme="kakao${KAKAO_NATIVE_KEY}" />
</intent-filter>
</activity>
</application>

</manifest>
</manifest>
17 changes: 16 additions & 1 deletion app/src/main/java/com/record/recordy/RecordyApplication.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
package com.record.recordy

import android.app.Application
import android.util.Log
import com.kakao.sdk.common.KakaoSdk
import com.kakao.sdk.common.util.Utility
import com.record.buildconfig.BuildConfig.KAKAO_NATIVE_KEY
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class RecordyApplication : Application()
class RecordyApplication : Application() {
override fun onCreate() {
super.onCreate()
setKakaoSdk()
val keyHash = Utility.getKeyHash(this)
Log.d("키해시", " $keyHash")
}

private fun setKakaoSdk() {
KakaoSdk.init(this, KAKAO_NATIVE_KEY)
}
}
12 changes: 11 additions & 1 deletion build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,15 @@ gradlePlugin {
id = "recordy.data"
implementationClass = "RecordyDataPlugin"
}

register("recordyLocal") {
id = "recordy.local"
implementationClass = "RecordyLocalPlugin"
}

register("recordyRemote") {
id = "recordy.remote"
implementationClass = "RecordyRemotePlugin"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import com.android.build.api.dsl.ApplicationExtension
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
import com.record.convention.configureAndroidCompose
import com.record.convention.configureKotlinAndroid
import com.record.convention.extension.getLibrary
Expand All @@ -24,6 +25,7 @@ internal class AndroidApplicationPlugin : Plugin<Project> {
targetSdk = libs.getVersion("targetSdk").requiredVersion.toInt()
versionCode = libs.getVersion("versionCode").requiredVersion.toInt()
versionName = libs.getVersion("versionName").requiredVersion
manifestPlaceholders["KAKAO_NATIVE_KEY"] = gradleLocalProperties(rootDir, providers).getProperty("kakaoNativeKey")
}
}

Expand All @@ -32,4 +34,4 @@ internal class AndroidApplicationPlugin : Plugin<Project> {
}
}
}
}
}
17 changes: 16 additions & 1 deletion build-logic/convention/src/main/java/RecordyDataPlugin.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
import com.record.convention.extension.getLibrary
import com.record.convention.extension.implementation
import com.record.convention.extension.libs
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.dependencies

class RecordyDataPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("recordy.android.library")
apply("recordy.android.hilt")
apply("org.jetbrains.kotlin.plugin.serialization")
}

dependencies {
implementation(project(":core:network"))
implementation(project(":core:common"))
implementation(project(":core:model"))

implementation(libs.getLibrary("kotlinx.serialization.json"))
implementation(libs.getLibrary("retrofit.core"))
implementation(libs.getLibrary("retrofit.kotlin.serialization"))
}
}
}
}
}
13 changes: 13 additions & 0 deletions build-logic/convention/src/main/java/RecordyLocalPlugin.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import org.gradle.api.Plugin
import org.gradle.api.Project

class RecordyLocalPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("recordy.android.library")
apply("recordy.android.hilt")
}
}
}
}
26 changes: 26 additions & 0 deletions build-logic/convention/src/main/java/RecordyRemotePlugin.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import com.record.convention.extension.getLibrary
import com.record.convention.extension.implementation
import com.record.convention.extension.libs
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.dependencies

class RecordyRemotePlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("recordy.android.library")
apply("recordy.android.hilt")
apply("org.jetbrains.kotlin.plugin.serialization")
}

dependencies {
implementation(project(":core:network"))

implementation(libs.getLibrary("kotlinx.serialization.json"))
implementation(libs.getLibrary("retrofit.core"))
implementation(libs.getLibrary("retrofit.kotlin.serialization"))
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ internal fun Project.configureBuildConfig(
"BASE_URL",
gradleLocalProperties(rootDir, providers).getProperty("base.url")
)
buildConfigField(
"String",
"KAKAO_NATIVE_KEY",
gradleLocalProperties(rootDir, providers).getProperty("kakao.native.key")
)
}

buildFeatures {
buildConfig = true
}
}
}
}
1 change: 1 addition & 0 deletions core/buildconfig/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ android {

dependencies {
implementation(projects.core.common)
implementation(libs.kakao.login)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ package com.record.buildconfig.impl

import com.record.buildconfig.BuildConfig.BASE_URL
import com.record.buildconfig.BuildConfig.DEBUG
import com.record.buildconfig.BuildConfig.KAKAO_NATIVE_KEY
import com.record.common.buildconfig.BuildConfigFieldProvider
import com.record.common.buildconfig.BuildConfigFields
import javax.inject.Inject

class BuildConfigFieldsProviderImpl : BuildConfigFieldProvider {
class BuildConfigFieldsProviderImpl @Inject constructor() : BuildConfigFieldProvider {
override fun get(): BuildConfigFields =
BuildConfigFields(
baseUrl = BASE_URL,
kakaoNativeKey = KAKAO_NATIVE_KEY,
isDebug = DEBUG,
)
}
12 changes: 12 additions & 0 deletions core/cache/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
plugins {
alias(libs.plugins.recordy.android.library)
alias(libs.plugins.recordy.android.hilt)
}

android {
namespace = "com.record.cache"
}

dependencies {
implementation(libs.bundles.media3)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
</manifest>
32 changes: 32 additions & 0 deletions core/cache/src/main/java/com/record/cache/CacheModule.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.record.cache

import android.content.Context
import androidx.annotation.OptIn
import androidx.media3.common.util.UnstableApi
import androidx.media3.database.StandaloneDatabaseProvider
import androidx.media3.datasource.cache.Cache
import androidx.media3.datasource.cache.NoOpCacheEvictor
import androidx.media3.datasource.cache.SimpleCache
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import java.io.File
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object CacheModule {

@OptIn(UnstableApi::class)
@Provides
@Singleton
fun provideSimpleCache(@ApplicationContext context: Context): Cache {
val cacheDir = File(context.cacheDir, "media")
val evictor = NoOpCacheEvictor()
val databaseProvider = StandaloneDatabaseProvider(context)
val simpleCache = SimpleCache(cacheDir, evictor, databaseProvider)
return simpleCache
}
}
Loading

0 comments on commit c2756a2

Please sign in to comment.