aboutsummaryrefslogtreecommitdiffstats
path: root/build.gradle.kts
blob: d08e6f63f3287859937b476d25f91b33a3f78a65 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// https://docs.gradle.org/current/userguide/building_java_projects.html
plugins {
  `java-library`
  // application
  id("org.springframework.boot") version "2.6.4"
  id("io.spring.dependency-management") version "1.0.11.RELEASE"
  id("java")
}

repositories {
  mavenCentral()
}

dependencies {
  // implementation("org.springframework.boot:spring-boot-starter-data-jdbc")
  implementation("org.springframework.boot:spring-boot-starter-web")
  // runtimeOnly("org.postgresql:postgresql")
  testImplementation("org.springframework.boot:spring-boot-starter-test")
}

// tasks.create("FatJar", Jar::class) {
//   description = "makes a fatjar"
//   group = "build"
//   manifest.attributes["Main-Class"] = "com.terminaldweller.MainApplication"
//   duplicatesStrategy = DuplicatesStrategy.EXCLUDE
//   val dependencies = configurations.runtimeClasspath.get().map(::zipTree)
//   from(dependencies)
//   with(tasks.jar.get())
// }

springBoot {
  mainClass.set("com.terminaldweller.MainApplication")
}

// application {
//   mainClass.set("com.terminaldweller.MainApplication")
// }

sourceSets {
  main {
    java {
      setSrcDirs(listOf("src"))
    }
  }

  test {
    java {
      setSrcDirs(listOf("test"))
    }
  }
}

java {
  toolchain {
    languageVersion.set(JavaLanguageVersion.of(11))
  }
}

tasks.compileJava {
  options.isIncremental = true
  options.isFork = true
  options.isFailOnError = false
  options.release.set(11)
}