Advertisement
Guest User

build.gradle

a guest
Jun 25th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.13 KB | None | 0 0
  1. buildscript {
  2. repositories {
  3. jcenter()
  4. maven { url 'http://files.minecraftforge.net/maven' }
  5. maven { url 'http://repo.spongepowered.org/maven' }
  6. maven { url 'https://www.jitpack.io' }
  7. }
  8.  
  9. dependencies {
  10. classpath 'com.github.Chocohead:ForgeGradle:jitpack-SNAPSHOT'
  11. classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
  12. }
  13. }
  14.  
  15. apply plugin: 'net.minecraftforge.gradle.tweaker-client'
  16. apply plugin: 'org.spongepowered.mixin'
  17. apply plugin: 'java'
  18. apply plugin: 'maven-publish'
  19.  
  20. sourceCompatibility = 1.8
  21. targetCompatibility = 1.8
  22.  
  23. repositories {
  24. mavenCentral()
  25. maven { url 'https://www.dimdev.org/maven/' }
  26. maven { url 'https://www.jitpack.io' }
  27. }
  28.  
  29. dependencies {
  30. implementation 'com.github.Chocohead:Rift:jitpack-SNAPSHOT:dev'
  31. }
  32.  
  33. ext.configFile = file "build.properties"
  34.  
  35. configFile.withReader {
  36. def prop = new Properties()
  37. prop.load(it)
  38. project.ext.config = new ConfigSlurper().parse prop
  39. }
  40.  
  41. minecraft {
  42. version = config.minecraft_version
  43. mappings = config.mappings_version
  44. runDir = 'minecraft'
  45. makeObfSourceJar = false
  46. tweakClass = 'org.dimdev.riftloader.launch.RiftLoaderClientTweaker'
  47.  
  48. ext.mod_version = config.mod_version
  49.  
  50. if (mod_version.endsWith('-dev')) {
  51. mod_version = mod_version + "." + new Date().format('yyyyMMdd.HHmmss')
  52. }
  53.  
  54. replaceIn "MaLiLibReference.java"
  55. replace "@MOD_VERSION@", mod_version
  56. }
  57.  
  58. compileJava {
  59. sourceCompatibility = 1.8
  60. targetCompatibility = 1.8
  61. options.encoding = 'UTF-8'
  62. }
  63.  
  64. /*
  65. sourceSets {
  66. main {
  67. ext.refMap = 'mixins.' + config.mod_id + '.refmap.json'
  68. }
  69. }
  70. */
  71.  
  72. group = config.group + "." + config.mod_id // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  73. archivesBaseName = config.mod_file_name + '-' + config.minecraft_version_out
  74. version = project.minecraft.mod_version
  75.  
  76. /**
  77. * This section allows you to customise the generated riftmod.json file
  78. */
  79. /*
  80. riftmod {
  81. json {
  82. id = config.mod_id
  83. name = config.mod_name
  84. version = config.mod_version
  85. authors = [ config.author ]
  86. // Uncomment any of the following lines and fill in your own details as required
  87. //dependsOn = [ 'modid', 'othermod' ]
  88. //requiredAPIs = [ 'someapi' ]
  89. //tweakClass = 'name.of.tweaker.here'
  90. mixinConfigs = [ 'mixins.' + config.mod_id + '.json' ]
  91. }
  92. }
  93. */
  94.  
  95. /**
  96. * This section allows you to customise your generated jar (litemod) file. By
  97. * default it includes the generated litemod.json file, however if you prefer to
  98. * include your own file from resources, simply remove the line below.
  99. */
  100. jar {
  101. // Remove the "-mc1.12" suffix from the file name
  102. //classifier = ""
  103. // Don't append a 'mod-' filename prefix >_>
  104. baseName = archivesBaseName
  105.  
  106. //from litemod.outputs
  107.  
  108. /*
  109. manifest.mainAttributes (
  110. 'Built-By': System.properties['user.name'],
  111. 'Created-By': System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
  112. 'Implementation-Title': config.mod_id,
  113. 'Implementation-Version': project.version
  114. )
  115. */
  116. }
  117.  
  118. mixin {
  119. defaultObfuscationEnv notch
  120. add sourceSets.main, 'mixins.' + config.mod_id + '.refmap.json'
  121. }
  122.  
  123. //tasks.withType(Jar)*.baseName = archivesBaseName
  124.  
  125. processResources
  126. {
  127. // Exclude the GIMP image files
  128. exclude '**/*.xcf'
  129. exclude '**/xcf'
  130.  
  131. // this will ensure that this task is redone when the versions change.
  132. inputs.property "mod_version", project.minecraft.mod_version
  133. inputs.property "minecraft_version", project.config.minecraft_version
  134.  
  135. // replace stuff in mcmod.info, nothing else
  136. from(sourceSets.main.resources.srcDirs) {
  137. include 'mcmod.info'
  138.  
  139. // replace version and mcversion
  140. expand 'mod_version': project.minecraft.mod_version, 'minecraft_version': project.config.minecraft_version
  141. }
  142.  
  143. // copy everything else, thats not the mcmod.info
  144. from(sourceSets.main.resources.srcDirs) {
  145. exclude 'mcmod.info'
  146. }
  147. }
  148.  
  149. task deobfJar(type: Jar) {
  150. from sourceSets.main.output
  151. // This classifier is standard and should not be changed
  152. classifier = 'deobf'
  153. }
  154.  
  155. // This section enables the last two tasks
  156. artifacts {
  157. //archives sourcesJar
  158. archives deobfJar
  159. }
  160.  
  161. tasks.publish.dependsOn build
  162. publishing {
  163. publications {
  164. mavenJava(MavenPublication) {
  165. artifactId project.archivesBaseName
  166. from components.java
  167.  
  168. artifact deobfJar
  169. artifact sourceJar
  170. }
  171. }
  172.  
  173. repositories {
  174. maven {
  175. url "$projectDir/../../CommonMaven"
  176. }
  177. }
  178. }
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201. build.properties:
  202.  
  203. group = dasd
  204. mod_id = skyblockaddons
  205. mod_name = SkyblockAddons
  206. author = biscuit
  207. mod_file_name = SkyblockAddons-rift
  208.  
  209. # Current mod version
  210. mod_version = 1.0
  211.  
  212. # Minecraft, Forge and MCP mappings versions
  213. minecraft_version_out = 1.13.2
  214. minecraft_version = 1.13.2
  215. mappings_version = snapshot_20181130
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement