diff options
| author | 2024-01-08 19:15:36 +0100 | |
|---|---|---|
| committer | 2024-01-08 19:15:36 +0100 | |
| commit | ffced7f576270c8db8e910677b02576530cc983d (patch) | |
| tree | 8aa5c57931d69ce51f6155a68904faeff92fe95a | |
| parent | Made gradle publish work (diff) | |
| download | mc-eris-alchemy-ffced7f576270c8db8e910677b02576530cc983d.tar.gz mc-eris-alchemy-ffced7f576270c8db8e910677b02576530cc983d.tar.xz mc-eris-alchemy-ffced7f576270c8db8e910677b02576530cc983d.zip | |
Reorganised build gradle a bit
| -rw-r--r-- | build.gradle.kts | 71 |
1 files changed, 36 insertions, 35 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index b4bd891..3c5b89e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts | |||
| @@ -13,13 +13,13 @@ val patchouliVersion: String by project | |||
| 13 | val quiltMappings: String by project | 13 | val quiltMappings: String by project |
| 14 | val quiltedFabricApiVersion: String by project | 14 | val quiltedFabricApiVersion: String by project |
| 15 | 15 | ||
| 16 | group = groupid | ||
| 17 | version = "${modVersion}+${minecraftVersion}" | ||
| 18 | |||
| 16 | base { | 19 | base { |
| 17 | archivesName = modid | 20 | archivesName = modid |
| 18 | } | 21 | } |
| 19 | 22 | ||
| 20 | group = groupid | ||
| 21 | version = "${modVersion}+${minecraftVersion}" | ||
| 22 | |||
| 23 | repositories { | 23 | repositories { |
| 24 | maven { | 24 | maven { |
| 25 | url = uri("https://maven.blamejared.com") | 25 | url = uri("https://maven.blamejared.com") |
| @@ -53,6 +53,34 @@ dependencies { | |||
| 53 | compileOnly("jakarta.annotation:jakarta.annotation-api:${jakartaAnnotationVersion}") | 53 | compileOnly("jakarta.annotation:jakarta.annotation-api:${jakartaAnnotationVersion}") |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | java { | ||
| 57 | toolchain { | ||
| 58 | languageVersion.set(JavaLanguageVersion.of(17)) | ||
| 59 | } | ||
| 60 | |||
| 61 | withJavadocJar() | ||
| 62 | withSourcesJar() | ||
| 63 | } | ||
| 64 | |||
| 65 | publishing { | ||
| 66 | publications { | ||
| 67 | create<MavenPublication>("maven") { | ||
| 68 | artifactId = modid | ||
| 69 | from(components["java"]) | ||
| 70 | } | ||
| 71 | } | ||
| 72 | |||
| 73 | repositories { | ||
| 74 | maven { | ||
| 75 | url = uri("https://mvn.enes.lv/") | ||
| 76 | credentials { | ||
| 77 | username = (findProperty("mvnUsername") ?: System.getenv("MVN_USERNAME")).toString() | ||
| 78 | password = (findProperty("mvnPassword") ?: System.getenv("MVN_PASSWORD")).toString() | ||
| 79 | } | ||
| 80 | } | ||
| 81 | } | ||
| 82 | } | ||
| 83 | |||
| 56 | tasks.processResources { | 84 | tasks.processResources { |
| 57 | inputs.property("loader_version", loaderVersion) | 85 | inputs.property("loader_version", loaderVersion) |
| 58 | inputs.property("minecraft_version", minecraftVersion) | 86 | inputs.property("minecraft_version", minecraftVersion) |
| @@ -62,11 +90,11 @@ tasks.processResources { | |||
| 62 | 90 | ||
| 63 | filesMatching("quilt.mod.json") { | 91 | filesMatching("quilt.mod.json") { |
| 64 | expand( | 92 | expand( |
| 65 | "loader_version" to loaderVersion, | 93 | "loader_version" to loaderVersion, |
| 66 | "minecraft_version" to minecraftVersion, | 94 | "minecraft_version" to minecraftVersion, |
| 67 | "patchouli_version" to patchouliVersion, | 95 | "patchouli_version" to patchouliVersion, |
| 68 | "quilted_fabric_api_version" to quiltedFabricApiVersion, | 96 | "quilted_fabric_api_version" to quiltedFabricApiVersion, |
| 69 | "version" to version | 97 | "version" to version |
| 70 | ) | 98 | ) |
| 71 | } | 99 | } |
| 72 | } | 100 | } |
| @@ -76,14 +104,6 @@ tasks.withType<JavaCompile>().configureEach { | |||
| 76 | options.release = 17 | 104 | options.release = 17 |
| 77 | } | 105 | } |
| 78 | 106 | ||
| 79 | java { | ||
| 80 | sourceCompatibility = JavaVersion.VERSION_17 | ||
| 81 | targetCompatibility = JavaVersion.VERSION_17 | ||
| 82 | |||
| 83 | withJavadocJar() | ||
| 84 | withSourcesJar() | ||
| 85 | } | ||
| 86 | |||
| 87 | tasks.javadoc { | 107 | tasks.javadoc { |
| 88 | (options as StandardJavadocDocletOptions).addBooleanOption("html5", true) | 108 | (options as StandardJavadocDocletOptions).addBooleanOption("html5", true) |
| 89 | } | 109 | } |
| @@ -93,22 +113,3 @@ tasks.jar { | |||
| 93 | rename { "${it}_${base.archivesName.get()}" } | 113 | rename { "${it}_${base.archivesName.get()}" } |
| 94 | } | 114 | } |
| 95 | } | 115 | } |
| 96 | |||
| 97 | publishing { | ||
| 98 | publications { | ||
| 99 | create<MavenPublication>("maven") { | ||
| 100 | artifactId = modid | ||
| 101 | from(components["java"]) | ||
| 102 | } | ||
| 103 | } | ||
| 104 | |||
| 105 | repositories { | ||
| 106 | maven { | ||
| 107 | url = uri("https://mvn.enes.lv/") | ||
| 108 | credentials { | ||
| 109 | username = (findProperty("mvnUsername") ?: System.getenv("MVN_USERNAME")).toString() | ||
| 110 | password = (findProperty("mvnPassword") ?: System.getenv("MVN_PASSWORD")).toString() | ||
| 111 | } | ||
| 112 | } | ||
| 113 | } | ||
| 114 | } | ||