build.gradle 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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-1.0"
  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. 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. // replace stuff in mcmod.info, nothing else
  53. from(sourceSets.main.resources.srcDirs) {
  54. include 'mcmod.info'
  55. // replace version and mcversion
  56. expand 'version':project.version, 'mcversion':project.minecraft.version
  57. }
  58. // copy everything else except the mcmod.info
  59. from(sourceSets.main.resources.srcDirs) {
  60. exclude 'mcmod.info'
  61. }
  62. }
  63. task signJar(type: SignJar, dependsOn: reobfJar) {
  64. // Skips if the keyStore property is missing.
  65. onlyIf {
  66. project.hasProperty('keyStore')
  67. }
  68. // findProperty allows us to reference the property without it existing.
  69. // Using project.propName would cause the script to fail validation if
  70. // the property did not exist.
  71. keyStore = project.findProperty('keyStore')
  72. alias = project.findProperty('keyStoreAlias')
  73. storePass = project.findProperty('keyStorePass')
  74. keyPass = project.findProperty('keyStoreKeyPass')
  75. inputFile = jar.archivePath
  76. outputFile = jar.archivePath
  77. }
  78. build.dependsOn signJar