Skip to content

Commit

Permalink
feature: merge v0
Browse files Browse the repository at this point in the history
> ### Feature: #3 CICD 구축을 위한 프로젝트 merge (#7)

* feature: setting issue template

* feature: setting pr template

* feature: setting .gitignore

* Feature: #2 프로젝트 초기 세팅 (#6)

* 🎉Initialize cafree server project

* setting: naver code convention 추가

* chore: 의존성 추가 및 Jacoco, codestyle(naver) 적용

* feature: Jpa, s3, Security 설정

* feature: s3 업로드 관련 uploader, dto 구현
  • Loading branch information
lcomment authored Jul 10, 2023
1 parent 0c31305 commit 454428c
Show file tree
Hide file tree
Showing 21 changed files with 1,315 additions and 0 deletions.
187 changes: 187 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.1.1'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
id 'checkstyle'
id 'jacoco'
}

group = 'net.cafree'
version = '1.0.0-SNAPSHOT'

java {
sourceCompatibility = '17'
}

test {
useJUnitPlatform()
finalizedBy jacocoTestReport

jacoco {
enabled = true
destinationFile = file("${buildDir}/jacoco/${name}.exec")
includes = []
excludes = []
excludeClassLoaders = []
includeNoLocationClasses = false
sessionId = "<auto-generated value>"
dumpOnExit = true
classDumpDir = null
output = JacocoTaskExtension.Output.FILE
address = "localhost"
port = 6300
jmx = false
}
}

configurations {
asciidoctorExtensions
compileOnly {
extendsFrom annotationProcessor
}
}

compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'


// checkstyle
tasks.withType(Checkstyle).configureEach {
reports {
xml.required = true
html.required = true
}
}

checkstyle {
configFile = file("config/checkstyle/naver-checkstyle-rules.xml")
configProperties = ["suppressionFile": "config/checkstyle/naver-checkstyle-suppressions.xml"]
sourceSets = [sourceSets.main]
}

checkstyleMain.source = fileTree('src/main/java')

// Rest Docs
ext {
set('snippetsDir', file("build/generated-snippets"))
}

asciidoctor {
dependsOn test
inputs.dir snippetsDir
configurations 'asciidoctorExtensions'
}

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

bootJar {
dependsOn asciidoctor
from("${asciidoctor.outputDir}/html5") {
into 'BOOT-INF/classes/static/docs'
}
}

tasks.register('copyDocument', Copy) {
dependsOn asciidoctor

from file("build/docs/asciidoc")
into file("src/main/resources/static/docs")
}

build {
dependsOn copyDocument
}

tasks.named('test') {
outputs.dir snippetsDir
}

// jacoco
jacoco {
toolVersion = "0.8.10"
}

jacocoTestReport {
dependsOn test
reports {
html.required = true
xml.required = false
csv.required = false

html.outputLocation = file("$buildDir/jacocoHtml")
}
finalizedBy 'jacocoTestCoverageVerification'
}

jacocoTestCoverageVerification {
violationRules {
rule {
enabled = true
element = "CLASS"

limit {
counter = "BRANCH"
value = "COVEREDRATIO"
minimum = 0.80
}

limit {
counter = "LINE"
value = "COVEREDRATIO"
minimum = 0.80
}

limit {
counter = "METHOD"
value = 'COVEREDRATIO'
minimum = 0.80
}

excludes = ['*.Application',
'net.cafree.global.**'
]
}
}
}

repositories {
mavenCentral()
}

dependencies {
// Basic
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
developmentOnly 'org.springframework.boot:spring-boot-devtools'

// Security
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'

// JWT
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
implementation 'io.jsonwebtoken:jjwt-impl:0.11.5'
implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5'

// Database
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'com.h2database:h2'
implementation 'org.mariadb.jdbc:mariadb-java-client:3.1.2'

// S3
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'

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

// Test
implementation 'junit:junit:4.13.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'io.findify:s3mock_2.13:0.2.6'
}
Loading

0 comments on commit 454428c

Please sign in to comment.