-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from lemoncloud-io/develop
린트 추가 및 android component 모듈 추가
- Loading branch information
Showing
65 changed files
with
755 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
root = true | ||
|
||
[*] | ||
# 인코딩 방식 | ||
charset = utf-8 | ||
# 줄바꿈 타입 | ||
end_of_line = lf | ||
# 들여쓰기 타입 | ||
indent_style = space | ||
# true 경우, 문자 앞의 공백을 제거 | ||
trim_trailing_whitespace = true | ||
# ture 경우, 파일을 저장할 때 새 줄로 끝남 | ||
insert_final_newline = true | ||
# 최대 길이 | ||
max_line_length = 120 | ||
# indent_size | ||
indent_size = 4 | ||
|
||
[*.{kt,kts}] | ||
disabled_rules = import-ordering,comment-spacing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# What's Changed | ||
|
||
|
||
|
||
|
||
### Memo | ||
|
||
별도 메모 사항이 있을 경우 작성 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,30 @@ | |
|
||
안드로이드에서 공통적으로 사용될 모듈 저장소 | ||
|
||
**Authors** : [email protected] | ||
|
||
## Module | ||
|
||
| module | description | | ||
|----------------------------------|---------------------------| | ||
| ui-architecture | mvi 기반 architecture 인터페이스 | | ||
| android-component(Not implement) | android component 관련 유틸리티 | | ||
|
||
| module | description | | ||
|------------------------------|---------------------------| | ||
| lemon-core-ui:architecture | mvi 기반 architecture 인터페이스 | | ||
| lemon-core-android:component | android component 유틸리티 | | ||
|
||
### UI-Architecture | ||
안드로이드 UI 구조를 효과적으로 빌딩하기 위한 아키텍처 라이브러리. MVI 기반의 아키텍처로 State Event Effect를 제어하여 사용자와 UI간의 상태 및 이벤트 흐름과 사이에 발생하는 이펙트를 효과적으로 처리할 수 있습니다. | ||
|
||
안드로이드 UI 구조를 효과적으로 빌딩하기 위한 아키텍처 라이브러리. MVI 기반의 아키텍처로 State Event Effect를 제어하여 사용자와 UI간의 상태 및 이벤트 흐름과 사이에 발생하는 이펙트를 효과적으로 | ||
처리할 수 있습니다. | ||
|
||
### Android-Component | ||
|
||
안드로이드 컴포넌트 제어 라이브러리 안드로이드 컴포넌트 초기화, 설정 및 컴포넌트간의 통신과 같은 작업을 수행합니다. | ||
|
||
## 초기화 | ||
|
||
최초로 프로젝트를 다운받은 후 `./init_lint_settings.sh` 를 실행해주세요. commit changes 에 대한 lint를 자동적으로 수행합니다. | ||
|
||
## AAR 배포 | ||
|
||
Lemon Android Core Module에서 사용되는 라이브러리를 배포해야 할 상황이 존재할 경우 루트 디렉터리에 존재하는 `assemble_aar.sh` 스크립트 파일을 실행하면 됩니다. | ||
이때 생성되는 AAR들은 난독화가 적용되어 있습니다. 배포되는 aar들의 난독화 여부와 flavor 구성들을 수정하고 싶을 경우, `build-system` 모듈의 `Config` 를 확인하세요. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
chmod +x "./gradlew" | ||
|
||
# ktlint 검사 | ||
./gradlew ktlintCheck | ||
|
||
# AAR 배포 | ||
./gradlew assembleRelease | ||
|
||
# 모든 모듈의 AAR 을 수집하여 ./build/outputs 에 배치 | ||
./gradlew assembleAAR | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,6 @@ dependencyResolutionManagement { | |
} | ||
|
||
|
||
rootProject.name = "buildSystem" | ||
rootProject.name = "build-system" | ||
|
||
|
1 change: 0 additions & 1 deletion
1
...in/io/lemon/android/buildSystem/Config.kt → ...in/io/lemon/android/buildSystem/Config.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion
1
...System/plugin/AndroidApplicationPlugin.kt → ...System/plugin/AndroidApplicationPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
chmod +x "./gradlew" | ||
|
||
# pre commit 린트 검사 훅 등록 | ||
./gradlew addKtlintCheckGitPreCommitHook | ||
|
||
echo "린트 검사 규칙이 적용되었습니다." |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Android-Component | ||
android component 유틸리티 | ||
|
||
### Intent | ||
`Intent` 설정을 빌드하는 모듈입니다. `IntentBuilder`를 사용하여 Intent를 구성할 수 있으며, 이는 `Component` 의 `Launcher`와 연동하여 사용할 수 있습니다. | ||
또한 특수한 목적으로 사용되는 `Intent`를 빠르게 구성하는 확장 람다 함수가 존재합니다. (예를 들어, URL에 대한 사이트를 빠르게 불러오는 `getUrlIntent`, Application 설정으로 빠르게 이동하는 `getSettingIntent`) | ||
`Intent`를 컴포넌트 목적에 따른 `PendingIntent`로 변환하는 함수는 `PendingIntent` Object 내에 존재합니다. | ||
|
||
### Launcher | ||
`Android Component` 설정을 빠르게 구성하는 모듈입니다. | ||
`Launcher` 생성 시 `Intent` 가 구성되며, 컴포넌트를 수행할 수 있는 함수가 존재합니다. 내부 `Intent` 정보는 `IntentBuilder`를 사용하여 수정할 수 있습니다. 이를 통해 extra,data 그리고 특수한 flag등을 설정할 수 있습니다. | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
plugins { | ||
alias(libs.plugins.lemon.android.library) | ||
alias(libs.plugins.lemon.android.feature) | ||
alias(libs.plugins.lemon.android.kotlin) | ||
} | ||
|
||
android { | ||
namespace = "io.lemon.android.core.android.component" | ||
} |
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
</manifest> |
89 changes: 89 additions & 0 deletions
89
...-android/component/src/main/java/io/remon/android/core/android/component/intent/Intent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package io.remon.android.core.android.component.intent | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import android.net.Uri | ||
import android.os.Build | ||
import android.os.Parcelable | ||
import android.provider.Settings | ||
import java.io.Serializable | ||
|
||
/** | ||
* [Intent] | ||
* | ||
* Intent 유틸리티 | ||
* | ||
* @author [email protected] | ||
*/ | ||
object Intent { | ||
|
||
/** | ||
* [intentBuilder] | ||
* | ||
* 인텐트 빌더를 생성합니다. | ||
* | ||
* context를 포함하지 않는 인텐트의 경우 해당 메서드를 사용합니다. | ||
* | ||
* @see IntentBuilder | ||
*/ | ||
fun intentBuilder(): IntentBuilder = IntentBuilder() | ||
|
||
/** | ||
* [intentBuilder] | ||
* | ||
* 인텐트 빌더를 생성합니다. | ||
* | ||
* intent 타겟을 포함할 경우 헤당 메서드를 사용합니다. | ||
* | ||
* @see IntentBuilder | ||
*/ | ||
fun intentBuilder(context: Context, `class`: Class<*>): IntentBuilder = IntentBuilder(context, `class`) | ||
|
||
/** | ||
* [getParcelableExtraExt] | ||
* | ||
* intent extra에 포함되어 있는 parcelable 객체를 가져올 때 사용합니다. | ||
*/ | ||
fun <T : Parcelable> Intent.getParcelableExtraExt(key: String, `class`: Class<T>): T? { | ||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) | ||
getParcelableExtra(key, `class`) | ||
else getParcelableExtra(key) | ||
} | ||
|
||
/** | ||
* [getSerializableExtraExt] | ||
* | ||
* intent extra에 포함되어 있는 serializable 객체를 가져올 때 사용합니다. | ||
*/ | ||
@Suppress("UNCHECKED_CAST") | ||
fun <T : Serializable> Intent.getSerializableExtraExt(key: String, `class`: Class<T>): T? { | ||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { | ||
this.getSerializableExtra(key, `class`) | ||
} else { | ||
this.getSerializableExtra(key) as T? | ||
} | ||
} | ||
|
||
/** | ||
* [getUrlIntent] | ||
* | ||
* url 주소를 포함한 intent를 생성합니다. | ||
* | ||
* `startActivity()`와 연계하여 사용합니다. | ||
*/ | ||
val getUrlIntent: (String) -> Intent = | ||
{ url -> intentBuilder().setAction(Intent.ACTION_VIEW).setData(Uri.parse(url)).build() } | ||
|
||
/** | ||
* [getSettingsIntent] | ||
* | ||
* 애플리케이션의 설정으로 이동하는 intent를 생성합니다. | ||
* | ||
* `startActivity()`와 연계하여 사용합니다. | ||
*/ | ||
val getSettingsIntent: (Context) -> Intent = { context -> | ||
intentBuilder().setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).setData( | ||
Uri.parse("package:${context.packageName}") | ||
).build() | ||
} | ||
} |
Oops, something went wrong.