Skip to content

Commit

Permalink
Jacoco, RestDocs 설정 수정 (#182)
Browse files Browse the repository at this point in the history
* chore: Jacoco 버전 명시

* chore: Jacoco exclude 설정 추가

* chore: asciidoctor Task 실행시 html 파일 생성하도록 설정

* docs: snippets 설정을 절대경로에 맞게 변경

* docs: API index 문서를 가독성 좋게 수정
  • Loading branch information
cse0518 authored Mar 18, 2022
1 parent c962714 commit 8f85c56
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 34 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ out/
### Gradle ###
.gradle
build/

### RestDocs ###
src/main/resources/static/docs/**
28 changes: 25 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,27 +90,46 @@ compileQuerydsl {
// QueryDsl 설정 끝

test {
outputs.dir snippetsDir
useJUnitPlatform()
finalizedBy 'jacocoTestReport'
}

asciidoctor {
dependsOn test
inputs.dir snippetsDir
finalizedBy 'copyDocument'
}

asciidoctor.doFirst {
delete file('src/main/resources/static/docs')
}

task copyDocument(type: Copy) {
dependsOn asciidoctor
dependsOn('asciidoctor')
from file("build/docs/asciidoc")
into file("src/main/resources/static/docs")
}

jacoco {
toolVersion = '0.8.7'
}

jacocoTestReport {
reports {
html.enabled true
xml.enabled false
csv.enabled false
}

afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it,
exclude: [
"**/SurfApplication*",
"**/S3ServiceImpl*"
])
}))
}
finalizedBy 'jacocoTestCoverageVerification'
}

Expand All @@ -126,7 +145,10 @@ jacocoTestCoverageVerification {
minimum = 0.80
}

excludes = []
excludes = [
'**.SurfApplication*',
'**.S3ServiceImpl*'
]
}
}
}
10 changes: 7 additions & 3 deletions src/docs/asciidoc/category.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
:toc: left
:toclevels: 2
:sectlinks:
ifndef::snippets[]
:snippets: ./build/generated-snippets
endif::[]
:doctype: book
:icons: font
:source-highlighter: highlightjs
:toc: left
:toclevels: 4
:sectlinks:

== Category (카테고리)

Expand Down
10 changes: 7 additions & 3 deletions src/docs/asciidoc/follow.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
:toc: left
:toclevels: 2
:sectlinks:
ifndef::snippets[]
:snippets: ./build/generated-snippets
endif::[]
:doctype: book
:icons: font
:source-highlighter: highlightjs
:toc: left
:toclevels: 4
:sectlinks:

== Follow (팔로우)

Expand Down
65 changes: 49 additions & 16 deletions src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
@@ -1,16 +1,49 @@
ifndef::snippets[]
:snippets: ../../../build/generated-snippets
endif::[]
:doctype: book
:icons: font
:source-highlighter: highlightjs
:toc: left
:toclevels: 4

== Surf API

include::user.adoc[]
include::category.adoc[]
include::post.adoc[]
include::follow.adoc[]
include::like.adoc[]
== Surf Application [API 문서]

=== link:user.html[유저 API]

회원 가입
로그인
유저 정보 조회
유저 정보 수정_프로필 이미지 첨부 O
유저 정보 수정_프로필 이미지 첨부 X
유저 삭제

=== link:category.html[카테고리 API]

카테고리 생성
나의 카테고리 전체 조회
해당 유저의 카테고리 정보 조회
나의 카테고리 정보 수정
나의 카테고리 삭제

=== link:post.html[게시글 API]

게시글 생성_파일 첨부 O
게시글 생성_파일 첨부 X
해당 게시글 정보 조회
나의 게시글 정보 수정_파일 첨부 O
나의 게시글 정보 수정_파일 첨부 X
나의 카테고리 삭제
즐겨찾기 추가
즐겨찾기 삭제
내 한달 게시글 정보 조회
해당 카테고리의 최신 게시글 점수 조회
해당 유저의 일년치 게시글 개수 조회
해당 유저의 카테고리별 게시글 점수 조회
전체 최신 게시글 둘러보기
내가 팔로잉한 유저들의 전체 게시글 둘러보기
해당 유저의 모든 게시글 정보 조회
해당 카테고리의 모든 게시글 정보 조회

=== link:follow.html[팔로우 API]

팔로우
언팔로우
해당 유저의 팔로워 정보 전체 조회
해당 유저가 팔로잉한 유저 정보 전체 조회

=== link:like.html[좋아요 API]

좋아요
좋아요 취소
10 changes: 7 additions & 3 deletions src/docs/asciidoc/like.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
:toc: left
:toclevels: 2
:sectlinks:
ifndef::snippets[]
:snippets: ./build/generated-snippets
endif::[]
:doctype: book
:icons: font
:source-highlighter: highlightjs
:toc: left
:toclevels: 4
:sectlinks:

== Like (좋아요)

Expand Down
10 changes: 7 additions & 3 deletions src/docs/asciidoc/post.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
:toc: left
:toclevels: 2
:sectlinks:
ifndef::snippets[]
:snippets: ./build/generated-snippets
endif::[]
:doctype: book
:icons: font
:source-highlighter: highlightjs
:toc: left
:toclevels: 4
:sectlinks:

== Post (게시글)

Expand Down
10 changes: 7 additions & 3 deletions src/docs/asciidoc/user.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
:toc: left
:toclevels: 2
:sectlinks:
ifndef::snippets[]
:snippets: ./build/generated-snippets
endif::[]
:doctype: book
:icons: font
:source-highlighter: highlightjs
:toc: left
:toclevels: 4
:sectlinks:

== User (유저)

Expand Down

0 comments on commit 8f85c56

Please sign in to comment.