Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 7.13 KB | None | 0 0
  1. buildscript {
  2.     repositories {
  3.         maven { url = 'https://files.minecraftforge.net/maven' }
  4.         jcenter()
  5.         mavenCentral()
  6.         maven {
  7.             name = 'sponge'
  8.             url = 'https://repo.spongepowered.org/maven'
  9.         }
  10.     }
  11.     dependencies {
  12.         classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
  13.         classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
  14.     }
  15. }
  16. plugins {
  17.     id 'java'
  18.     id "org.jetbrains.kotlin.jvm" version "1.3.61"
  19. }
  20. apply plugin: 'net.minecraftforge.gradle'
  21. // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
  22. apply plugin: 'eclipse'
  23. apply plugin: 'maven-publish'
  24. apply plugin: 'org.spongepowered.mixin'
  25.  
  26. version = "1.0.0"
  27. group = "ru.poopycoders.primality" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  28. archivesBaseName = "Primality"
  29.  
  30. sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
  31.  
  32. compileKotlin {
  33.     kotlinOptions {
  34.         jvmTarget = "1.8"
  35.     }
  36. }
  37.  
  38. compileTestKotlin {
  39.     kotlinOptions {
  40.         jvmTarget = "1.8"
  41.     }
  42. }
  43.  
  44. sourceSets {
  45.     main {
  46.         ext.refMap = "mixins.primality.refmap.json"
  47.     }
  48. }
  49.  
  50. minecraft {
  51.     // The mappings can be changed at any time, and must be in the following format.
  52.     // snapshot_YYYYMMDD   Snapshot are built nightly.
  53.     // stable_#            Stables are built at the discretion of the MCP team.
  54.     // Use non-default mappings at your own risk. they may not always work.
  55.     // Simply re-run your setup task after changing the mappings to update your workspace.
  56.     mappings channel: 'stable', version: '58-1.14.4'
  57.     // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  58.  
  59.     // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
  60.  
  61.     // Default run configurations.
  62.     // These can be tweaked, removed, or duplicated as needed.
  63.     runs {
  64.         client {
  65.             workingDirectory project.file('run')
  66.  
  67.             // Recommended logging data for a userdev environment
  68.             property 'forge.logging.markers', ''
  69.  
  70.             // Recommended logging level for the console
  71.             property 'forge.logging.console.level', 'debug'
  72.  
  73.             args '--mixin', 'mixins.primality.json'
  74.  
  75.             mods {
  76.                 primality {
  77.                     source sourceSets.main
  78.                 }
  79.             }
  80.         }
  81.  
  82.         server {
  83.             workingDirectory project.file('run')
  84.  
  85.             // Recommended logging data for a userdev environment
  86.             property 'forge.logging.markers', ''
  87.  
  88.             // Recommended logging level for the console
  89.             property 'forge.logging.console.level', 'debug'
  90.  
  91.             args '--mixin', 'mixins.primality.json'
  92.  
  93.             mods {
  94.                 primality {
  95.                     source sourceSets.main
  96.                 }
  97.             }
  98.         }
  99.  
  100.         data {
  101.             workingDirectory project.file('run')
  102.  
  103.             // Recommended logging data for a userdev environment
  104.             property 'forge.logging.markers', ''
  105.  
  106.             // Recommended logging level for the console
  107.             property 'forge.logging.console.level', 'debug'
  108.  
  109.             args '--mod', 'primality', '--all', '--output', file('src/generated/resources/')
  110.  
  111.             mods {
  112.                 primality {
  113.                     source sourceSets.main
  114.                 }
  115.             }
  116.         }
  117.     }
  118. }
  119.  
  120. repositories {
  121.     maven {
  122.         name = 'sponge'
  123.         url = 'https://repo.spongepowered.org/maven'
  124.     }
  125.     mavenCentral()
  126. }
  127.  
  128. configurations {
  129.     // configuration that holds jars to include in the jar
  130.     extraLibs
  131. }
  132.  
  133. dependencies {
  134.     // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
  135.     // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
  136.     // The userdev artifact is a special name and will get all sorts of transformations applied to it.
  137.     minecraft 'net.minecraftforge:forge:1.14.4-28.1.117'
  138.  
  139.     // You may put jars on which you depend on in ./libs or you may define them like so..
  140.     // compile "some.group:artifact:version:classifier"
  141.     // compile "some.group:artifact:version"
  142.  
  143.     // Real examples
  144.     // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
  145.     // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
  146.  
  147.     // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
  148.     // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  149.  
  150.     // These dependencies get remapped to your current MCP mappings
  151.     // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  152.  
  153.     // For more info...
  154.     // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
  155.     // http://www.gradle.org/docs/current/userguide/dependency_management.html
  156.  
  157.     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
  158.     //implementation "org.jetbrains.kotlin:kotlin-reflect"
  159.     //implementation "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.3.3"
  160.  
  161.     //noinspection GroovyAssignabilityCheck
  162.     extraLibs implementation('org.spongepowered:mixin:0.8-SNAPSHOT') {
  163.         // Mixin includes a lot of dependencies that are too up-to-date
  164.         exclude module: 'launchwrapper'
  165.         exclude module: 'guava'
  166.         exclude module: 'gson'
  167.         exclude module: 'commons-io'
  168.         exclude module: 'log4j-core'
  169.     }
  170.  
  171.     implementation "ru.poopycoders.coffeecore:CoffeeCore"
  172. }
  173.  
  174. // Example for how to get properties into the manifest for reading by the runtime..
  175. jar {
  176.     from {
  177.         configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
  178.     }
  179.     exclude "**/*.bbmodel"
  180.  
  181.     manifest {
  182.         attributes([
  183.                 "Specification-Title"     : "primality",
  184.                 "Specification-Vendor"    : "CoffeeInjected",
  185.                 "Specification-Version"   : "1", // We are version 1 of ourselves
  186.                 "Implementation-Title"    : project.name,
  187.                 "Implementation-Version"  : "${version}",
  188.                 "Implementation-Vendor"   : "CoffeeInjected",
  189.                 "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
  190.         ])
  191.     }
  192. }
  193.  
  194. // Example configuration to allow publishing using the maven-publish task
  195. // we define a custom artifact that is sourced from the reobfJar output task
  196. // and then declare that to be published
  197. // Note you'll need to add a repository here
  198. def reobfFile = file("$buildDir/reobfJar/output.jar")
  199. def reobfArtifact = artifacts.add('default', reobfFile) {
  200.     type 'jar'
  201.     builtBy 'reobfJar'
  202. }
  203. publishing {
  204.     publications {
  205.         mavenJava(MavenPublication) {
  206.             artifact reobfArtifact
  207.         }
  208.     }
  209.     repositories {
  210.         maven {
  211.             url "file:///${project.projectDir}/mcmodsrepo"
  212.         }
  213.     }
  214. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement