build.gradle 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. buildscript {
  2. repositories {
  3. mavenLocal()
  4. maven { url = 'https://files.minecraftforge.net/maven' }
  5. jcenter()
  6. mavenCentral()
  7. }
  8. // This is only here while i'm activly developing FG, Remind me to remove when we publically release
  9. configurations {
  10. classpath.resolutionStrategy {
  11. cacheDynamicVersionsFor 10, 'seconds'
  12. cacheChangingModulesFor 0, 'seconds'
  13. }
  14. }
  15. dependencies {
  16. classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
  17. }
  18. }
  19. apply plugin: 'net.minecraftforge.gradle'
  20. //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
  21. apply plugin: 'eclipse'
  22. version = '4.0.0'
  23. group = 'com.blamejared.controlling' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  24. archivesBaseName = 'Controlling'
  25. sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
  26. compileJava {
  27. sourceCompatibility = targetCompatibility = '1.8'
  28. }
  29. minecraft {
  30. // the mappings can be changed at any time, and must be in the following format.
  31. // snapshot_YYYYMMDD snapshot are built nightly.
  32. // stable_# stables are built at the discretion of the MCP team.
  33. // Use non-default mappings at your own risk. they may not always work.
  34. // simply re-run your setup task after changing the mappings to update your workspace.
  35. mappings channel: 'snapshot', version: '20180921-1.13'
  36. // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  37. accessTransformer = file('controlling_at.cfg')
  38. // default run configurations.
  39. // these can be tweaked, removed, or duplicated as needed.
  40. runConfig {
  41. name= "Minecraft Client"
  42. main= "net.minecraftforge.userdev.UserdevLauncher"
  43. ideaModuleName = "${project.name}_main"
  44. workingDirectory = project.file("run").canonicalPath
  45. environment "target", "fmldevclient"
  46. environment "assetDirectory", downloadAssets.output.absolutePath
  47. }
  48. runConfig {
  49. name= "Minecraft Server"
  50. main= "net.minecraftforge.userdev.UserdevLauncher"
  51. ideaModuleName = "${project.name}_main"
  52. workingDirectory = project.file("run").canonicalPath
  53. environment "target", "fmldevserver"
  54. environment "assetDirectory", downloadAssets.output.absolutePath
  55. }
  56. }
  57. dependencies {
  58. // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
  59. // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
  60. minecraft 'net.minecraftforge.test:forge:1.13-24.0.35-1.13-pre'
  61. // you may put jars on which you depend on in ./libs
  62. // or you may define them like so..
  63. //compile "some.group:artifact:version:classifier"
  64. //compile "some.group:artifact:version"
  65. // real examples
  66. //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
  67. //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
  68. // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
  69. //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  70. // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
  71. // except that these dependencies get remapped to your current MCP mappings
  72. //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  73. //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  74. // for more info...
  75. // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
  76. // http://www.gradle.org/docs/current/userguide/dependency_management.html
  77. }
  78. processResources {
  79. // this will ensure that this task is redone when the versions change.
  80. inputs.property 'version', project.version
  81. inputs.property 'mcversion', '1.13'
  82. // replace stuff in mcmod.info, nothing else
  83. from(sourceSets.main.resources.srcDirs) {
  84. include 'META_INF/mods.toml'
  85. // replace version and mcversion
  86. expand 'version':project.version, 'mcversion': '1.13'
  87. }
  88. // copy everything else except the mcmod.info
  89. from(sourceSets.main.resources.srcDirs) {
  90. exclude 'META_INF/mods.toml'
  91. }
  92. }