1
0

Fix maven repo and FG https support

This commit is contained in:
JackCarterSmith 2024-03-10 19:08:10 +01:00
parent 30f63e794e
commit 7fcdee4309
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24
3 changed files with 53 additions and 93 deletions

View File

@ -1,116 +1,76 @@
buildscript { buildscript {
repositories { repositories {
maven { url = 'https://maven.minecraftforge.net/' }
mavenCentral() mavenCentral()
maven { url = "https://maven.minecraftforge.net/" }
} }
dependencies { dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:3.+' classpath("com.anatawa12.forge:ForgeGradle:2.3-1.0.+") {
changing = true
}
} }
} }
apply plugin: 'net.minecraftforge.gradle' apply plugin: 'net.minecraftforge.gradle.forge'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. //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'
version = '1.0' version = "1.0"
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html group = "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'modid' archivesBaseName = "modid"
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
minecraft { minecraft {
// The mappings can be changed at any time, and must be in the following format. version = "1.12.2-14.23.5.2847"
// snapshot_YYYYMMDD Snapshot are built nightly. runDir = "run"
// stable_# Stables are built at the discretion of the MCP team.
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work. // Use non-default mappings at your own risk. they may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace. // simply re-run your setup task after changing the mappings to update your workspace.
//mappings channel: 'snapshot', version: '20171003-1.12' mappings = "stable_39"
mappings channel: 'snapshot', version: '20171003-1.12'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
}
server {
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
}
}
} }
dependencies { dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed // you may put jars on which you depend on in ./libs
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. // or you may define them like so..
// The userdev artifact is a special name and will get all sorts of transformations applied to it. //compile "some.group:artifact:version:classifier"
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860' //compile "some.group:artifact:version"
// You may put jars on which you depend on in ./libs or you may define them like so.. // real examples
// compile "some.group:artifact:version:classifier" //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
// compile "some.group:artifact:version" //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
// Real examples // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
// compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
// The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
// provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' // except that these dependencies get remapped to your current MCP mappings
//deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
//deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// These dependencies get remapped to your current MCP mappings // for more info...
// deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// For more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html // http://www.gradle.org/docs/current/userguide/dependency_management.html
} }
// Example for how to get properties into the manifest for reading by the runtime.. processResources {
jar { // this will ensure that this task is redone when the versions change.
manifest { inputs.property "version", project.version
attributes([ inputs.property "mcversion", project.minecraft.version
"Specification-Title": "examplemod",
"Specification-Vendor": "examplemodsareus", // replace stuff in mcmod.info, nothing else
"Specification-Version": "1", // We are version 1 of ourselves from(sourceSets.main.resources.srcDirs) {
"Implementation-Title": project.name, include 'mcmod.info'
"Implementation-Version": "${version}",
"Implementation-Vendor" :"examplemodsareus", // replace version and mcversion
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") expand 'version':project.version, 'mcversion':project.minecraft.version
]) }
}
} // copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
// Example configuration to allow publishing using the maven-publish task exclude 'mcmod.info'
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
//publish.dependsOn('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
}
} }
} }

View File

@ -1,4 +1,4 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties. # 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. # This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G org.gradle.jvmargs=-Xmx4G
org.gradle.daemon=false org.gradle.daemon=false

View File

@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip