-
Notifications
You must be signed in to change notification settings - Fork 10
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
5c6bae2
commit cca1203
Showing
2 changed files
with
155 additions
and
137 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 |
---|---|---|
@@ -1,166 +1,181 @@ | ||
import net.fabricmc.loom.task.RemapJarTask | ||
|
||
plugins { | ||
id 'fabric-loom' version '0.5-SNAPSHOT' | ||
id 'java-library' | ||
id 'maven-publish' | ||
id 'com.github.johnrengelman.shadow' version '5.1.0' | ||
id 'net.minecrell.licenser' version '0.4.1' | ||
} | ||
|
||
group = project.maven_group | ||
version = "${project.mod_version}+${getMCVersionString()}" | ||
archivesBaseName = project.archives_base_name + "-fabric" | ||
buildscript { | ||
repositories { | ||
maven { url = 'https://maven.minecraftforge.net' } | ||
mavenCentral() | ||
jcenter() | ||
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' } | ||
maven { | ||
name 'parchment' | ||
url 'https://maven.parchmentmc.org' | ||
} | ||
maven { | ||
url "https://plugins.gradle.org/m2/" | ||
} | ||
} | ||
dependencies { | ||
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: "${forgegradle_version}", changing: true | ||
classpath group: 'org.spongepowered', name: 'mixingradle', version: "${mixingradle_version}" | ||
classpath 'org.parchmentmc:librarian:1.+' | ||
classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.4.0" | ||
|
||
def getMCVersionString() { | ||
if (project.minecraft_version.matches("\\d\\dw\\d\\d[a-z]")) { | ||
return project.minecraft_version | ||
} | ||
int lastDot = project.minecraft_version.lastIndexOf('.') | ||
return project.minecraft_version.substring(0, lastDot) | ||
} | ||
|
||
minecraft { | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
maven { | ||
name = "AperLambda" | ||
url = 'https://aperlambda.github.io/maven' | ||
} | ||
maven { url = "https://jitpack.io" } | ||
maven { | ||
name = "grondag" | ||
url 'https://maven.dblsaiko.net/' | ||
} | ||
maven { | ||
name = "Cotton" | ||
url = "http://server.bbkr.space:8081/artifactory/libs-release/" | ||
url = "https://www.cursemaven.com" | ||
} | ||
mavenCentral() | ||
} | ||
|
||
configurations { | ||
shadow | ||
api.extendsFrom shadow | ||
} | ||
apply plugin: "com.matthewprenger.cursegradle" | ||
apply plugin: 'net.minecraftforge.gradle' | ||
apply plugin: 'org.parchmentmc.librarian.forgegradle' | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:${project.minecraft_version}" | ||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" | ||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" | ||
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. | ||
apply plugin: 'eclipse' | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'org.spongepowered.mixin' | ||
|
||
// Fabric API. This is technically optional, but you probably want it anyway. | ||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" | ||
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false'); | ||
|
||
//modImplementation "com.github.lambdaurora:spruceui:${project.spruceui_version}" | ||
//include "com.github.lambdaurora:spruceui:${project.spruceui_version}" | ||
ext.buildnumber = 0 | ||
project.buildnumber = System.getenv('BUILD_NUMBER') != null ? System.getenv('BUILD_NUMBER') : "custom" | ||
|
||
//modImplementation("io.github.prospector:modmenu:${project.modmenu_version}") { | ||
// transitive = false | ||
//} | ||
//modImplementation "grondag:canvas-mc116:1.0.+" | ||
modImplementation "com.github.jellysquid3:sodium-fabric:mc1.16.3-0.1.0" | ||
version = "mc${minecraft_version}_v${mod_version}" + (dev && !buildnumber.equals("custom") ? "+${buildnumber}" : '') | ||
group = 'vice.' + String.valueOf(mod_id) | ||
archivesBaseName = String.valueOf(mod_id) | ||
|
||
shadow "com.electronwill.night-config:core:3.6.3" | ||
shadow "com.electronwill.night-config:toml:3.6.3" | ||
} | ||
java.toolchain.languageVersion = JavaLanguageVersion.of(8) | ||
|
||
tasks.withType(JavaCompile) { | ||
options.encoding = "UTF-8" | ||
configurations { | ||
shade | ||
} | ||
|
||
processResources { | ||
inputs.property "version", project.version | ||
minecraft { | ||
mappings channel: "${mappings_channel}", version: "${mappings_version}" | ||
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') | ||
|
||
runs { | ||
client { | ||
workingDirectory project.file('run') | ||
arg '-mixin.config=' + String.valueOf(mod_id) + '.mixins.json' | ||
//jvmArgs '-XX:+UnlockCommercialFeatures' // uncomment for profiling | ||
property 'forge.logging.console.level', 'info' | ||
property 'fml.earlyprogresswindow', 'false' | ||
property 'mixin.env.remapRefMap', 'true' | ||
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" | ||
mods { | ||
dynamiclightsreforged { | ||
source sourceSets.main | ||
} | ||
} | ||
} | ||
|
||
from(sourceSets.main.resources.srcDirs) { | ||
include "fabric.mod.json" | ||
expand "version": project.version | ||
} | ||
server { | ||
workingDirectory project.file('run/server') | ||
arg '-mixin.config=' + String.valueOf(mod_id) + '.mixins.json' | ||
property 'forge.logging.console.level', 'info' | ||
property 'mixin.env.remapRefMap', 'true' | ||
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" | ||
mods { | ||
dynamiclightsreforged { | ||
source sourceSets.main | ||
} | ||
} | ||
} | ||
|
||
from(sourceSets.main.resources.srcDirs) { | ||
exclude "fabric.mod.json" | ||
data { | ||
workingDirectory project.file('run') | ||
property 'forge.logging.markers', 'REGISTRIES,REGISTRYDUMP' | ||
property 'forge.logging.console.level', 'debug' | ||
property 'fml.earlyprogresswindow', 'false' | ||
property 'mixin.env.remapRefMap', 'true' | ||
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" | ||
args '--mod', String.valueOf(mod_id), '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources') | ||
mods { | ||
dynamiclightsreforged { | ||
source sourceSets.main | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
|
||
withSourcesJar() | ||
compileJava { | ||
options.compilerArgs = ["-Xdiags:verbose"] | ||
} | ||
|
||
jar { | ||
from "../LICENSE" | ||
sourceSets.main.resources { | ||
srcDir 'src/generated/resources' | ||
} | ||
|
||
license { | ||
header file('HEADER') | ||
include '**/*.java' | ||
mixin { | ||
add sourceSets.main, "dynamiclightsreforged.refmap.json" | ||
} | ||
|
||
shadowJar { | ||
dependsOn(project(":").jar) | ||
configurations = [project.configurations.shadow] | ||
archiveClassifier.set('dev') | ||
dependencies { | ||
implementation 'org.jetbrains:annotations:20.1.0' | ||
|
||
compileOnly 'org.projectlombok:lombok:1.18.22' | ||
annotationProcessor 'org.projectlombok:lombok:1.18.22' | ||
|
||
testCompileOnly 'org.projectlombok:lombok:1.18.22' | ||
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22' | ||
|
||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" | ||
|
||
runtimeOnly fg.deobf("curse.maven:magnesium-532724:3503910") | ||
runtimeOnly fg.deobf("curse.maven:jei-238222:3438494") | ||
runtimeOnly fg.deobf("curse.maven:jer-240630:3066754") | ||
runtimeOnly fg.deobf("curse.maven:jade-324717:3467445") | ||
runtimeOnly fg.deobf("curse.maven:spark-361579:3337641") | ||
runtimeOnly fg.deobf("curse.maven:lazydfu-433518:3209972") | ||
runtimeOnly fg.deobf("curse.maven:smoothboot-420913:3224252") | ||
runtimeOnly fg.deobf("curse.maven:alltheores-405593:3405905") | ||
runtimeOnly fg.deobf("curse.maven:cofh-69162:3407019") | ||
runtimeOnly fg.deobf("curse.maven:thermalfoundation-222880:3412300") | ||
runtimeOnly fg.deobf("curse.maven:thermalexpansion-69163:3404884") | ||
runtimeOnly fg.deobf("curse.maven:engineers-313866:3390489") | ||
runtimeOnly fg.deobf("curse.maven:immersive-231951:3497359") | ||
runtimeOnly fg.deobf("curse.maven:patchouli-306770:3459118") | ||
|
||
annotationProcessor 'org.spongepowered:mixin:0.8.3:processor' | ||
} | ||
|
||
relocate 'com.electronwill.nightconfig', 'me.lambdaurora.lambdynlights.shadow.nightconfig' | ||
jar { | ||
manifest { | ||
attributes([ | ||
"Specification-Title": "${mod_id}", | ||
"Specification-Vendor": "vice", | ||
"Specification-Version": "1", | ||
"Implementation-Title": project.name, | ||
"Implementation-Version": "${version}", | ||
"Implementation-Vendor" :"vice", | ||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), | ||
"MixinConfigs": "${mod_id}.mixins.json" | ||
]) | ||
} | ||
} | ||
|
||
task shadowRemapJar(type: RemapJarTask) { | ||
dependsOn shadowJar | ||
jar.finalizedBy('reobfJar') | ||
|
||
input = file("${project.buildDir}/libs/$archivesBaseName-$version-dev.jar") | ||
archiveName = "${archivesBaseName}-${version}.jar" | ||
addNestedDependencies = true | ||
artifacts { | ||
archives jar | ||
} | ||
build.dependsOn(shadowRemapJar) | ||
|
||
// configure the maven publication | ||
publishing { | ||
tasks.publish.dependsOn 'build' | ||
publications { | ||
mavenJava(MavenPublication) { | ||
artifact(remapJar) { | ||
builtBy remapJar | ||
} | ||
artifact(sourcesJar) { | ||
builtBy remapSourcesJar | ||
} | ||
|
||
pom { | ||
name = "LambDynamicLights" | ||
description = "Adds dynamic lights to the game." | ||
} | ||
|
||
pom.withXml { | ||
def dependenciesNode = asNode().appendNode('dependencies') | ||
|
||
configurations.shadow.allDependencies.each { | ||
def dependencyNode = dependenciesNode.appendNode('dependency') | ||
|
||
dependencyNode.appendNode('groupId', it.group) | ||
dependencyNode.appendNode('artifactId', it.name) | ||
dependencyNode.appendNode('version', it.version) | ||
dependencyNode.appendNode('scope', 'compile') | ||
} | ||
} | ||
artifact jar | ||
} | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
maven { | ||
name = "BuildDirLocal" | ||
url = "$buildDir/repo" | ||
} | ||
maven { | ||
name = "GithubPackages" | ||
url = uri("https://maven.pkg.github.com/LambdAurora/LambDynamicLights") | ||
credentials { | ||
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME") | ||
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN") | ||
} | ||
if (project.hasProperty('mavendir')) { | ||
maven { url mavendir } | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,19 +1,22 @@ | ||
# Done to increase the memory available to gradle. | ||
org.gradle.jvmargs=-Xmx1G | ||
# Sets default memory used for gradle commands. Can be overridden by user or command line properties. | ||
# This is required to provide enough memory for the Minecraft decompilation process. | ||
org.gradle.jvmargs = -Xmx3G | ||
org.gradle.daemon = false | ||
|
||
# Fabric Properties | ||
# check these on https://fabricmc.net/use | ||
minecraft_version=1.16.5 | ||
yarn_mappings=1.16.5+build.1 | ||
loader_version=0.11.1 | ||
# mod version info | ||
mod_id = dynamiclightsreforged | ||
mod_version = 1.0.0 | ||
minecraft_version = 1.16.5 | ||
forge_version = 36.2.0 | ||
|
||
# Mod Properties | ||
mod_version = 1.3.4 | ||
maven_group = me.lambdaurora | ||
archives_base_name = lambdynamiclights | ||
mappings_version=2021.10.17-1.16.5 | ||
mappings_channel=parchment | ||
|
||
# Dependencies | ||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api | ||
fabric_version=0.29.3+1.16 | ||
spruceui_version=2.0.4-1.16 | ||
modmenu_version=1.14.6+build.31 | ||
# build dependency versions | ||
forgegradle_version = 5.1.+ | ||
mixingradle_version = 0.7-SNAPSHOT | ||
shadow_version = 6.1.0 | ||
cursegradle_version = 1.4.0 | ||
|
||
# github information | ||
github_project = viceversagames/dynamiclightsreforged |