build.gradle 668 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. plugins {
  2. id 'application'
  3. }
  4. version = '1.0.0'
  5. sourceSets {
  6. main {
  7. java.srcDirs = ['src']
  8. resources.srcDirs = ['resources']
  9. }
  10. }
  11. java {
  12. toolchain {
  13. languageVersion = JavaLanguageVersion.of(21)
  14. }
  15. }
  16. application {
  17. mainClass = 'battleship.Entrypoint'
  18. }
  19. task fatJar(type: Jar) {
  20. from {
  21. configurations.runtimeClasspath.collect {
  22. it.isDirectory() ? it : zipTree(it)
  23. }
  24. }
  25. manifest {
  26. attributes('Main-Class': application.mainClass)
  27. }
  28. duplicatesStrategy = DuplicatesStrategy.EXCLUDE
  29. archiveBaseName = project.name
  30. archiveVersion = project.version
  31. with jar
  32. }