Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- buildscript {
- repositories {
- mavenCentral()
- //mavenLocal()
- maven {
- name = "forge"
- url = "http://files.minecraftforge.net/maven"
- }
- maven {
- name = "sonatype"
- url = "https://oss.sonatype.org/content/repositories/snapshots/"
- }
- }
- dependencies {
- classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
- }
- }
- //マルチプロジェクト用。あまり気にしない。
- allprojects {
- apply plugin: 'forge'
- minecraft {
- //version = "1.7.10_pre4-10.12.2.1148-prerelease"
- version = "1.7.10-10.13.0.1157"
- assetDir = "eclipse/assets"
- // replacing stuff in the source
- replace '@VERSION@', project.version
- replace '@MC_VERSION@', version
- }
- version = "1.0.0"
- archivesBaseName = project.projectDir.name
- //コンパイル時の文字コード指定とJavaのバージョン指定。
- [compileJava, compileTestJava,recompMinecraft].each{
- it.options.encoding = 'UTF-8'
- it.options.compilerArgs += ['-source', '1.7', '-target', '1.7']
- }
- //ビルドしたjarを共通のフォルダに打ち込む。マルチプロジェクト故致し方なし。
- task copyBuiltJar(type:Copy, dependsOn:build) {
- from('build/libs')
- into('../Build-Mods')
- }
- }
- //APIや、他MODとの依存関係
- dependencies {
- //こいつを良く使う。
- // compile fileTree(dir: 'libraries', include: '*.jar')
- //こんな風にも書ける。
- //compile project(':StorageBox'), files('lib/InventoryTweaks-api-1.57-116.jar')
- //mavenリポジトリが公開されてたら、以下のような指定で、らくできる。
- //compile "codechicken:CodeChickenLib:1.7.2-1.1.0.76:dev"
- //compile 'net.industrial-craft:industrialcraft-2:2.1.470-experimental:api'
- //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
- }
- processResources
- {
- // replace stuff in mcmod.info, nothing else
- from(sourceSets.main.resources.srcDirs) {
- include 'mcmod/info'
- // replace version and mcversion
- // ${version} and ${mcversion} are the exact strings being replaced
- expand 'version':project.version, 'mcversion':project.minecraft.version
- }
- // copy everything else, thats not the mcmod.info
- from(sourceSets.main.resources.srcDirs) {
- exclude 'mcmod.info'
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement