|
| 1 | +buildscript { |
| 2 | + repositories { |
| 3 | + maven { url = 'https://files.minecraftforge.net/maven' } |
| 4 | + jcenter() |
| 5 | + mavenCentral() |
| 6 | + } |
| 7 | + dependencies { |
| 8 | + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true |
| 9 | + } |
| 10 | +} |
| 11 | +apply plugin: 'net.minecraftforge.gradle' |
| 12 | +// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. |
| 13 | +apply plugin: 'eclipse' |
| 14 | +apply plugin: 'maven-publish' |
| 15 | + |
| 16 | +version = '1.0' |
| 17 | +group = 'network.tiki.MCToDiscordNotify' // http://maven.apache.org/guides/mini/guide-naming-conventions.html |
| 18 | +archivesBaseName = 'MCToDiscordNotify' |
| 19 | + |
| 20 | +sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. |
| 21 | + |
| 22 | +println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) |
| 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: '20201028-1.16.3' |
| 30 | + // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. |
| 31 | + |
| 32 | + // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') |
| 33 | + |
| 34 | + // Default run configurations. |
| 35 | + // These can be tweaked, removed, or duplicated as needed. |
| 36 | + runs { |
| 37 | + client { |
| 38 | + workingDirectory project.file('run') |
| 39 | + |
| 40 | + // Recommended logging data for a userdev environment |
| 41 | + // The markers can be changed as needed. |
| 42 | + // "SCAN": For mods scan. |
| 43 | + // "REGISTRIES": For firing of registry events. |
| 44 | + // "REGISTRYDUMP": For getting the contents of all registries. |
| 45 | + property 'forge.logging.markers', 'REGISTRIES' |
| 46 | + |
| 47 | + // Recommended logging level for the console |
| 48 | + // You can set various levels here. |
| 49 | + // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels |
| 50 | + property 'forge.logging.console.level', 'debug' |
| 51 | + |
| 52 | + mods { |
| 53 | + examplemod { |
| 54 | + source sourceSets.main |
| 55 | + } |
| 56 | + } |
| 57 | + } |
| 58 | + |
| 59 | + server { |
| 60 | + workingDirectory project.file('run') |
| 61 | + |
| 62 | + // Recommended logging data for a userdev environment |
| 63 | + // The markers can be changed as needed. |
| 64 | + // "SCAN": For mods scan. |
| 65 | + // "REGISTRIES": For firing of registry events. |
| 66 | + // "REGISTRYDUMP": For getting the contents of all registries. |
| 67 | + property 'forge.logging.markers', 'REGISTRIES' |
| 68 | + |
| 69 | + // Recommended logging level for the console |
| 70 | + // You can set various levels here. |
| 71 | + // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels |
| 72 | + property 'forge.logging.console.level', 'debug' |
| 73 | + |
| 74 | + mods { |
| 75 | + examplemod { |
| 76 | + source sourceSets.main |
| 77 | + } |
| 78 | + } |
| 79 | + } |
| 80 | + |
| 81 | + data { |
| 82 | + workingDirectory project.file('run') |
| 83 | + |
| 84 | + // Recommended logging data for a userdev environment |
| 85 | + // The markers can be changed as needed. |
| 86 | + // "SCAN": For mods scan. |
| 87 | + // "REGISTRIES": For firing of registry events. |
| 88 | + // "REGISTRYDUMP": For getting the contents of all registries. |
| 89 | + property 'forge.logging.markers', 'REGISTRIES' |
| 90 | + |
| 91 | + // Recommended logging level for the console |
| 92 | + // You can set various levels here. |
| 93 | + // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels |
| 94 | + property 'forge.logging.console.level', 'debug' |
| 95 | + |
| 96 | + // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. |
| 97 | + args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') |
| 98 | + |
| 99 | + mods { |
| 100 | + examplemod { |
| 101 | + source sourceSets.main |
| 102 | + } |
| 103 | + } |
| 104 | + } |
| 105 | + } |
| 106 | +} |
| 107 | + |
| 108 | +// Include resources generated by data generators. |
| 109 | +sourceSets.main.resources { srcDir 'src/generated/resources' } |
| 110 | + |
| 111 | +dependencies { |
| 112 | + // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed |
| 113 | + // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. |
| 114 | + // The userdev artifact is a special name and will get all sorts of transformations applied to it. |
| 115 | + minecraft 'net.minecraftforge:forge:1.16.5-36.0.46' |
| 116 | + |
| 117 | + // You may put jars on which you depend on in ./libs or you may define them like so.. |
| 118 | + // compile "some.group:artifact:version:classifier" |
| 119 | + // compile "some.group:artifact:version" |
| 120 | + |
| 121 | + // Real examples |
| 122 | + // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env |
| 123 | + // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env |
| 124 | + |
| 125 | + // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. |
| 126 | + // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' |
| 127 | + |
| 128 | + // These dependencies get remapped to your current MCP mappings |
| 129 | + // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev' |
| 130 | + |
| 131 | + // For more info... |
| 132 | + // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html |
| 133 | + // http://www.gradle.org/docs/current/userguide/dependency_management.html |
| 134 | + |
| 135 | +} |
| 136 | + |
| 137 | +// Example for how to get properties into the manifest for reading by the runtime.. |
| 138 | +jar { |
| 139 | + manifest { |
| 140 | + attributes([ |
| 141 | + "Specification-Title": "MCToDiscordNotify", |
| 142 | + "Specification-Vendor": "tikinetwork", |
| 143 | + "Specification-Version": "1", // We are version 1 of ourselves |
| 144 | + "Implementation-Title": project.name, |
| 145 | + "Implementation-Version": "${version}", |
| 146 | + "Implementation-Vendor" :"tikinetwork", |
| 147 | + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") |
| 148 | + ]) |
| 149 | + } |
| 150 | +} |
| 151 | + |
| 152 | +// Example configuration to allow publishing using the maven-publish task |
| 153 | +// This is the preferred method to reobfuscate your jar file |
| 154 | +jar.finalizedBy('reobfJar') |
| 155 | +// 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 |
| 156 | +//publish.dependsOn('reobfJar') |
| 157 | + |
| 158 | +publishing { |
| 159 | + publications { |
| 160 | + mavenJava(MavenPublication) { |
| 161 | + artifact jar |
| 162 | + } |
| 163 | + } |
| 164 | + repositories { |
| 165 | + maven { |
| 166 | + url "file:///${project.projectDir}/mcmodsrepo" |
| 167 | + } |
| 168 | + } |
| 169 | +} |
0 commit comments