generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
gradlePluginPortal() | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
dependencyResolutionManagement { | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} | ||
|
||
rootProject.name = "build-conventions" |
104 changes: 104 additions & 0 deletions
104
build-conventions/src/main/kotlin/trimmed.java-conventions.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
plugins { | ||
`java-library` | ||
`maven-publish` | ||
`version-catalog` | ||
} | ||
|
||
configure<JavaPluginExtension> { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(21) | ||
} | ||
} | ||
|
||
ext { | ||
val parchmentVersion: String; | ||
if (!libs.versions.parchment.mc.get().equals(libs.versions.minecraft.release.get())) { | ||
parchmentVersion = "${libs.versions.parchment.mc.get()}-${libs.versions.parchment.release.get()}-${libs.versions.minecraft.release.get()}" | ||
} else { | ||
parchmentVersion = "${libs.versions.parchment.release.get()}-${libs.versions.minecraft.release.get()}" | ||
} | ||
} | ||
|
||
version = extra["mod_version"] | ||
|
||
tasks.jar { | ||
from(rootProject.file("LICENSE")) { | ||
rename { "${it}_${extra["mod_name"]}" } | ||
} | ||
manifest { | ||
attributes( | ||
"Specification-Title" to extra["mod_name"], | ||
"Specification-Vendor" to extra["mod_author"], | ||
"Specification-Version" to archiveVersion, | ||
"Implementation-Title" to project.name, | ||
"Implementation-Version" to archiveVersion, | ||
"Implementation-Vendor" to extra["mod_author"], | ||
// "Implementation-Timestamp" to new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), | ||
"Timestamp" to System.currentTimeMillis(), | ||
"Built-On-Java" to "${System.getProperty("java.vm.version")} (${System.getProperty("java.vm.vendor")})", | ||
"Built-On-Minecraft" to libs.versions.minecraft.release.get() | ||
) | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
|
||
maven { | ||
name = "Sponge / Mixin" | ||
url = uri("https://repo.spongepowered.org/repository/maven-public/") | ||
} | ||
|
||
maven { | ||
name = "BlameJared Maven (CrT / Bookshelf)" | ||
url = uri("https://maven.blamejared.com") | ||
} | ||
|
||
maven { | ||
url = uri("https://jm.gserv.me/repository/maven-public/") | ||
} | ||
|
||
maven { url = uri("https://jitpack.io/") } | ||
} | ||
|
||
dependencies { | ||
"compileOnly"(libs.jetbrains.annotations) | ||
} | ||
|
||
tasks.withType<JavaCompile>().configureEach { | ||
options.encoding = "UTF-8" | ||
options.release = 21 | ||
} | ||
|
||
// Disables Gradle"s custom module metadata from being published to maven. The | ||
// metadata includes mapped dependencies which are not reasonably consumable by | ||
// other mod developers. | ||
//tasks.withType<GenerateModuleMetadata>().configureEach { | ||
// enabled = false | ||
//} | ||
|
||
// publishing { | ||
// repositories { | ||
// maven { | ||
// name = "Local" | ||
// url = uri("file://" + findProperty("local_maven")) | ||
// } | ||
// maven { | ||
// name = "Maven" | ||
// url = uri(findProperty("mavenUrl")) | ||
//// credentials(PasswordCredentials) { | ||
//// username = findProperty("mavenUsername") | ||
//// password = findProperty("mavenPassword") | ||
//// } | ||
// } | ||
// maven { | ||
// name = "GitHubPackages" | ||
// url = uri("https://maven.pkg.github.com/dhyces/trimmed") | ||
//// credentials { | ||
//// username = project.findProperty("gpr.user") ?: System.getenv("USERNAME") | ||
//// password = project.findProperty("gpr.key") ?: System.getenv("TOKEN") | ||
//// } | ||
// } | ||
// } | ||
// } |