Files
architectury-api/forge/build.gradle
shedaniel 36a5aea8aa Big clean up, more details in the PR (#216)
* Big clean up, more details in the PR

* Fix build

* Deprecate BlockProperties, generate AWs for Item constructors, Block constructors and RenderStateShard fields

* Add a few more RenderType AWs

* Deprecate BlockPropertiesExtension

* Set defaultType on resolving the entity type in SpawnEggItem

* Used the wrong object

* Add license information for generating AWs

* Add link to original PR

* Properly add support for forge vanilla registries

* Bump to 4.1
2022-03-12 00:01:49 +08:00

129 lines
3.4 KiB
Groovy

plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
id "com.matthewprenger.cursegradle"
}
loom {
accessWidenerPath = project(":common").loom.accessWidenerPath
forge {
mixinConfig "architectury.mixins.json"
mixinConfig "architectury-common.mixins.json"
convertAccessWideners = true
extraAccessWideners.add loom.accessWidenerPath.get().asFile.name
}
}
architectury {
platformSetupLoomIde()
forge()
}
configurations {
common
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
developmentForge.extendsFrom common
}
dependencies {
forge "net.minecraftforge:forge:${rootProject.architectury.minecraft}-${rootProject.forge_version}"
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive false }
}
processResources {
filesMatching("META-INF/mods.toml") {
expand "version": project.version
}
inputs.property "META-INF/mods.toml", project.version
}
shadowJar {
exclude "fabric.mod.json"
exclude "architectury-common.accessWidener"
exclude "architectury.common.json"
configurations = [project.configurations.shadowCommon]
classifier "dev-shadow"
}
remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
classifier null
}
jar {
classifier "dev"
}
sourcesJar {
afterEvaluate {
[":common"].forEach {
def depSources = project(it).sourcesJar
dependsOn depSources
from(depSources.archiveFile.map { zipTree(it) }) {
exclude "architectury.accessWidener"
}
}
}
}
components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}
publishing {
publications {
mavenForge(MavenPublication) {
artifactId = rootProject.archivesBaseName + "-forge"
from components.java
}
}
repositories {
if (System.getenv("MAVEN_PASS") != null) {
maven {
url = "https://deploy.shedaniel.me/"
credentials {
username = "shedaniel"
password = System.getenv("MAVEN_PASS")
}
}
}
}
}
curseforge {
if (project.hasProperty("CURSE_API_KEY") || System.getenv("CURSE_API_KEY") != null) {
apiKey = project.hasProperty("CURSE_API_KEY") ? project.property("CURSE_API_KEY") : System.getenv("CURSE_API_KEY")
project {
id = "419699"
releaseType = "$rootProject.cf_type"
changelogType = "html"
changelog = releaseChangelog()
addGameVersion "1.18.2"
addGameVersion "Java 17"
addGameVersion "Forge"
mainArtifact(remapJar.archivePath) {
displayName = "[Forge $rootProject.supported_version] v$project.version"
}
afterEvaluate {
uploadTask.dependsOn("build")
}
}
}
options {
forgeGradleIntegration = false
javaVersionAutoDetect = false
}
}
rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")