Skip to content

Instantly share code, notes, and snippets.

@fadookie
Last active June 29, 2020 03:01
Show Gist options
  • Save fadookie/00033db0de410675742acc760473a719 to your computer and use it in GitHub Desktop.
Save fadookie/00033db0de410675742acc760473a719 to your computer and use it in GitHub Desktop.
plugins {
id 'fabric-loom' version '0.4-SNAPSHOT'
id 'maven-publish'
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// modImplementation "io.github.cottonmc:LibGui:1.7.0+1.15.2"
modImplementation "io.github.cottonmc:LibGui:+"
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.
// Utilities for messing with JVM bytecode from https://asm.ow2.io/index.html
// implementation "org.ow2.asm.asm-all:+"
}
processResources {
inputs.property "version", project.version
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand "version": project.version
}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
jar {
from "LICENSE"
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}
// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.15.2
yarn_mappings=1.15.2+build.17
loader_version=0.8.7+build.201
# Mod Properties
mod_version = 0.0.1
maven_group = com.eliotlash.stormlight
archives_base_name = stormlight
# 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.11.1+build.312-1.15
A problem occurred configuring root project 'fabric-example-mod'.
> Could not resolve all dependencies for configuration ':modImplementation'.
> Could not find any matches for io.github.cottonmc:LibGui:+ as no versions of io.github.cottonmc:LibGui are available.
Searched in the following locations:
- https://libraries.minecraft.net/io/github/cottonmc/LibGui/maven-metadata.xml
- file:/Users/eliot/Dev/eliot/minecraft/fabric/fabric-example-mod/build/loom-cache/
- file:/Users/eliot/Dev/eliot/minecraft/fabric/fabric-example-mod/.gradle/loom-cache/remapped_mods/
- https://maven.fabricmc.net/io/github/cottonmc/LibGui/maven-metadata.xml
- https://repo.maven.apache.org/maven2/io/github/cottonmc/LibGui/maven-metadata.xml
- https://jcenter.bintray.com/io/github/cottonmc/LibGui/maven-metadata.xml
- file:/Users/eliot/.gradle/caches/fabric-loom/1.15.2-mapped-net.fabricmc.yarn-1.15.2+build.17-v2/
Required by:
project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
pluginManagement {
repositories {
jcenter()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
maven {
name = 'OW2'
url = 'https://repository.ow2.org/'
}
maven {
name = "CottonMC"
url = "https://server.bbkr.space/artifactory/libs-release"
}
gradlePluginPortal()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment