Skip to content

Commit

Permalink
Revert "chore: add ktlint (+ git hooks in gradle) (#17)"
Browse files Browse the repository at this point in the history
This reverts commit a1b82b6.
  • Loading branch information
junha-ahn authored Jul 9, 2023
1 parent a1b82b6 commit 547b93b
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 99 deletions.
12 changes: 0 additions & 12 deletions .editconfig

This file was deleted.

31 changes: 0 additions & 31 deletions .github/hooks/pre-commit

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Gradlew build-test-ktlint
name: Java CI

on: [push]
on:
pull_request:
push:
branches: [main]

jobs:
build:
Expand All @@ -13,16 +16,12 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3

- name: Build And Test with Gradle
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629
with:
arguments: build -x ktlintMainSourceSetCheck -x ktlintTestSourceSetCheck -x ktlintKotlinScriptCheck

- name: Ktlint check
- name: add execute permission
run: |
chmod +x ./gradlew
- name: Build with Gradle
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629
with:
arguments: ktlintCheck
arguments: build
64 changes: 25 additions & 39 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,66 +1,52 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.springframework.boot") version "3.1.0"
id("io.spring.dependency-management") version "1.1.0"
kotlin("jvm") version "1.8.21"
kotlin("plugin.spring") version "1.8.21"
kotlin("plugin.jpa") version "1.8.21"
kotlin("plugin.allopen") version "1.6.21"
kotlin("plugin.noarg") version "1.6.21"
id("org.jlleitschuh.gradle.ktlint") version "11.5.0"
id("org.springframework.boot") version "3.1.0"
id("io.spring.dependency-management") version "1.1.0"
kotlin("jvm") version "1.8.21"
kotlin("plugin.spring") version "1.8.21"
kotlin("plugin.jpa") version "1.8.21"
kotlin("plugin.allopen") version "1.6.21"
kotlin("plugin.noarg") version "1.6.21"
}

group = "com.example"
version = "0.0.1-SNAPSHOT"

java {
sourceCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17
}

repositories {
mavenCentral()
mavenCentral()
}

dependencies {
// implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
developmentOnly("org.springframework.boot:spring-boot-devtools")
// runtimeOnly("com.mysql:mysql-connector-j")
testImplementation("org.springframework.boot:spring-boot-starter-test")
// implementation("org.modelmapper:modelmapper:2.4.2")
// implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
developmentOnly("org.springframework.boot:spring-boot-devtools")
// runtimeOnly("com.mysql:mysql-connector-j")
testImplementation("org.springframework.boot:spring-boot-starter-test")
// implementation("org.modelmapper:modelmapper:2.4.2")
}

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "17"
}
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "17"
}
}

tasks.withType<Test> {
useJUnitPlatform()
useJUnitPlatform()
}

allOpen {
annotation("javax.persistence.Entity")
annotation("javax.persistence.Entity")
}

noArg {
annotation("javax.persistence.Entity")
}

val installLocalGitHook = tasks.register<Copy>("installLocalGitHook") {
from("${rootProject.rootDir}/scripts/git-hooks")
into(File("${rootProject.rootDir}/.git/hooks"))

eachFile {
mode = "755".toInt(radix = 8)
}
}

tasks.build {
dependsOn(installLocalGitHook)
}
annotation("javax.persistence.Entity")
}
Empty file modified gradlew
100755 → 100644
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ import org.springframework.boot.runApplication
class TicketingserviceApplication

fun main(args: Array<String>) {
runApplication<TicketingserviceApplication>(*args)
runApplication<TicketingserviceApplication>(*args)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import org.springframework.web.bind.annotation.RestController
@RestController
class TestController {
@GetMapping("/")
fun index(): String {
fun index(): String{
println("Hello, World!")
return "Hello, World!"
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import org.springframework.boot.test.context.SpringBootTest
@SpringBootTest
class TicketingserviceApplicationTests {

@Test
fun contextLoads() {
}
@Test
fun contextLoads() {
}

}

0 comments on commit 547b93b

Please sign in to comment.