mysticdrew

Untitled

Oct 28th, 2015
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. plugins {
  2. id "net.minecraftforge.gradle.forge" version "2.0.2"
  3. }
  4.  
  5.  
  6. //apply plugin: 'forge'
  7. //apply plugin: 'java'
  8.  
  9. // Fixes bug in IDEA 14 that wasn't putting resources into build/classes
  10. sourceSets {
  11. main { output.resourcesDir = output.classesDir }
  12. }
  13.  
  14. ext {
  15. configFile = file "project.properties"
  16. srcWebDir = "src/main/resources/assets/journeymap/web/"
  17. implSrc = "build/resources/java/journeymap/feature/impl/"
  18. }
  19.  
  20. configFile.withReader {
  21. def prop = new Properties()
  22. prop.load(it)
  23. project.ext.config = new ConfigSlurper().parse prop
  24. }
  25.  
  26. version = "${config.minecraft_version}-${config.jm_major}.${config.jm_minor}.${config.jm_micro}${config.jm_patch}"
  27. group = "${config.group_id}"
  28. archivesBaseName = "${config.mod_id}".toLowerCase()
  29.  
  30. minecraft {
  31. version = "${config.minecraft_version}-${config.forge_version}"
  32. runDir = "run"
  33.  
  34. replace "@JMVERSION@", "${config.jm_major}.${config.jm_minor}.${config.jm_micro}${config.jm_patch}"
  35. replace "@MCVERSION@", config.minecraft_version
  36. replace "@FORGEVERSION@", config.forge_version
  37. replace "@MAJOR@", config.jm_major
  38. replace "@MINOR@", config.jm_minor
  39. replace "@MICRO@", config.jm_micro
  40. replace "@PATCH@", config.jm_patch
  41. mappings = "${config.snapshot}"
  42. }
  43.  
  44. dependencies {
  45. compile fileTree(dir: 'libs', include: '*.*');
  46. }
  47.  
  48. processResources {
  49. // this will ensure that this task is redone when the versions change.
  50. inputs.property "version", project.version
  51. inputs.property "mcversion", project.minecraft.version
  52.  
  53. from(sourceSets.main.resources.srcDirs) {
  54. include 'license.txt'
  55. expand 'version': project.version, 'mcversion': project.minecraft.version, 'date' : getDate()
  56. }
  57. // copy everything else, thats not the mcmod.info
  58. from(sourceSets.main.resources.srcDirs) {
  59. exclude 'mcmod.info'
  60. exclude 'license.txt'
  61. }
  62. }
  63.  
  64. def getDate() {
  65. def date = new Date()
  66. def formattedDate = date.format(config.dateFormat)
  67. return formattedDate
  68. }
Advertisement
Add Comment
Please, Sign In to add comment