Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

25 changes: 16 additions & 9 deletions .github/workflows/maven.yml → .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Maven
name: Java CI with Gradle

on:
push:
Expand All @@ -19,17 +19,24 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
distribution: 'adopt'
java-version: '17'
cache: 'maven'
cache: 'gradle'

- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build --no-daemon

- name: Run Test Coverage
run: ./gradlew jacocoTestReport

- name: Generate JaCoCo Badge
uses: cicirello/jacoco-badge-generator@v2
with:
generate-branches-badge: true
jacoco-csv-file: build/reports/jacoco/test/jacocoTestReport.csv

- name: Commit the badge (if it changed)
run: |
Expand All @@ -42,7 +49,7 @@ jobs:
fi

- name: Upload JaCoCo coverage report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v2
with:
name: jacoco-report
path: target/site/jacoco/
path: build/reports/jacoco/test/html/
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
target/
.idea
*.iml

# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
<a href="https://boosty.to/andd3dfx"><img src="images/button_donate.png" alt="Donate" height="40"/></a>

## Prerequisites
- Maven 3
- JDK 17

## How to build
```shell
./gradlew clean build
```

## Packages list
- [annotation](src/main/java/by/andd3dfx/annotation)
- [cache](src/main/java/by/andd3dfx/cache)
Expand Down
67 changes: 67 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

plugins {
id 'java-library'
id 'jacoco'
}

repositories {
mavenLocal()
mavenCentral()
}

dependencies {
api 'org.springframework.boot:spring-boot-starter-logging:3.1.2'
api 'org.apache.commons:commons-lang3:3.13.0'
api 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
api 'org.reflections:reflections:0.10.2'
api 'org.projectlombok:lombok:1.18.28'
annotationProcessor('org.projectlombok:lombok:1.18.28')

testImplementation 'ch.qos.logback:logback-classic:1.4.9'
testImplementation 'com.github.stefanbirkner:system-rules:1.19.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.jmock:jmock-legacy:2.12.0'
testImplementation 'org.jmock:jmock-imposters:2.12.0'
testImplementation 'net.bytebuddy:byte-buddy:1.14.5'
testImplementation 'org.assertj:assertj-core:3.24.2'
testImplementation 'org.hamcrest:hamcrest-all:1.3'
testImplementation 'org.mockito:mockito-core:5.4.0'
testImplementation 'org.awaitility:awaitility:4.2.0'
testAnnotationProcessor('org.projectlombok:lombok:1.18.28')
}

group = 'by.andd3dfx'
version = '1.0-SNAPSHOT'
description = 'java-interview-coding'
java.sourceCompatibility = JavaVersion.VERSION_17

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}

test {
testLogging {
events "passed", "skipped", "failed",
// "standardOut", // Uncomment to get all logs during tests execution
"standardError"
}
finalizedBy jacocoTestReport // report is always generated after tests run
}

jacocoTestReport {
reports {
csv.required = true
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'**/config/**',
'**/domain/**',
])
}))
}
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading