build.gradle 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. plugins {
  2. id 'java'
  3. }
  4. group = 'com.veloe.ipfilter'
  5. version = '1.0-SNAPSHOT'
  6. repositories {
  7. mavenCentral()
  8. maven {
  9. name = 'papermc-repo'
  10. url = 'https://papermc.io/repo/repository/maven-public/'
  11. }
  12. maven {
  13. name = 'sonatype'
  14. url = 'https://oss.sonatype.org/content/groups/public/'
  15. }
  16. }
  17. dependencies {
  18. implementation 'com.squareup.okhttp3:okhttp:4.9.3'
  19. compileOnly 'io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT'
  20. }
  21. def targetJavaVersion = 17
  22. java {
  23. def javaVersion = JavaVersion.toVersion(targetJavaVersion)
  24. sourceCompatibility = javaVersion
  25. targetCompatibility = javaVersion
  26. if (JavaVersion.current() < javaVersion) {
  27. toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
  28. }
  29. }
  30. tasks.withType(JavaCompile).configureEach {
  31. if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
  32. options.release = targetJavaVersion
  33. }
  34. }
  35. processResources {
  36. def props = [version: version]
  37. inputs.properties props
  38. filteringCharset 'UTF-8'
  39. filesMatching('plugin.yml') {
  40. expand props
  41. }
  42. }
  43. jar {
  44. // Will include every single one of your dependencies, project or not
  45. from {
  46. configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
  47. }
  48. }