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'
- //mavenリポジトリにデプロイするなら、必要。
- //apply plugin: 'maven'
- //gradleのJavaのバージョン指定。ComplieJavaの指定のほうが重要な気がしなくもない。
- sourceCompatibility = '1.7' // -source
- targetCompatibility = '1.7' // -target
- sourceSets {
- main {
- output.resourcesDir = output.classesDir
- }
- }
- minecraft {
- version = "1.7.10-10.13.4.1564-1.7.10"
- runDir = "eclipse"
- //ソースファイル内の、該当文字列をビルド前に置き換える。mcmod.infoは別なので注意。
- replace '@VERSION@', project.version
- replace '@MC_VERSION@', version
- }
- version = "1.0.0"
- archivesBaseName = project.projectDir.name
- //コンパイル時の文字コード指定とJavaのバージョン指定。
- //[compileJava, compileTestJava,compileApiJava,recompMinecraft, makeStart].each{
- //it.options.encoding = 'UTF-8'
- //it.options.compilerArgs += ['-source', '1.7', '-target', '1.7']
- //}
- //上と同じ。記述法が違うだけ。
- compileJava {
- options.encoding = 'UTF-8'
- options.compilerArgs += ['-source', '1.7', '-target', '1.7']
- }
- //ビルドしたjarを共通のフォルダに打ち込む。マルチプロジェクト故致し方なし。
- task copyBuiltJar(type:Copy, dependsOn:build) {
- from('build/libs')
- into('../Build-Mods')
- }
- //Copyするだけ。ビルドしない。
- task copyAllJar(type:Copy) {
- from('build/libs')
- into('../Build-Mods')
- }
- //ソースを出力。1.8では標準で出力される。
- task sourceJar(type: Jar) {
- from sourceSets.main.allSource
- classifier = 'sources'
- }
- //開発用jar出力。
- task deobfJar(type: Jar) {
- from sourceSets.main.output
- classifier = 'dev'
- }
- }
- //jarのマニフェストに記述を追加する場合。
- //jar {
- // manifest {
- // attributes 'FMLCorePlugin' : 'ak.sampleMod.asm.SampleCorePlugin','FMLCorePluginContainsFMLMod':'ak.sampleMod.SampleMod'
- //}
- //}
- //依存指定。
- dependencies {
- //compile fileTree(dir: 'Libraries', include: 'CodeChickenCore*.jar')
- //compile fileTree(dir: 'Libraries', include: 'NotEnoughItems*.jar')
- //compile project(':StorageBox'), files('lib/InventoryTweaks-api-1.57-116.jar')
- //compile "codechicken:CodeChickenLib:1.7.10-1.1.1.106:dev"
- compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
- //compile 'net.industrial-craft:industrialcraft-2:2.1.470-experimental:api'
- //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
- // you may put jars on which you depend on in ./libs
- // or you may define them like so..
- //compile "some.group:artifact:version:classifier"
- //compile "some.group:artifact:version"
- // real examples
- //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
- // for more info...
- // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
- // http://www.gradle.org/docs/current/userguide/dependency_management.html
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement