|
| 1 | +plugins { |
| 2 | + `java-library` |
| 3 | + `maven-publish` |
| 4 | + signing |
| 5 | +} |
| 6 | + |
| 7 | +/** |
| 8 | + * Extracted from the Netty project (commit hash: f235b37c281977b5428dacb32cc44072c9a441e5, version 4.1.76.Final-SNAPSHOT). |
| 9 | + * |
| 10 | + * The Netty project is licensed under the Apache License 2.0. |
| 11 | + * |
| 12 | + * commit f235b37c281977b5428dacb32cc44072c9a441e5 (HEAD -> 4.1, origin/HEAD, origin/4.1) |
| 13 | + * Author: Hiep Vo <[email protected]> |
| 14 | + * Date: Mon Mar 28 17:17:49 2022 +0700 |
| 15 | + * |
| 16 | + * Fix a typo (#12241) |
| 17 | + **/ |
| 18 | +group = "net.futureclient.netty-buffer" |
| 19 | +version = "1.0.0" |
| 20 | + |
| 21 | +java { |
| 22 | + toolchain { |
| 23 | + languageVersion = JavaLanguageVersion.of(17) |
| 24 | + } |
| 25 | + withSourcesJar() |
| 26 | +} |
| 27 | + |
| 28 | +sourceSets { |
| 29 | + main { |
| 30 | + tasks.getByName(compileJavaTaskName, closureOf<JavaCompile> { |
| 31 | + sourceCompatibility = "1.8" |
| 32 | + targetCompatibility = "1.8" |
| 33 | + }) |
| 34 | + } |
| 35 | +} |
| 36 | + |
| 37 | +repositories { |
| 38 | + mavenCentral() |
| 39 | +} |
| 40 | + |
| 41 | +dependencies { |
| 42 | + testImplementation("org.hamcrest:hamcrest:2.2") |
| 43 | + testImplementation("org.mockito:mockito-core:5.11.0") |
| 44 | +} |
| 45 | + |
| 46 | +testing { |
| 47 | + suites { |
| 48 | + @Suppress("UnstableApiUsage") val test by getting(JvmTestSuite::class) { |
| 49 | + useJUnitJupiter() |
| 50 | + } |
| 51 | + } |
| 52 | +} |
| 53 | + |
| 54 | +publishing { |
| 55 | + repositories { |
| 56 | + val publishName = System.getenv("MAVEN_PUBLISH_NAME") |
| 57 | + val publishToken = System.getenv("MAVEN_PUBLISH_TOKEN") |
| 58 | + if (publishName != null && publishToken != null) { |
| 59 | + maven { |
| 60 | + name = "future-private" |
| 61 | + url = uri("https://maven.futureclient.net/private") |
| 62 | + credentials { |
| 63 | + username = publishName |
| 64 | + password = publishToken |
| 65 | + } |
| 66 | + } |
| 67 | + } |
| 68 | + } |
| 69 | + publications { |
| 70 | + create<MavenPublication>("maven") { |
| 71 | + from(components["java"]) |
| 72 | + } |
| 73 | + } |
| 74 | +} |
| 75 | + |
| 76 | +signing { |
| 77 | + val signingKeyId = System.getenv("GPG_SIGNING_KEY_ID") |
| 78 | + val signingKey = System.getenv("GPG_SIGNING_KEY") |
| 79 | + val signingPassword = System.getenv("GPG_SIGNING_PASSWORD") |
| 80 | + if (signingKey != null) { |
| 81 | + useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) |
| 82 | + sign(publishing.publications["maven"]) |
| 83 | + } |
| 84 | +} |
0 commit comments