Advertisement
Ocelot5836

build.gradle

Jun 29th, 2019
605
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 5.23 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: 'kotlin'
  14. apply plugin: 'eclipse'
  15. apply plugin: 'maven-publish'
  16.  
  17. version = '1.0'
  18. group = 'com.techromancer' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  19. archivesBaseName = 'techromancer'
  20.  
  21. sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
  22.  
  23. minecraft {
  24.     // The mappings can be changed at any time, and must be in the following format.
  25.     // snapshot_YYYYMMDD   Snapshot are built nightly.
  26.     // stable_#            Stables are built at the discretion of the MCP team.
  27.     // Use non-default mappings at your own risk. they may not always work.
  28.     // Simply re-run your setup task after changing the mappings to update your workspace.
  29.     mappings channel: 'snapshot', version: '20190621-1.14.2'
  30.     // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  31.    
  32.     // accessTransformer = file('build/resources/main/META-INF/accesstransformer.cfg')
  33.  
  34.     // Default run configurations.
  35.     // These can be tweaked, removed, or duplicated as needed.
  36.     runs {
  37.         client {
  38.             workingDirectory project.file('run')
  39.  
  40.             // Recommended logging data for a userdev environment
  41.             property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  42.  
  43.             // Recommended logging level for the console
  44.             property 'forge.logging.console.level', 'debug'
  45.  
  46.             mods {
  47.                 techromancer {
  48.                     source sourceSets.main
  49.                 }
  50.             }
  51.         }
  52.  
  53.         server {
  54.             workingDirectory project.file('run')
  55.  
  56.             // Recommended logging data for a userdev environment
  57.             property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  58.  
  59.             // Recommended logging level for the console
  60.             property 'forge.logging.console.level', 'debug'
  61.  
  62.             mods {
  63.                 techromancer {
  64.                     source sourceSets.main
  65.                 }
  66.             }
  67.         }
  68.     }
  69. }
  70.  
  71. repositories {
  72.     jcenter()
  73.     mavenCentral()
  74.     maven { url = 'https://maven.shadowfacts.net' }
  75. }
  76.  
  77. dependencies {
  78.     // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
  79.     // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
  80.     // The userdev artifact is a special name and will get all sorts of transformations applied to it.
  81.     minecraft 'net.minecraftforge:forge:1.14.2-26.0.63'
  82.  
  83.     compile 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.31'
  84.     compile 'net.shadowfacts:Forgelin:1.6.0'
  85.  
  86.     // You may put jars on which you depend on in ./libs or you may define them like so..
  87.     // compile "some.group:artifact:version:classifier"
  88.     // compile "some.group:artifact:version"
  89.  
  90.     // Real examples
  91.     // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
  92.     // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
  93.  
  94.     // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
  95.     // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  96.  
  97.     // These dependencies get remapped to your current MCP mappings
  98.     // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  99.  
  100.     // For more info...
  101.     // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
  102.     // http://www.gradle.org/docs/current/userguide/dependency_management.html
  103.  
  104. }
  105.  
  106. // Example for how to get properties into the manifest for reading by the runtime..
  107. jar {
  108.     manifest {
  109.         attributes([
  110.             "Specification-Title": "techromancer",
  111.             "Specification-Vendor": "techromancersareus",
  112.             "Specification-Version": "1", // We are version 1 of ourselves
  113.             "Implementation-Title": project.name,
  114.             "Implementation-Version": "${version}",
  115.             "Implementation-Vendor" :"techromancersareus",
  116.             "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
  117.         ])
  118.     }
  119. }
  120.  
  121. // Example configuration to allow publishing using the maven-publish task
  122. // we define a custom artifact that is sourced from the reobfJar output task
  123. // and then declare that to be published
  124. // Note you'll need to add a repository here
  125. def reobfFile = file("$buildDir/reobfJar/output.jar")
  126. def reobfArtifact = artifacts.add('default', reobfFile) {
  127.     type 'jar'
  128.     builtBy 'reobfJar'
  129. }
  130. publishing {
  131.     publications {
  132.         mavenJava(MavenPublication) {
  133.             artifact reobfArtifact
  134.         }
  135.     }
  136.     repositories {
  137.         maven {
  138.             url "file:///${project.projectDir}/mcmodsrepo"
  139.         }
  140.     }
  141. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement