Skip to content

Commit 9e3b0ec

Browse files
committed
fix: init project settings
1 parent 9b84665 commit 9e3b0ec

29 files changed

Lines changed: 218 additions & 147 deletions

.idea/compiler.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jarRepositories.xml

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ apply plugin: 'com.android.application'
33
apply plugin: 'kotlin-android'
44
apply plugin: 'kotlin-kapt'
55
apply plugin: 'kotlin-android-extensions'
6-
7-
// https://www.androidhuman.com/lecture/quality/2016/02/13/jacoco_unit_test_android/
8-
// https://jojoldu.tistory.com/275
9-
// https://medium.com/@android2ee/playing-with-gradle-3-and-some-few-code-coverage-on-android-with-jacoco-47df7c9328ae
10-
apply plugin: 'com.github.kt3k.coveralls'
11-
apply plugin: 'jacoco-android'
126
// https://blog.yena.io/studynote/2018/09/08/Android-Kotlin-Room.html
137
// https://kotlinlang.org/docs/reference/using-gradle.html
148

@@ -27,25 +21,9 @@ android {
2721
minifyEnabled false
2822
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
2923
testCoverageEnabled false
30-
buildConfigField "String", "GITHUB_OAUTH_URL", GITHUB_OAUTH_URL
31-
buildConfigField "String", "GITHUB_CLIENT_ID", GITHUB_CLIENT_ID
32-
buildConfigField "String", "GITHUB_CLIENT_SECRET", GITHUB_CLIENT_SECRET
33-
buildConfigField "String", "REDIRECT_CALLBACK_URL", REDIRECT_CALLBACK_URL
34-
buildConfigField "String", "PREFERENCES_FILE", PREFERENCES_FILE
35-
buildConfigField "String", "PREFERENCES_TOKEN_KEY", PREFERENCES_TOKEN_KEY
36-
buildConfigField "String", "BASIC_AUTH_KEY", BASIC_AUTH_KEY
37-
buildConfigField "String", "GFD_API_URL", GFD_API_URL
3824
}
3925
debug {
4026
testCoverageEnabled true
41-
buildConfigField "String", "GITHUB_OAUTH_URL", GITHUB_OAUTH_URL
42-
buildConfigField "String", "GITHUB_CLIENT_ID", GITHUB_CLIENT_ID
43-
buildConfigField "String", "GITHUB_CLIENT_SECRET", GITHUB_CLIENT_SECRET
44-
buildConfigField "String", "REDIRECT_CALLBACK_URL", REDIRECT_CALLBACK_URL
45-
buildConfigField "String", "PREFERENCES_FILE", PREFERENCES_FILE
46-
buildConfigField "String", "PREFERENCES_TOKEN_KEY", PREFERENCES_TOKEN_KEY
47-
buildConfigField "String", "BASIC_AUTH_KEY", BASIC_AUTH_KEY
48-
buildConfigField "String", "GFD_API_URL", GFD_API_URL
4927
}
5028
}
5129
compileOptions {
@@ -61,22 +39,17 @@ android {
6139
lintOptions {
6240
abortOnError false
6341
}
64-
}
65-
66-
coveralls {
67-
jacocoReportPath 'build/reports/jacoco/jacocoTestDebugUnitTestReport/jacocoTestDebugUnitTestReport.xml'
68-
}
69-
jacocoAndroidUnitTestReport {
70-
excludes += ['**/views/**']
42+
buildToolsVersion '28.0.3'
43+
ndkVersion '20.1.5948944'
7144
}
7245

7346
dependencies {
7447
implementation fileTree(dir: 'libs', include: ['*.jar'])
7548
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
76-
implementation 'androidx.appcompat:appcompat:1.1.0'
77-
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
49+
implementation 'androidx.appcompat:appcompat:1.2.0'
50+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
7851
implementation 'com.android.support:design:28.0.0'
79-
implementation "androidx.recyclerview:recyclerview:1.0.0"
52+
implementation "androidx.recyclerview:recyclerview:1.1.0"
8053

8154
// test implementation
8255
implementation 'androidx.legacy:legacy-support-v4:1.0.0'

app/build2.gradle

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
//noinspection LifecycleAnnotationProcessorWithJava8
2+
apply plugin: 'com.android.application'
3+
apply plugin: 'kotlin-android'
4+
apply plugin: 'kotlin-kapt'
5+
apply plugin: 'kotlin-android-extensions'
6+
7+
// https://www.androidhuman.com/lecture/quality/2016/02/13/jacoco_unit_test_android/
8+
// https://jojoldu.tistory.com/275
9+
// https://medium.com/@android2ee/playing-with-gradle-3-and-some-few-code-coverage-on-android-with-jacoco-47df7c9328ae
10+
apply plugin: 'com.github.kt3k.coveralls'
11+
apply plugin: 'jacoco-android'
12+
// https://blog.yena.io/studynote/2018/09/08/Android-Kotlin-Room.html
13+
// https://kotlinlang.org/docs/reference/using-gradle.html
14+
15+
android {
16+
compileSdkVersion 28
17+
defaultConfig {
18+
applicationId "com.seok.gfd"
19+
minSdkVersion 26
20+
targetSdkVersion 28
21+
versionCode 10
22+
versionName "3.20.12"
23+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
24+
}
25+
buildTypes {
26+
release {
27+
minifyEnabled false
28+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
29+
testCoverageEnabled false
30+
buildConfigField "String", "GITHUB_OAUTH_URL", GITHUB_OAUTH_URL
31+
buildConfigField "String", "GITHUB_CLIENT_ID", GITHUB_CLIENT_ID
32+
buildConfigField "String", "GITHUB_CLIENT_SECRET", GITHUB_CLIENT_SECRET
33+
buildConfigField "String", "REDIRECT_CALLBACK_URL", REDIRECT_CALLBACK_URL
34+
buildConfigField "String", "PREFERENCES_FILE", PREFERENCES_FILE
35+
buildConfigField "String", "PREFERENCES_TOKEN_KEY", PREFERENCES_TOKEN_KEY
36+
buildConfigField "String", "BASIC_AUTH_KEY", BASIC_AUTH_KEY
37+
buildConfigField "String", "GFD_API_URL", GFD_API_URL
38+
}
39+
debug {
40+
testCoverageEnabled true
41+
buildConfigField "String", "GITHUB_OAUTH_URL", GITHUB_OAUTH_URL
42+
buildConfigField "String", "GITHUB_CLIENT_ID", GITHUB_CLIENT_ID
43+
buildConfigField "String", "GITHUB_CLIENT_SECRET", GITHUB_CLIENT_SECRET
44+
buildConfigField "String", "REDIRECT_CALLBACK_URL", REDIRECT_CALLBACK_URL
45+
buildConfigField "String", "PREFERENCES_FILE", PREFERENCES_FILE
46+
buildConfigField "String", "PREFERENCES_TOKEN_KEY", PREFERENCES_TOKEN_KEY
47+
buildConfigField "String", "BASIC_AUTH_KEY", BASIC_AUTH_KEY
48+
buildConfigField "String", "GFD_API_URL", GFD_API_URL
49+
}
50+
}
51+
compileOptions {
52+
sourceCompatibility = '1.8'
53+
targetCompatibility = '1.8'
54+
}
55+
testOptions {
56+
unitTests {
57+
includeAndroidResources = true
58+
returnDefaultValues = true
59+
}
60+
}
61+
lintOptions {
62+
abortOnError false
63+
}
64+
}
65+
66+
coveralls {
67+
jacocoReportPath 'build/reports/jacoco/jacocoTestDebugUnitTestReport/jacocoTestDebugUnitTestReport.xml'
68+
}
69+
jacocoAndroidUnitTestReport {
70+
excludes += ['**/views/**']
71+
}
72+
73+
dependencies {
74+
implementation fileTree(dir: 'libs', include: ['*.jar'])
75+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
76+
implementation 'androidx.appcompat:appcompat:1.1.0'
77+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
78+
implementation 'com.android.support:design:28.0.0'
79+
implementation "androidx.recyclerview:recyclerview:1.0.0"
80+
81+
// test implementation
82+
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
83+
testImplementation 'junit:junit:4.12'
84+
testImplementation 'org.robolectric:robolectric:4.3'
85+
testImplementation 'org.powermock:powermock-api-mockito:1.4.12'
86+
testImplementation 'org.powermock:powermock-module-junit4:1.6.2'
87+
testImplementation 'org.mockito:mockito-core:2.28.2'
88+
testImplementation 'androidx.arch.core:core-testing:2.1.0'
89+
androidTestImplementation 'androidx.test:runner:1.2.0'
90+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
91+
androidTestImplementation 'androidx.test:runner:1.2.0'
92+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
93+
androidTestImplementation 'androidx.test:runner:1.2.0'
94+
androidTestImplementation 'androidx.test:rules:1.2.0'
95+
androidTestImplementation 'androidx.test:core:1.2.0'
96+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
97+
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
98+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
99+
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
100+
101+
// Google Ads
102+
implementation 'com.google.android.gms:play-services-ads:18.2.0'
103+
104+
// OkHttp && logger
105+
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
106+
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.2'
107+
108+
// Retrofit2
109+
implementation 'com.squareup.retrofit2:retrofit:2.6.1'
110+
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
111+
implementation 'com.google.code.gson:gson:2.8.5'
112+
113+
// room
114+
implementation 'androidx.room:room-runtime:2.2.0'
115+
kapt 'androidx.room:room-compiler:2.2.0'
116+
kaptTest 'androidx.room:room-testing:2.2.0'
117+
118+
// Lifecycle components
119+
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
120+
implementation 'android.arch.lifecycle:viewmodel:1.1.1'
121+
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.1.0'
122+
123+
// Coroutines
124+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutine_version"
125+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutine_version"
126+
127+
// Using the Glide Library for Image loading
128+
implementation 'com.github.bumptech.glide:glide:4.9.0'
129+
kapt 'com.github.bumptech.glide:compiler:4.9.0'
130+
131+
// jsoup, anko
132+
implementation 'org.jsoup:jsoup:1.11.3'
133+
implementation "org.jetbrains.anko:anko:$rootProject.anko_version"
134+
implementation 'androidx.gridlayout:gridlayout:1.0.0'
135+
136+
// lombok
137+
compileOnly 'org.projectlombok:lombok:1.18.8'
138+
annotationProcessor 'org.projectlombok:lombok:1.18.8'
139+
140+
// ProgressBar
141+
implementation 'com.wang.avi:library:2.1.3'
142+
143+
// NavigationBar
144+
implementation 'androidx.navigation:navigation-fragment-ktx:2.1.0'
145+
implementation 'androidx.navigation:navigation-ui-ktx:2.1.0'
146+
147+
// UI Scale
148+
implementation 'com.ssomai:android.scalablelayout:2.1.6'
149+
150+
// Tab Layout
151+
implementation 'com.ogaclejapan.smarttablayout:library:2.0.0@aar'
152+
implementation 'com.ogaclejapan.smarttablayout:utils-v4:2.0.0@aar'
153+
}

app/src/main/java/com/seok/gfd/retrofit/RetrofitClient.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ class RetrofitClient {
3030
fun userService() : UserService{
3131
val gson = GsonBuilder().setLenient().create()
3232
retrofit = Retrofit.Builder()
33-
.baseUrl(BuildConfig.GFD_API_URL)
33+
.baseUrl("")
3434
.addConverterFactory(GsonConverterFactory.create(gson))
3535
.build()
3636
return retrofit.create(UserService::class.java)
3737
}
3838
fun commitService() : CommitService{
3939
val gson = GsonBuilder().setLenient().create()
4040
retrofit = Retrofit.Builder()
41-
.baseUrl(BuildConfig.GFD_API_URL)
41+
.baseUrl("")
4242
.addConverterFactory(GsonConverterFactory.create(gson))
4343
.build()
4444
return retrofit.create(CommitService::class.java)

app/src/main/java/com/seok/gfd/utils/SharedPreference.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import com.seok.gfd.retrofit.domain.User
99

1010
class SharedPreference(private val application: Application) {
1111
private val pref = application.getSharedPreferences(
12-
BuildConfig.PREFERENCES_FILE,
12+
"",
1313
AppCompatActivity.MODE_PRIVATE
1414
)
1515

app/src/main/java/com/seok/gfd/viewmodel/RankFragmentViewModel.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class RankFragmentViewModel(application: Application) : AndroidViewModel(applica
3333

3434
val getTodayRankListService = RetrofitClient.commitService()
3535
val getTodayRankListCall = getTodayRankListService.getTRCommitList(
36-
BuildConfig.BASIC_AUTH_KEY,
36+
"",
3737
dateFormat.format(Date())
3838
)
3939
getTodayRankListCall.enqueue(object : Callback<List<CommitResponse>> {
@@ -58,7 +58,7 @@ class RankFragmentViewModel(application: Application) : AndroidViewModel(applica
5858
fun updateTodayRankCommit(userId: String, dataCount: Int) {
5959
val updateTodayRankCommitService = RetrofitClient.commitService()
6060
val updateTodayRankCommitCall = updateTodayRankCommitService.enrollCommit(
61-
BuildConfig.BASIC_AUTH_KEY,
61+
"",
6262
CommitRequestDto(userId, dataCount)
6363
)
6464
// updateTodayRankCommitCall.enqueue(object : Callback<String> {
@@ -77,7 +77,7 @@ class RankFragmentViewModel(application: Application) : AndroidViewModel(applica
7777
val dateFormat = SimpleDateFormat("yyyy-MM-dd")
7878
val getTodayRankListService = RetrofitClient.commitService()
7979
val getTodayRankListCall = getTodayRankListService.getTRCommitList(
80-
BuildConfig.BASIC_AUTH_KEY,
80+
"",
8181
dateFormat.format(Date()))
8282
getTodayRankListCall.enqueue(object : Callback<List<CommitResponse>>{
8383
override fun onResponse(

app/src/main/java/com/seok/gfd/viewmodel/UserViewModel.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class UserViewModel : ViewModel() {
3737
// User 인원 수 가져오기
3838
fun getUsersCount() {
3939
val userService = RetrofitClient.userService()
40-
val userCall = userService.getUsersCount(BuildConfig.BASIC_AUTH_KEY)
40+
val userCall = userService.getUsersCount("")
4141
userCall.enqueue(object : retrofit2.Callback<SingleResponseDto<Long>> {
4242
override fun onResponse(
4343
call: Call<SingleResponseDto<Long>>,
@@ -56,8 +56,8 @@ class UserViewModel : ViewModel() {
5656
fun getAccessTokenFromGithubApi(code: String) {
5757
val githubAuthService = RetrofitClient.githubAuthService()
5858
val githubAuthCall = githubAuthService.getAccessTokenFromGithubApi(
59-
BuildConfig.GITHUB_CLIENT_ID,
60-
BuildConfig.GITHUB_CLIENT_SECRET,
59+
"",
60+
"",
6161
code
6262
)
6363
githubAuthCall.enqueue(object : retrofit2.Callback<Token> {
@@ -92,7 +92,7 @@ class UserViewModel : ViewModel() {
9292
fun signInUserInfo(user: User){
9393
val gfdSignInService = RetrofitClient.userService()
9494
val requestUserDto = GfdUser(user.login, user.html_url, user.avatar_url)
95-
val gfdSignInCall = gfdSignInService.signUpUser(BuildConfig.BASIC_AUTH_KEY, requestUserDto)
95+
val gfdSignInCall = gfdSignInService.signUpUser("", requestUserDto)
9696
gfdSignInCall.enqueue(object : retrofit2.Callback<SingleResponseDto<GfdUser>>{
9797
override fun onResponse(
9898
call: Call<SingleResponseDto<GfdUser>>,
@@ -112,7 +112,7 @@ class UserViewModel : ViewModel() {
112112
fun getCommitsRank() {
113113
val dataDate = LocalDate.now().toString()
114114
val getCommitsService = RetrofitClient.commitService()
115-
val getCommitCall = getCommitsService.getCommitList(BuildConfig.BASIC_AUTH_KEY, dataDate)
115+
val getCommitCall = getCommitsService.getCommitList("", dataDate)
116116
getCommitCall.enqueue(object : retrofit2.Callback<MultiResponseDto<CommitResponse>> {
117117
override fun onResponse(call: Call<MultiResponseDto<CommitResponse>>, response: Response<MultiResponseDto<CommitResponse>>) {
118118
_commitList.value = response.body()?.list
@@ -128,7 +128,7 @@ class UserViewModel : ViewModel() {
128128
// 금일 커밋 등록하기
129129
fun enrollCommit(commit: CommitRequestDto){
130130
val enrollCommitService = RetrofitClient.commitService()
131-
val enrollCommitCall = enrollCommitService.enrollCommit(BuildConfig.BASIC_AUTH_KEY, commit)
131+
val enrollCommitCall = enrollCommitService.enrollCommit("", commit)
132132
enrollCommitCall.enqueue(object : retrofit2.Callback<SingleResponseDto<Void>>{
133133
override fun onResponse(
134134
call: Call<SingleResponseDto<Void>>,

0 commit comments

Comments
 (0)