build.gradle 5.5 KB

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