Advertisement
Elrol

build.gradle

Mar 27th, 2021
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.33 KB | None | 0 0
  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: '4.+', 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 = modMinecraftVersion + "-" + modVersion
  17. group = modGroup
  18. archivesBaseName = modFileName
  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. mappings channel: 'snapshot', version: modForgeMappings + '-' + modMinecraftVersion
  25. runs {
  26. client {
  27. workingDirectory project.file('run')
  28. property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  29. property 'forge.logging.console.level', 'debug'
  30. property 'mixin.env.remapRefMap', 'true'
  31. property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
  32. mods {
  33. serverutilities {
  34. source sourceSets.main
  35. }
  36. }
  37. }
  38.  
  39. server {
  40. workingDirectory project.file('run')
  41.  
  42. // Recommended logging data for a userdev environment
  43. property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  44.  
  45. // Recommended logging level for the console
  46. property 'forge.logging.console.level', 'debug'
  47. property 'mixin.env.remapRefMap', 'true'
  48. property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
  49. mods {
  50. serverutilities {
  51. source sourceSets.main
  52. }
  53. }
  54. }
  55.  
  56. data {
  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. args '--mod', 'serverutilities', '--all', '--output', file('src/generated/resources/')
  66.  
  67. mods {
  68. serverutilities {
  69. source sourceSets.main
  70. }
  71. }
  72. }
  73. }
  74. }
  75.  
  76. repositories {
  77. flatDir name: 'libs', dirs: 'libs'
  78. }
  79.  
  80. dependencies {
  81. minecraft 'net.minecraftforge:forge:' + modMinecraftVersion + '-' + modForgeVersion
  82. compile fg.deobf(name: 'architectury-1.8.131-forge')
  83. compile fg.deobf(name: 'ftb-chunks-1605.2.3-build.75')
  84. compile fg.deobf(name: 'ftb-gui-library-1605.2.1.41-forge')
  85. compile fg.deobf(name: 'ftb-ranks-1604.1.1.11')
  86. compile fg.deobf(name: 'ftb-teams-1604.1.0.15-forge')
  87. }
  88.  
  89. // Example for how to get properties into the manifest for reading by the runtime..
  90. jar {
  91. manifest {
  92. attributes([
  93. "Specification-Title": "serverutilities",
  94. "Specification-Vendor": "serverutilities",
  95. "Specification-Version": "1", // We are version 1 of ourselves
  96. "Implementation-Title": project.name,
  97. "Implementation-Version": "${version}",
  98. "Implementation-Vendor" :"serverutilities",
  99. "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
  100. ])
  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.  
  110. publishing {
  111. publications {
  112. mavenJava(MavenPublication) {
  113. artifact jar
  114. }
  115. }
  116. repositories {
  117. maven {
  118. url "file:///${project.projectDir}/mcmodsrepo"
  119. }
  120. }
  121. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement