build.gradle 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. buildscript {
  2. repositories {
  3. jcenter()
  4. maven { url = "http://files.minecraftforge.net/maven" }
  5. }
  6. dependencies {
  7. classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
  8. classpath 'mysql:mysql-connector-java:5.1.42'
  9. }
  10. }
  11. apply plugin: 'net.minecraftforge.gradle.forge'
  12. //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
  13. version = "1.0"
  14. group = "me.hammerle.km" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  15. archivesBaseName = "km"
  16. sourceCompatibility = targetCompatibility = "1.8" // Need this here so eclipse task generates correctly.
  17. compileJava {
  18. sourceCompatibility = targetCompatibility = "1.8"
  19. }
  20. minecraft {
  21. version = "1.11.2-13.20.0.2303"
  22. runDir = "run"
  23. // the mappings can be changed at any time, and must be in the following format.
  24. // snapshot_YYYYMMDD snapshot are built nightly.
  25. // stable_# stables are built at the discretion of the MCP team.
  26. // Use non-default mappings at your own risk. they may not always work.
  27. // simply re-run your setup task after changing the mappings to update your workspace.
  28. mappings = "snapshot_20170525"
  29. // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  30. }
  31. dependencies {
  32. // you may put jars on which you depend on in ./libs
  33. // or you may define them like so..
  34. //compile "some.group:artifact:version:classifier"
  35. //compile "some.group:artifact:version"
  36. // real examples
  37. //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
  38. //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
  39. // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
  40. //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  41. // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
  42. // except that these dependencies get remapped to your current MCP mappings
  43. //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  44. //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  45. // for more info...
  46. // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
  47. // http://www.gradle.org/docs/current/userguide/dependency_management.html
  48. compile 'mysql:mysql-connector-java:5.1.42'
  49. }
  50. processResources {
  51. // this will ensure that this task is redone when the versions change.
  52. inputs.property "version", project.version
  53. inputs.property "mcversion", project.minecraft.version
  54. // replace stuff in mcmod.info, nothing else
  55. from(sourceSets.main.resources.srcDirs) {
  56. include 'mcmod.info'
  57. // replace version and mcversion
  58. expand 'version':project.version, 'mcversion':project.minecraft.version
  59. }
  60. // copy everything else except the mcmod.info
  61. from(sourceSets.main.resources.srcDirs) {
  62. exclude 'mcmod.info'
  63. }
  64. }