build.gradle 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. buildscript {
  2. repositories {
  3. jcenter()
  4. maven { url = "http://files.minecraftforge.net/maven" }
  5. }
  6. dependencies {
  7. classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
  8. }
  9. }
  10. apply plugin: 'net.minecraftforge.gradle.forge'
  11. //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
  12. version = "1.12.2-0.2"
  13. group = "c4.customfov" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  14. archivesBaseName = "customfov"
  15. sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
  16. compileJava {
  17. sourceCompatibility = targetCompatibility = '1.8'
  18. }
  19. minecraft {
  20. version = "1.12.2-14.23.4.2705"
  21. runDir = "run"
  22. // the mappings can be changed at any time, and must be in the following format.
  23. // snapshot_YYYYMMDD snapshot are built nightly.
  24. // stable_# stables are built at the discretion of the MCP team.
  25. // Use non-default mappings at your own risk. they may not always work.
  26. // simply re-run your setup task after changing the mappings to update your workspace.
  27. mappings = "stable_39"
  28. // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  29. }
  30. dependencies {
  31. // you may put jars on which you depend on in ./libs
  32. // or you may define them like so..
  33. //compile "some.group:artifact:version:classifier"
  34. //compile "some.group:artifact:version"
  35. // real examples
  36. //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
  37. //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
  38. // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
  39. //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  40. // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
  41. // except that these dependencies get remapped to your current MCP mappings
  42. //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  43. //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  44. // for more info...
  45. // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
  46. // http://www.gradle.org/docs/current/userguide/dependency_management.html
  47. }
  48. sourceSets {
  49. main {
  50. resources {
  51. srcDirs += 'docs'
  52. }
  53. }
  54. }
  55. processResources {
  56. // this will ensure that this task is redone when the versions change.
  57. inputs.property "version", project.version
  58. inputs.property "mcversion", project.minecraft.version
  59. // replace stuff in mcmod.info, nothing else
  60. from(sourceSets.main.resources.srcDirs) {
  61. include 'mcmod.info'
  62. // replace version and mcversion
  63. expand 'version':project.version, 'mcversion':project.minecraft.version
  64. }
  65. // copy everything else except the mcmod.info
  66. from(sourceSets.main.resources.srcDirs) {
  67. exclude 'mcmod.info'
  68. }
  69. }
  70. task signJar(type: SignJar, dependsOn: reobfJar) {
  71. // Skips if the keyStore property is missing.
  72. onlyIf {
  73. project.hasProperty('keyStore')
  74. }
  75. // findProperty allows us to reference the property without it existing.
  76. // Using project.propName would cause the script to fail validation if
  77. // the property did not exist.
  78. keyStore = project.findProperty('keyStore')
  79. alias = project.findProperty('keyStoreAlias')
  80. storePass = project.findProperty('keyStorePass')
  81. keyPass = project.findProperty('keyStoreKeyPass')
  82. inputFile = jar.archivePath
  83. outputFile = jar.archivePath
  84. }
  85. build.dependsOn signJar