build.gradle 5.8 KB

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