|
| 1 | +plugins { |
| 2 | + `java-library` |
| 3 | + `maven-publish` |
| 4 | + alias(libs.plugins.shadow) |
| 5 | + alias(libs.plugins.lombok) |
| 6 | +} |
| 7 | + |
| 8 | +group = "net.azisaba" |
| 9 | +version = "4.5.1" |
| 10 | +description = "RyuZUPluginChat" |
| 11 | +java.sourceCompatibility = JavaVersion.VERSION_1_8 |
| 12 | + |
| 13 | +val orgName: String by project |
| 14 | +val repoUrl: String by project |
| 15 | + |
| 16 | +repositories { |
| 17 | + mavenCentral() |
| 18 | + maven("https://oss.sonatype.org/content/groups/public/") |
| 19 | + maven("https://repo.azisaba.net/repository/maven-public/") |
| 20 | + maven("https://papermc.io/repo/repository/maven-snapshots/") |
| 21 | + maven("https://papermc.io/repo/repository/maven-public/") |
| 22 | + maven("https://repo.aikar.co/content/groups/aikar/") |
| 23 | + maven("https://repo.maven.apache.org/maven2/") |
| 24 | +} |
| 25 | + |
| 26 | +dependencies { |
| 27 | + implementation(libs.discord4j) |
| 28 | + implementation(libs.jedis) |
| 29 | + implementation(libs.aikar.taskchain) |
| 30 | + implementation(libs.semver4j) |
| 31 | + compileOnly(libs.paper.api) |
| 32 | + compileOnly(libs.luckperms.api) |
| 33 | + compileOnly(libs.lunachatplus) |
| 34 | + compileOnly(libs.jetbrains.annotation) |
| 35 | + |
| 36 | + // Test dependencies |
| 37 | + testImplementation(platform(libs.junit.bom)) |
| 38 | + testImplementation(libs.junit.jupiter) |
| 39 | + testRuntimeOnly(libs.junit.platform.launcher) |
| 40 | + testCompileOnly(libs.jetbrains.annotation) |
| 41 | +} |
| 42 | + |
| 43 | +tasks.withType<JavaCompile> { |
| 44 | + options.encoding = "UTF-8" |
| 45 | +} |
| 46 | + |
| 47 | +tasks.withType<Javadoc> { |
| 48 | + options.encoding = "UTF-8" |
| 49 | +} |
| 50 | + |
| 51 | +tasks.processResources { |
| 52 | + val props = |
| 53 | + mapOf( |
| 54 | + "name" to name, |
| 55 | + "version" to version, |
| 56 | + "description" to description, |
| 57 | + "orgName" to orgName, |
| 58 | + "url" to repoUrl, |
| 59 | + ) |
| 60 | + inputs.properties(props) |
| 61 | + filteringCharset = "UTF-8" |
| 62 | + filesMatching("plugin.yml") { |
| 63 | + expand(props) |
| 64 | + } |
| 65 | +} |
| 66 | + |
| 67 | +tasks.build { |
| 68 | + dependsOn(tasks.shadowJar) |
| 69 | +} |
| 70 | + |
| 71 | +tasks.shadowJar { |
| 72 | + isEnableRelocation = true |
| 73 | + relocationPrefix = "net.azisaba.ryuzupluginchat.dependency" |
| 74 | +} |
| 75 | + |
| 76 | +lombok { |
| 77 | + version = libs.versions.lombok.asProvider() |
| 78 | +} |
| 79 | + |
| 80 | +tasks.test { |
| 81 | + useJUnitPlatform() |
| 82 | +} |
| 83 | + |
| 84 | +publishing { |
| 85 | + publications { |
| 86 | + create<MavenPublication>("maven") { |
| 87 | + groupId = project.group.toString() |
| 88 | + artifactId = project.name |
| 89 | + version = project.version.toString() |
| 90 | + artifact(tasks.jar) |
| 91 | + } |
| 92 | + } |
| 93 | + |
| 94 | + repositories { |
| 95 | + maven { |
| 96 | + name = "azisaba-repo" |
| 97 | + credentials { |
| 98 | + username = System.getenv("REPO_USERNAME") |
| 99 | + password = System.getenv("REPO_PASSWORD") |
| 100 | + } |
| 101 | + url = |
| 102 | + if (project.version.toString().endsWith("-SNAPSHOT")) { |
| 103 | + uri("https://repo.azisaba.net/repository/maven-snapshots/") |
| 104 | + } else { |
| 105 | + uri("https://repo.azisaba.net/repository/maven-releases/") |
| 106 | + } |
| 107 | + } |
| 108 | + } |
| 109 | +} |
0 commit comments