Advertisement
akSource

build.gradle file

Jul 5th, 2014
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 2.48 KB | None | 0 0
  1. buildscript {
  2.     repositories {
  3.         mavenCentral()
  4.         //mavenLocal()
  5.         maven {
  6.             name = "forge"
  7.             url = "http://files.minecraftforge.net/maven"
  8.         }
  9.         maven {
  10.             name = "sonatype"
  11.             url = "https://oss.sonatype.org/content/repositories/snapshots/"
  12.         }
  13.     }
  14.     dependencies {
  15.         classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
  16.     }
  17. }
  18. //マルチプロジェクト用。あまり気にしない。
  19. allprojects {
  20.     apply plugin: 'forge'
  21.  
  22.     minecraft {
  23.         //version = "1.7.10_pre4-10.12.2.1148-prerelease"
  24.         version = "1.7.10-10.13.0.1157"
  25.         assetDir = "eclipse/assets"
  26.        
  27.         // replacing stuff in the source
  28.         replace '@VERSION@', project.version
  29.         replace '@MC_VERSION@', version
  30.     }
  31.  
  32.     version = "1.0.0"
  33.  
  34.     archivesBaseName = project.projectDir.name
  35.     //コンパイル時の文字コード指定とJavaのバージョン指定。
  36.   [compileJava, compileTestJava,recompMinecraft].each{
  37.         it.options.encoding = 'UTF-8'
  38.         it.options.compilerArgs += ['-source', '1.7', '-target', '1.7']
  39.     }
  40.     //ビルドしたjarを共通のフォルダに打ち込む。マルチプロジェクト故致し方なし。
  41.      task  copyBuiltJar(type:Copy, dependsOn:build) {
  42.         from('build/libs')
  43.         into('../Build-Mods')
  44.     }
  45. }
  46.  
  47. //APIや、他MODとの依存関係
  48. dependencies {
  49.         //こいつを良く使う。
  50. //    compile fileTree(dir: 'libraries', include: '*.jar')
  51.     //こんな風にも書ける。
  52.     //compile project(':StorageBox'), files('lib/InventoryTweaks-api-1.57-116.jar')
  53.         //mavenリポジトリが公開されてたら、以下のような指定で、らくできる。
  54.     //compile "codechicken:CodeChickenLib:1.7.2-1.1.0.76:dev"
  55.     //compile 'net.industrial-craft:industrialcraft-2:2.1.470-experimental:api'
  56.     //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  57. }
  58. processResources
  59. {
  60.     // replace stuff in mcmod.info, nothing else
  61.     from(sourceSets.main.resources.srcDirs) {
  62.         include 'mcmod/info'
  63.                
  64.         // replace version and mcversion
  65.         // ${version}   and    ${mcversion}    are the exact strings being replaced
  66.         expand 'version':project.version, 'mcversion':project.minecraft.version
  67.     }
  68.        
  69.     // copy everything else, thats not the mcmod.info
  70.     from(sourceSets.main.resources.srcDirs) {
  71.         exclude 'mcmod.info'
  72.     }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement