|
| 1 | +buildscript { |
| 2 | + repositories { |
| 3 | + maven { url = 'https://files.minecraftforge.net/maven' } |
| 4 | + jcenter() |
| 5 | + mavenCentral() |
| 6 | + } |
| 7 | + dependencies { |
| 8 | + classpath 'net.minecraftforge.gradle:ForgeGradle:3.+' |
| 9 | + } |
| 10 | +} |
| 11 | + |
| 12 | +apply plugin: 'net.minecraftforge.gradle' |
| 13 | +// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. |
| 14 | +apply plugin: 'eclipse' |
| 15 | +apply plugin: 'maven-publish' |
| 16 | + |
| 17 | +version = '1.0.2' |
| 18 | +group = 'chloeprime.fix4log4j' // http://maven.apache.org/guides/mini/guide-naming-conventions.html |
| 19 | +archivesBaseName = 'Fix4Log4J' |
| 20 | + |
| 21 | +sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. |
| 22 | + |
| 23 | +minecraft { |
| 24 | + // The mappings can be changed at any time, and must be in the following format. |
| 25 | + // snapshot_YYYYMMDD Snapshot are built nightly. |
| 26 | + // stable_# Stables are built at the discretion of the MCP team. |
| 27 | + // Use non-default mappings at your own risk. they may not always work. |
| 28 | + // Simply re-run your setup task after changing the mappings to update your workspace. |
| 29 | + //mappings channel: 'snapshot', version: '20171003-1.12' |
| 30 | + mappings channel: 'snapshot', version: '20171003-1.12' |
| 31 | + // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. |
| 32 | + |
| 33 | + // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') |
| 34 | + |
| 35 | + // Default run configurations. |
| 36 | + // These can be tweaked, removed, or duplicated as needed. |
| 37 | + runs { |
| 38 | + client { |
| 39 | + workingDirectory project.file('run') |
| 40 | + |
| 41 | + // Recommended logging data for a userdev environment |
| 42 | + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' |
| 43 | + |
| 44 | + // Recommended logging level for the console |
| 45 | + property 'forge.logging.console.level', 'debug' |
| 46 | + } |
| 47 | + |
| 48 | + server { |
| 49 | + |
| 50 | + // Recommended logging data for a userdev environment |
| 51 | + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' |
| 52 | + |
| 53 | + // Recommended logging level for the console |
| 54 | + property 'forge.logging.console.level', 'debug' |
| 55 | + } |
| 56 | + } |
| 57 | +} |
| 58 | + |
| 59 | +dependencies { |
| 60 | + // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed |
| 61 | + // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. |
| 62 | + // The userdev artifact is a special name and will get all sorts of transformations applied to it. |
| 63 | + minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2855' |
| 64 | + |
| 65 | + // You may put jars on which you depend on in ./libs or you may define them like so.. |
| 66 | + // compile "some.group:artifact:version:classifier" |
| 67 | + // compile "some.group:artifact:version" |
| 68 | + |
| 69 | + // Real examples |
| 70 | + // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env |
| 71 | + // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env |
| 72 | + |
| 73 | + // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. |
| 74 | + // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' |
| 75 | + |
| 76 | + // These dependencies get remapped to your current MCP mappings |
| 77 | + // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev' |
| 78 | + |
| 79 | + // For more info... |
| 80 | + // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html |
| 81 | + // http://www.gradle.org/docs/current/userguide/dependency_management.html |
| 82 | + |
| 83 | +} |
| 84 | + |
| 85 | +// Example for how to get properties into the manifest for reading by the runtime.. |
| 86 | +jar { |
| 87 | + manifest { |
| 88 | + attributes([ |
| 89 | + "Specification-Title": "fix4log4j", |
| 90 | + "Specification-Vendor": "Fix4Log4J", |
| 91 | + "Specification-Version": "1", // We are version 1 of ourselves |
| 92 | + "Implementation-Title": project.name, |
| 93 | + "Implementation-Version": "${version}", |
| 94 | + "Implementation-Vendor" :"ChloePrime", |
| 95 | + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") |
| 96 | + ]) |
| 97 | + } |
| 98 | +} |
| 99 | + |
| 100 | +// Example configuration to allow publishing using the maven-publish task |
| 101 | +// This is the preferred method to reobfuscate your jar file |
| 102 | +jar.finalizedBy('reobfJar') |
| 103 | +// 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 |
| 104 | +//publish.dependsOn('reobfJar') |
| 105 | + |
| 106 | +publishing { |
| 107 | + publications { |
| 108 | + mavenJava(MavenPublication) { |
| 109 | + artifact jar |
| 110 | + } |
| 111 | + } |
| 112 | + repositories { |
| 113 | + maven { |
| 114 | + url "file:///${project.projectDir}/mcmodsrepo" |
| 115 | + } |
| 116 | + } |
| 117 | +} |
0 commit comments