Advertisement
TurtyWurty

build.gradle

Feb 2nd, 2022
2,605
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 3.53 KB | None | 0 0
  1. buildscript {
  2.     repositories {
  3.         maven { url = 'https://maven.minecraftforge.net' }
  4.         maven { url = 'https://maven.parchmentmc.org' }
  5.         mavenCentral()
  6.     }
  7.    
  8.     dependencies {
  9.         classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
  10.         classpath 'org.parchmentmc:librarian:1.+'
  11.     }
  12. }
  13. apply plugin: 'net.minecraftforge.gradle'
  14. apply plugin: 'org.parchmentmc.librarian.forgegradle'
  15. apply plugin: 'eclipse'
  16. apply plugin: 'maven-publish'
  17.  
  18. version = '1.0'
  19. group = 'io.github.darealturtywurty.beansmod'
  20. archivesBaseName = 'beansmod'
  21. java.toolchain.languageVersion = JavaLanguageVersion.of(17)
  22.  
  23. println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
  24. minecraft {
  25.     mappings channel: 'parchment', version: '2022.01.23-1.18.1'
  26.  
  27.     accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
  28.  
  29.     runs {
  30.         client {
  31.             workingDirectory project.file('run')
  32.             arg "-mixin.config=" + archivesBaseName + ".mixins.json"
  33.             property 'mixin.env.remapRefMap', 'true'
  34.             property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
  35.  
  36.             mods {
  37.                 beansmod {
  38.                     source sourceSets.main
  39.                 }
  40.             }
  41.         }
  42.  
  43.         server {
  44.             workingDirectory project.file('run')
  45.             arg "-mixin.config=" + archivesBaseName + ".mixins.json"
  46.             property 'mixin.env.remapRefMap', 'true'
  47.             property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
  48.  
  49.             mods {
  50.                 beansmod {
  51.                     source sourceSets.main
  52.                 }
  53.             }
  54.         }
  55.  
  56.         data {
  57.             workingDirectory project.file('run')
  58.  
  59.             args '--mod', archivesBaseName, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
  60.  
  61.             mods {
  62.                 beansmod {
  63.                     source sourceSets.main
  64.                 }
  65.             }
  66.         }
  67.     }
  68. }
  69.  
  70. sourceSets.main.resources { srcDir 'src/generated/resources' }
  71.  
  72. repositories {
  73.     // JEI maven
  74.     maven {
  75.         name = "Progwml6 maven"
  76.         url = "https://dvs1.progwml6.com/files/maven/"
  77.     }
  78.    
  79.     // JEI maven mirror
  80.     maven {
  81.         name = "ModMaven"
  82.         url = "https://modmaven.dev"
  83.     }
  84. }
  85.  
  86. dependencies {
  87.     minecraft 'net.minecraftforge:forge:1.18.1-39.0.64'
  88.     runtimeOnly fg.deobf("mezz.jei:jei-1.18.1:${jei_version}")
  89.  
  90.     annotationProcessor 'org.spongepowered:mixin:0.8.4:processor'
  91. }
  92.  
  93. jar {
  94.     manifest {
  95.         attributes([
  96.                 "Specification-Title"     : archivesBaseName,
  97.                 "Specification-Vendor"    : "TurtyWurty",
  98.                 "Specification-Version"   : "1",
  99.                 "Implementation-Title"    : project.name,
  100.                 "Implementation-Version"  : project.jar.archiveVersion,
  101.                 "Implementation-Vendor"   : "TurtyWurty",
  102.                 "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
  103.                 "MixinConfigs": "mixins." + archivesBaseName + ".json"
  104.         ])
  105.     }
  106. }
  107.  
  108. jar.finalizedBy('reobfJar')
  109.  
  110. publishing {
  111.     publications {
  112.         mavenJava(MavenPublication) {
  113.             artifact jar
  114.         }
  115.     }
  116.     repositories {
  117.         maven {
  118.             url "file://${project.projectDir}/mcmodsrepo"
  119.         }
  120.     }
  121. }
  122.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement