Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 5.59 KB | None | 0 0
  1. buildscript {
  2.     repositories {
  3.         maven { url = 'https://files.minecraftforge.net/maven' }
  4.         jcenter()
  5.         mavenCentral()
  6.     }
  7.     dependencies {
  8.         classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
  9.     }
  10. }
  11. apply plugin: 'net.minecraftforge.gradle'
  12. // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
  13. apply plugin: 'eclipse'
  14. apply plugin: 'maven-publish'
  15.  
  16. version = '1.0'
  17. group = 'me.test.ftblocks' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  18. archivesBaseName = 'ftblocks'
  19.  
  20. sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
  21.  
  22. minecraft {
  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 channel: 'snapshot', version: '20190719-1.14.3'
  29.     // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  30.    
  31.     // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
  32.  
  33.     // Default run configurations.
  34.     // These can be tweaked, removed, or duplicated as needed.
  35.     runs {
  36.         client {
  37.             workingDirectory project.file('run')
  38.  
  39.             // Recommended logging data for a userdev environment
  40.             property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  41.  
  42.             // Recommended logging level for the console
  43.             property 'forge.logging.console.level', 'debug'
  44.  
  45.             mods {
  46.                 examplemod {
  47.                     source sourceSets.main
  48.                 }
  49.             }
  50.         }
  51.  
  52.         server {
  53.             workingDirectory project.file('run')
  54.  
  55.             // Recommended logging data for a userdev environment
  56.             property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  57.  
  58.             // Recommended logging level for the console
  59.             property 'forge.logging.console.level', 'debug'
  60.  
  61.             mods {
  62.                 examplemod {
  63.                     source sourceSets.main
  64.                 }
  65.             }
  66.         }
  67.  
  68.         data {
  69.             workingDirectory project.file('run')
  70.  
  71.             // Recommended logging data for a userdev environment
  72.             property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  73.  
  74.             // Recommended logging level for the console
  75.             property 'forge.logging.console.level', 'debug'
  76.  
  77.             args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/')
  78.  
  79.             mods {
  80.                 examplemod {
  81.                     source sourceSets.main
  82.                 }
  83.             }
  84.         }
  85.     }
  86. }
  87.  
  88. dependencies {
  89.     // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
  90.     // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
  91.     // The userdev artifact is a special name and will get all sorts of transformations applied to it.
  92.     minecraft 'net.minecraftforge:forge:1.14.4-28.0.49'
  93.  
  94.     compile 'org.codehaus.groovy:groovy-all:2.3.11'
  95.  
  96.     // You may put jars on which you depend on in ./libs or you may define them like so..
  97.     // compile "some.group:artifact:version:classifier"
  98.     // compile "some.group:artifact:version"
  99.  
  100.     // Real examples
  101.     // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
  102.     // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
  103.  
  104.     // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
  105.     // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  106.  
  107.     // These dependencies get remapped to your current MCP mappings
  108.     // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  109.  
  110.     // For more info...
  111.     // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
  112.     // http://www.gradle.org/docs/current/userguide/dependency_management.html
  113.  
  114. }
  115.  
  116. // Example for how to get properties into the manifest for reading by the runtime..
  117. jar {
  118.     manifest {
  119.         attributes([
  120.             "Specification-Title": "examplemod",
  121.             "Specification-Vendor": "examplemodsareus",
  122.             "Specification-Version": "1", // We are version 1 of ourselves
  123.             "Implementation-Title": project.name,
  124.             "Implementation-Version": "${version}",
  125.             "Implementation-Vendor" :"examplemodsareus",
  126.             "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
  127.         ])
  128.     }
  129. }
  130.  
  131. // Example configuration to allow publishing using the maven-publish task
  132. // we define a custom artifact that is sourced from the reobfJar output task
  133. // and then declare that to be published
  134. // Note you'll need to add a repository here
  135. def reobfFile = file("$buildDir/reobfJar/output.jar")
  136. def reobfArtifact = artifacts.add('default', reobfFile) {
  137.     type 'jar'
  138.     builtBy 'reobfJar'
  139. }
  140. publishing {
  141.     publications {
  142.         mavenJava(MavenPublication) {
  143.             artifact reobfArtifact
  144.         }
  145.     }
  146.     repositories {
  147.         maven {
  148.             url "file:///${project.projectDir}/mcmodsrepo"
  149.         }
  150.     }
  151. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement