-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
1 parent
067b604
commit 52c0bc3
Showing
1,023 changed files
with
801 additions
and
1,151 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,152 @@ | ||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar | ||
import dev.architectury.plugin.ArchitectPluginExtension | ||
import groovy.json.StringEscapeUtils | ||
import net.fabricmc.loom.api.LoomGradleExtensionAPI | ||
import net.fabricmc.loom.task.RemapJarTask | ||
|
||
plugins { | ||
java | ||
id("maven-publish") | ||
id("com.teamresourceful.resourcefulgradle") version "0.0.+" | ||
id("dev.architectury.loom") version "1.2-SNAPSHOT" apply false | ||
id("architectury-plugin") version "3.4-SNAPSHOT" | ||
id("com.github.johnrengelman.shadow") version "7.1.2" apply false | ||
} | ||
|
||
architectury { | ||
val minecraftVersion: String by project | ||
minecraft = minecraftVersion | ||
} | ||
|
||
subprojects { | ||
apply(plugin = "maven-publish") | ||
apply(plugin = "dev.architectury.loom") | ||
apply(plugin = "architectury-plugin") | ||
apply(plugin = "com.github.johnrengelman.shadow") | ||
|
||
val minecraftVersion: String by project | ||
val modLoader = project.name | ||
val modId = rootProject.name | ||
val isCommon = modLoader == rootProject.projects.common.name | ||
|
||
base { | ||
archivesName.set("$modId-$modLoader-$minecraftVersion") | ||
} | ||
|
||
configure<LoomGradleExtensionAPI> { | ||
silentMojangMappingsLicense() | ||
} | ||
|
||
repositories { | ||
maven(url = "https://maven.architectury.dev/") | ||
maven(url = "https://maven.minecraftforge.net/") | ||
maven(url = "https://maven.resourcefulbees.com/repository/maven-public/") | ||
} | ||
|
||
dependencies { | ||
val resourcefulLibVersion: String by project | ||
|
||
"minecraft"("::$minecraftVersion") | ||
|
||
@Suppress("UnstableApiUsage") | ||
"mappings"(project.the<LoomGradleExtensionAPI>().layered { | ||
val parchmentVersion: String by project | ||
|
||
officialMojangMappings() | ||
|
||
parchment(create(group = "org.parchmentmc.data", name = "parchment-$minecraftVersion", version = parchmentVersion)) | ||
}) | ||
|
||
compileOnly(group = "com.teamresourceful", name = "yabn", version = "1.0.3") | ||
"modApi"(group = "com.teamresourceful.resourcefullib", name = "resourcefullib-$modLoader-$minecraftVersion", version = resourcefulLibVersion) | ||
} | ||
|
||
java { | ||
withSourcesJar() | ||
} | ||
|
||
tasks.jar { | ||
archiveClassifier.set("dev") | ||
} | ||
|
||
tasks.named<RemapJarTask>("remapJar") { | ||
archiveClassifier.set(null as String?) | ||
} | ||
|
||
if (!isCommon) { | ||
configure<ArchitectPluginExtension> { | ||
platformSetupLoomIde() | ||
} | ||
|
||
val shadowCommon by configurations.creating { | ||
isCanBeConsumed = false | ||
isCanBeResolved = true | ||
} | ||
|
||
tasks { | ||
"shadowJar"(ShadowJar::class) { | ||
archiveClassifier.set("dev-shadow") | ||
configurations = listOf(shadowCommon) | ||
} | ||
|
||
"remapJar"(RemapJarTask::class) { | ||
dependsOn("shadowJar") | ||
inputFile.set(named<ShadowJar>("shadowJar").flatMap { it.archiveFile }) | ||
} | ||
} | ||
} else { | ||
sourceSets.main.get().resources.srcDir("src/main/generated/resources") | ||
} | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("maven") { | ||
artifactId = "$modId-$modLoader-$minecraftVersion" | ||
from(components["java"]) | ||
|
||
pom { | ||
name.set("Handcrafted $modLoader") | ||
url.set("https://github.com/terrarium-earth/$modId") | ||
|
||
scm { | ||
connection.set("git:https://github.com/terrarium-earth/$modId.git") | ||
developerConnection.set("git:https://github.com/terrarium-earth/$modId.git") | ||
url.set("https://github.com/terrarium-earth/$modId") | ||
} | ||
|
||
licenses { | ||
license { | ||
name.set("MIT") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
setUrl("https://maven.resourcefulbees.com/repository/terrarium/") | ||
credentials { | ||
username = System.getenv("MAVEN_USER") | ||
password = System.getenv("MAVEN_PASS") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
resourcefulGradle { | ||
templates { | ||
register("embed") { | ||
val minecraftVersion: String by project | ||
val version: String by project | ||
val changelog: String = file("changelog.md").readText(Charsets.UTF_8) | ||
|
||
source.set(file("templates/embed.json.template")) | ||
injectedValues.set(mapOf( | ||
"minecraft" to minecraftVersion, | ||
"version" to version, | ||
"changelog" to StringEscapeUtils.escapeJava(changelog), | ||
)) | ||
} | ||
} | ||
} |
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
architectury { | ||
val enabledPlatforms: String by rootProject | ||
common(enabledPlatforms.split(",")) | ||
} | ||
|
||
dependencies { | ||
modCompileOnly(group = "tech.thatgravyboat", name = "commonats", version = "1.0") | ||
} |
Oops, something went wrong.