Skip to content

Commit

Permalink
fix: init project settings
Browse files Browse the repository at this point in the history
  • Loading branch information
msnodeve committed Nov 30, 2020
1 parent 9b84665 commit 9e3b0ec
Show file tree
Hide file tree
Showing 29 changed files with 218 additions and 147 deletions.
6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 5 additions & 32 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'

// https://www.androidhuman.com/lecture/quality/2016/02/13/jacoco_unit_test_android/
// https://jojoldu.tistory.com/275
// https://medium.com/@android2ee/playing-with-gradle-3-and-some-few-code-coverage-on-android-with-jacoco-47df7c9328ae
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'jacoco-android'
// https://blog.yena.io/studynote/2018/09/08/Android-Kotlin-Room.html
// https://kotlinlang.org/docs/reference/using-gradle.html

Expand All @@ -27,25 +21,9 @@ android {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
testCoverageEnabled false
buildConfigField "String", "GITHUB_OAUTH_URL", GITHUB_OAUTH_URL
buildConfigField "String", "GITHUB_CLIENT_ID", GITHUB_CLIENT_ID
buildConfigField "String", "GITHUB_CLIENT_SECRET", GITHUB_CLIENT_SECRET
buildConfigField "String", "REDIRECT_CALLBACK_URL", REDIRECT_CALLBACK_URL
buildConfigField "String", "PREFERENCES_FILE", PREFERENCES_FILE
buildConfigField "String", "PREFERENCES_TOKEN_KEY", PREFERENCES_TOKEN_KEY
buildConfigField "String", "BASIC_AUTH_KEY", BASIC_AUTH_KEY
buildConfigField "String", "GFD_API_URL", GFD_API_URL
}
debug {
testCoverageEnabled true
buildConfigField "String", "GITHUB_OAUTH_URL", GITHUB_OAUTH_URL
buildConfigField "String", "GITHUB_CLIENT_ID", GITHUB_CLIENT_ID
buildConfigField "String", "GITHUB_CLIENT_SECRET", GITHUB_CLIENT_SECRET
buildConfigField "String", "REDIRECT_CALLBACK_URL", REDIRECT_CALLBACK_URL
buildConfigField "String", "PREFERENCES_FILE", PREFERENCES_FILE
buildConfigField "String", "PREFERENCES_TOKEN_KEY", PREFERENCES_TOKEN_KEY
buildConfigField "String", "BASIC_AUTH_KEY", BASIC_AUTH_KEY
buildConfigField "String", "GFD_API_URL", GFD_API_URL
}
}
compileOptions {
Expand All @@ -61,22 +39,17 @@ android {
lintOptions {
abortOnError false
}
}

coveralls {
jacocoReportPath 'build/reports/jacoco/jacocoTestDebugUnitTestReport/jacocoTestDebugUnitTestReport.xml'
}
jacocoAndroidUnitTestReport {
excludes += ['**/views/**']
buildToolsVersion '28.0.3'
ndkVersion '20.1.5948944'
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.android.support:design:28.0.0'
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation "androidx.recyclerview:recyclerview:1.1.0"

// test implementation
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
Expand Down
153 changes: 153 additions & 0 deletions app/build2.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
//noinspection LifecycleAnnotationProcessorWithJava8
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'

// https://www.androidhuman.com/lecture/quality/2016/02/13/jacoco_unit_test_android/
// https://jojoldu.tistory.com/275
// https://medium.com/@android2ee/playing-with-gradle-3-and-some-few-code-coverage-on-android-with-jacoco-47df7c9328ae
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'jacoco-android'
// https://blog.yena.io/studynote/2018/09/08/Android-Kotlin-Room.html
// https://kotlinlang.org/docs/reference/using-gradle.html

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.seok.gfd"
minSdkVersion 26
targetSdkVersion 28
versionCode 10
versionName "3.20.12"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
testCoverageEnabled false
buildConfigField "String", "GITHUB_OAUTH_URL", GITHUB_OAUTH_URL
buildConfigField "String", "GITHUB_CLIENT_ID", GITHUB_CLIENT_ID
buildConfigField "String", "GITHUB_CLIENT_SECRET", GITHUB_CLIENT_SECRET
buildConfigField "String", "REDIRECT_CALLBACK_URL", REDIRECT_CALLBACK_URL
buildConfigField "String", "PREFERENCES_FILE", PREFERENCES_FILE
buildConfigField "String", "PREFERENCES_TOKEN_KEY", PREFERENCES_TOKEN_KEY
buildConfigField "String", "BASIC_AUTH_KEY", BASIC_AUTH_KEY
buildConfigField "String", "GFD_API_URL", GFD_API_URL
}
debug {
testCoverageEnabled true
buildConfigField "String", "GITHUB_OAUTH_URL", GITHUB_OAUTH_URL
buildConfigField "String", "GITHUB_CLIENT_ID", GITHUB_CLIENT_ID
buildConfigField "String", "GITHUB_CLIENT_SECRET", GITHUB_CLIENT_SECRET
buildConfigField "String", "REDIRECT_CALLBACK_URL", REDIRECT_CALLBACK_URL
buildConfigField "String", "PREFERENCES_FILE", PREFERENCES_FILE
buildConfigField "String", "PREFERENCES_TOKEN_KEY", PREFERENCES_TOKEN_KEY
buildConfigField "String", "BASIC_AUTH_KEY", BASIC_AUTH_KEY
buildConfigField "String", "GFD_API_URL", GFD_API_URL
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
testOptions {
unitTests {
includeAndroidResources = true
returnDefaultValues = true
}
}
lintOptions {
abortOnError false
}
}

coveralls {
jacocoReportPath 'build/reports/jacoco/jacocoTestDebugUnitTestReport/jacocoTestDebugUnitTestReport.xml'
}
jacocoAndroidUnitTestReport {
excludes += ['**/views/**']
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation "androidx.recyclerview:recyclerview:1.0.0"

// test implementation
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:4.3'
testImplementation 'org.powermock:powermock-api-mockito:1.4.12'
testImplementation 'org.powermock:powermock-module-junit4:1.6.2'
testImplementation 'org.mockito:mockito-core:2.28.2'
testImplementation 'androidx.arch.core:core-testing:2.1.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test:core:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'

// Google Ads
implementation 'com.google.android.gms:play-services-ads:18.2.0'

// OkHttp && logger
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.2'

// Retrofit2
implementation 'com.squareup.retrofit2:retrofit:2.6.1'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.google.code.gson:gson:2.8.5'

// room
implementation 'androidx.room:room-runtime:2.2.0'
kapt 'androidx.room:room-compiler:2.2.0'
kaptTest 'androidx.room:room-testing:2.2.0'

// Lifecycle components
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
implementation 'android.arch.lifecycle:viewmodel:1.1.1'
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.1.0'

// Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutine_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutine_version"

// Using the Glide Library for Image loading
implementation 'com.github.bumptech.glide:glide:4.9.0'
kapt 'com.github.bumptech.glide:compiler:4.9.0'

// jsoup, anko
implementation 'org.jsoup:jsoup:1.11.3'
implementation "org.jetbrains.anko:anko:$rootProject.anko_version"
implementation 'androidx.gridlayout:gridlayout:1.0.0'

// lombok
compileOnly 'org.projectlombok:lombok:1.18.8'
annotationProcessor 'org.projectlombok:lombok:1.18.8'

// ProgressBar
implementation 'com.wang.avi:library:2.1.3'

// NavigationBar
implementation 'androidx.navigation:navigation-fragment-ktx:2.1.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.1.0'

// UI Scale
implementation 'com.ssomai:android.scalablelayout:2.1.6'

// Tab Layout
implementation 'com.ogaclejapan.smarttablayout:library:2.0.0@aar'
implementation 'com.ogaclejapan.smarttablayout:utils-v4:2.0.0@aar'
}
4 changes: 2 additions & 2 deletions app/src/main/java/com/seok/gfd/retrofit/RetrofitClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ class RetrofitClient {
fun userService() : UserService{
val gson = GsonBuilder().setLenient().create()
retrofit = Retrofit.Builder()
.baseUrl(BuildConfig.GFD_API_URL)
.baseUrl("")
.addConverterFactory(GsonConverterFactory.create(gson))
.build()
return retrofit.create(UserService::class.java)
}
fun commitService() : CommitService{
val gson = GsonBuilder().setLenient().create()
retrofit = Retrofit.Builder()
.baseUrl(BuildConfig.GFD_API_URL)
.baseUrl("")
.addConverterFactory(GsonConverterFactory.create(gson))
.build()
return retrofit.create(CommitService::class.java)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/seok/gfd/utils/SharedPreference.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.seok.gfd.retrofit.domain.User

class SharedPreference(private val application: Application) {
private val pref = application.getSharedPreferences(
BuildConfig.PREFERENCES_FILE,
"",
AppCompatActivity.MODE_PRIVATE
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class RankFragmentViewModel(application: Application) : AndroidViewModel(applica

val getTodayRankListService = RetrofitClient.commitService()
val getTodayRankListCall = getTodayRankListService.getTRCommitList(
BuildConfig.BASIC_AUTH_KEY,
"",
dateFormat.format(Date())
)
getTodayRankListCall.enqueue(object : Callback<List<CommitResponse>> {
Expand All @@ -58,7 +58,7 @@ class RankFragmentViewModel(application: Application) : AndroidViewModel(applica
fun updateTodayRankCommit(userId: String, dataCount: Int) {
val updateTodayRankCommitService = RetrofitClient.commitService()
val updateTodayRankCommitCall = updateTodayRankCommitService.enrollCommit(
BuildConfig.BASIC_AUTH_KEY,
"",
CommitRequestDto(userId, dataCount)
)
// updateTodayRankCommitCall.enqueue(object : Callback<String> {
Expand All @@ -77,7 +77,7 @@ class RankFragmentViewModel(application: Application) : AndroidViewModel(applica
val dateFormat = SimpleDateFormat("yyyy-MM-dd")
val getTodayRankListService = RetrofitClient.commitService()
val getTodayRankListCall = getTodayRankListService.getTRCommitList(
BuildConfig.BASIC_AUTH_KEY,
"",
dateFormat.format(Date()))
getTodayRankListCall.enqueue(object : Callback<List<CommitResponse>>{
override fun onResponse(
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/java/com/seok/gfd/viewmodel/UserViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class UserViewModel : ViewModel() {
// User 인원 수 가져오기
fun getUsersCount() {
val userService = RetrofitClient.userService()
val userCall = userService.getUsersCount(BuildConfig.BASIC_AUTH_KEY)
val userCall = userService.getUsersCount("")
userCall.enqueue(object : retrofit2.Callback<SingleResponseDto<Long>> {
override fun onResponse(
call: Call<SingleResponseDto<Long>>,
Expand All @@ -56,8 +56,8 @@ class UserViewModel : ViewModel() {
fun getAccessTokenFromGithubApi(code: String) {
val githubAuthService = RetrofitClient.githubAuthService()
val githubAuthCall = githubAuthService.getAccessTokenFromGithubApi(
BuildConfig.GITHUB_CLIENT_ID,
BuildConfig.GITHUB_CLIENT_SECRET,
"",
"",
code
)
githubAuthCall.enqueue(object : retrofit2.Callback<Token> {
Expand Down Expand Up @@ -92,7 +92,7 @@ class UserViewModel : ViewModel() {
fun signInUserInfo(user: User){
val gfdSignInService = RetrofitClient.userService()
val requestUserDto = GfdUser(user.login, user.html_url, user.avatar_url)
val gfdSignInCall = gfdSignInService.signUpUser(BuildConfig.BASIC_AUTH_KEY, requestUserDto)
val gfdSignInCall = gfdSignInService.signUpUser("", requestUserDto)
gfdSignInCall.enqueue(object : retrofit2.Callback<SingleResponseDto<GfdUser>>{
override fun onResponse(
call: Call<SingleResponseDto<GfdUser>>,
Expand All @@ -112,7 +112,7 @@ class UserViewModel : ViewModel() {
fun getCommitsRank() {
val dataDate = LocalDate.now().toString()
val getCommitsService = RetrofitClient.commitService()
val getCommitCall = getCommitsService.getCommitList(BuildConfig.BASIC_AUTH_KEY, dataDate)
val getCommitCall = getCommitsService.getCommitList("", dataDate)
getCommitCall.enqueue(object : retrofit2.Callback<MultiResponseDto<CommitResponse>> {
override fun onResponse(call: Call<MultiResponseDto<CommitResponse>>, response: Response<MultiResponseDto<CommitResponse>>) {
_commitList.value = response.body()?.list
Expand All @@ -128,7 +128,7 @@ class UserViewModel : ViewModel() {
// 금일 커밋 등록하기
fun enrollCommit(commit: CommitRequestDto){
val enrollCommitService = RetrofitClient.commitService()
val enrollCommitCall = enrollCommitService.enrollCommit(BuildConfig.BASIC_AUTH_KEY, commit)
val enrollCommitCall = enrollCommitService.enrollCommit("", commit)
enrollCommitCall.enqueue(object : retrofit2.Callback<SingleResponseDto<Void>>{
override fun onResponse(
call: Call<SingleResponseDto<Void>>,
Expand Down
Loading

0 comments on commit 9e3b0ec

Please sign in to comment.