|
| 1 | +buildscript { |
| 2 | + repositories { |
| 3 | + maven { url = 'https://maven.minecraftforge.net/' } |
| 4 | + maven { url = 'https://repo.spongepowered.org/repository/maven-public/' } |
| 5 | + mavenCentral() |
| 6 | + } |
| 7 | + dependencies { |
| 8 | + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '6.+', changing: true |
| 9 | + classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT' |
| 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 | +apply plugin: 'org.spongepowered.mixin' |
| 17 | + |
| 18 | +version = '0.3.0' |
| 19 | +group = 'net.azisaba.interchatmod' // http://maven.apache.org/guides/mini/guide-naming-conventions.html |
| 20 | +archivesBaseName = 'InterChatMod' |
| 21 | + |
| 22 | +sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. |
| 23 | +//Print out JVM information so that we know what version is running. Extreamly useful for people to know when helping you. |
| 24 | +println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) |
| 25 | + |
| 26 | +minecraft { |
| 27 | + // The mappings can be changed at any time, and must be in the following format. |
| 28 | + // snapshot_YYYYMMDD Snapshot are built nightly. |
| 29 | + // stable_# Stables are built at the discretion of the MCP team. |
| 30 | + // Use non-default mappings at your own risk. they may not always work. |
| 31 | + // Simply re-run your setup task after changing the mappings to update your workspace. |
| 32 | + mappings channel: 'snapshot', version: '20200514-1.15.1' |
| 33 | + // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. |
| 34 | + |
| 35 | + // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') |
| 36 | + |
| 37 | + // Default run configurations. |
| 38 | + // These can be tweaked, removed, or duplicated as needed. |
| 39 | + runs { |
| 40 | + client { |
| 41 | + workingDirectory project.file('run') |
| 42 | + |
| 43 | + // Recommended logging data for a userdev environment |
| 44 | + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' |
| 45 | + |
| 46 | + // Recommended logging level for the console |
| 47 | + property 'forge.logging.console.level', 'debug' |
| 48 | + |
| 49 | + mods { |
| 50 | + examplemod { |
| 51 | + source sourceSets.main |
| 52 | + } |
| 53 | + } |
| 54 | + } |
| 55 | + |
| 56 | + server { |
| 57 | + workingDirectory project.file('run') |
| 58 | + |
| 59 | + // Recommended logging data for a userdev environment |
| 60 | + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' |
| 61 | + |
| 62 | + // Recommended logging level for the console |
| 63 | + property 'forge.logging.console.level', 'debug' |
| 64 | + |
| 65 | + mods { |
| 66 | + examplemod { |
| 67 | + source sourceSets.main |
| 68 | + } |
| 69 | + } |
| 70 | + } |
| 71 | + |
| 72 | + data { |
| 73 | + workingDirectory project.file('run') |
| 74 | + |
| 75 | + // Recommended logging data for a userdev environment |
| 76 | + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' |
| 77 | + |
| 78 | + // Recommended logging level for the console |
| 79 | + property 'forge.logging.console.level', 'debug' |
| 80 | + |
| 81 | + args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/') |
| 82 | + |
| 83 | + mods { |
| 84 | + examplemod { |
| 85 | + source sourceSets.main |
| 86 | + } |
| 87 | + } |
| 88 | + } |
| 89 | + } |
| 90 | +} |
| 91 | + |
| 92 | +configurations { |
| 93 | + shade |
| 94 | + implementation.extendsFrom shade |
| 95 | +} |
| 96 | + |
| 97 | +dependencies { |
| 98 | + // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed |
| 99 | + // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. |
| 100 | + // The userdev artifact is a special name and will get all sorts of transformations applied to it. |
| 101 | + minecraft 'net.minecraftforge:forge:1.15.2-31.2.57' |
| 102 | + |
| 103 | + // You may put jars on which you depend on in ./libs or you may define them like so.. |
| 104 | + // compile "some.group:artifact:version:classifier" |
| 105 | + // compile "some.group:artifact:version" |
| 106 | + |
| 107 | + // Real examples |
| 108 | + // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env |
| 109 | + // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env |
| 110 | + |
| 111 | + // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. |
| 112 | + // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' |
| 113 | + |
| 114 | + // These dependencies get remapped to your current MCP mappings |
| 115 | + // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev' |
| 116 | + |
| 117 | + // For more info... |
| 118 | + // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html |
| 119 | + // http://www.gradle.org/docs/current/userguide/dependency_management.html |
| 120 | + |
| 121 | + annotationProcessor 'com.google.code.gson:gson:2.10.1' |
| 122 | + annotationProcessor 'com.google.guava:guava:32.1.3-jre' |
| 123 | + annotationProcessor 'org.ow2.asm:asm:9.6' |
| 124 | + annotationProcessor 'org.ow2.asm:asm-tree:9.6' |
| 125 | + annotationProcessor 'org.spongepowered:mixin:0.8.5' |
| 126 | + implementation project(':common') |
| 127 | + shade project(':common') |
| 128 | + shade "net.kyori:adventure-api:$adventureVersion" |
| 129 | + shade "net.kyori:adventure-key:$adventureVersion" |
| 130 | + shade "net.kyori:examination-api:1.3.0" |
| 131 | + shade "net.kyori:examination-string:1.3.0" |
| 132 | + shade "net.kyori:adventure-text-serializer-legacy:$adventureVersion" |
| 133 | + shade "net.kyori:adventure-text-serializer-json:$adventureVersion" |
| 134 | + shade "net.kyori:adventure-text-serializer-gson:$adventureVersion" |
| 135 | + shade "org.java-websocket:Java-WebSocket:1.5.4" |
| 136 | + shade "org.slf4j:slf4j-api:2.0.6" |
| 137 | + shade "org.slf4j:slf4j-nop:2.0.6" |
| 138 | + |
| 139 | +} |
| 140 | + |
| 141 | +mixin { |
| 142 | + add(sourceSets.main, 'mixins.interchatmod.refmap.json') |
| 143 | + config 'mixins.interchatmod.json' |
| 144 | +} |
| 145 | + |
| 146 | +// Example for how to get properties into the manifest for reading by the runtime.. |
| 147 | +jar { |
| 148 | + archiveClassifier = 'slim' |
| 149 | + manifest { |
| 150 | + attributes([ |
| 151 | + "Specification-Title": "interChatMod", |
| 152 | + "Specification-Vendor": "AzisabaNetwork", |
| 153 | + "Specification-Version": "1", // We are version 1 of ourselves |
| 154 | + "Implementation-Title": project.name, |
| 155 | + "Implementation-Version": "${version}", |
| 156 | + "Implementation-Vendor" :"AzisabaNetwork", |
| 157 | + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") |
| 158 | + ]) |
| 159 | + } |
| 160 | +} |
| 161 | + |
| 162 | +shadowJar { |
| 163 | + archiveClassifier = '' |
| 164 | + configurations = [project.configurations.shade] |
| 165 | + relocate 'net.kyori', "${project.group}.lib.net.kyori" |
| 166 | + relocate 'org.slf4j', "${project.group}.lib.org.slf4j" |
| 167 | + mergeServiceFiles() |
| 168 | + finalizedBy 'reobfShadowJar' |
| 169 | +} |
| 170 | + |
| 171 | +assemble.dependsOn shadowJar |
| 172 | + |
| 173 | +reobf { |
| 174 | + shadowJar {} |
| 175 | +} |
| 176 | + |
| 177 | +// Example configuration to allow publishing using the maven-publish task |
| 178 | +// This is the preferred method to reobfuscate your jar file |
| 179 | +jar.finalizedBy('reobfJar') |
| 180 | +// 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 |
| 181 | +//publish.dependsOn('reobfJar') |
| 182 | + |
| 183 | +publishing { |
| 184 | + publications { |
| 185 | + mavenJava(MavenPublication) { |
| 186 | + artifact jar |
| 187 | + } |
| 188 | + } |
| 189 | + repositories { |
| 190 | + maven { |
| 191 | + url "file:///${project.projectDir}/mcmodsrepo" |
| 192 | + } |
| 193 | + } |
| 194 | +} |
0 commit comments