Advertisement
hnOsmium0001

build.gradle

Aug 31st, 2019
970
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 4.15 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 = 'powerlessri.harmonics' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  18. archivesBaseName = 'HarmonicsCore'
  19.  
  20. sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
  21.  
  22. minecraft {
  23.     mappings channel: 'snapshot', version: '20190719-1.14.3'
  24.     // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  25.    
  26.     // accessTransformer = file('build/resources/main/META-INF/accesstransformer.cfg')
  27.  
  28.     runs {
  29.         client {
  30.             workingDirectory project.file('run')
  31.  
  32.             // Recommended logging data for a userdev environment
  33.             property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  34.  
  35.             // Recommended logging level for the console
  36.             property 'forge.logging.console.level', 'debug'
  37.  
  38.             mods {
  39.                 harmonicscore {
  40.                     source sourceSets.main
  41.                 }
  42.                 hctest {
  43.                     source sourceSets.test
  44.                 }
  45.             }
  46.         }
  47.  
  48.         server {
  49.             workingDirectory project.file('run')
  50.  
  51.             // Recommended logging data for a userdev environment
  52.             property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  53.  
  54.             // Recommended logging level for the console
  55.             property 'forge.logging.console.level', 'debug'
  56.  
  57.             mods {
  58.                 harmonicscore {
  59.                     source sourceSets.main
  60.                 }
  61.                 hctest {
  62.                     source sourceSets.test
  63.                 }
  64.             }
  65.         }
  66.  
  67.         data {
  68.             workingDirectory project.file('run')
  69.  
  70.             // Recommended logging data for a userdev environment
  71.             property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  72.  
  73.             // Recommended logging level for the console
  74.             property 'forge.logging.console.level', 'debug'
  75.  
  76.             args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/')
  77.  
  78.             mods {
  79.                 harmonicscore {
  80.                     source sourceSets.main
  81.                 }
  82.                 hctest {
  83.                     source sourceSets.test
  84.                 }
  85.             }
  86.         }
  87.     }
  88. }
  89.  
  90. dependencies {
  91.     minecraft 'net.minecraftforge:forge:1.14.4-28.0.74'
  92. }
  93.  
  94. // Example for how to get properties into the manifest for reading by the runtime..
  95. jar {
  96.     manifest {
  97.         attributes([
  98.             "Specification-Title": "harmonicscore",
  99.             "Specification-Vendor": "harmonicscoresareus",
  100.             "Specification-Version": "1", // We are version 1 of ourselves
  101.             "Implementation-Title": project.name,
  102.             "Implementation-Version": "${version}",
  103.             "Implementation-Vendor" :"harmonicscoresareus",
  104.             "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
  105.         ])
  106.     }
  107. }
  108.  
  109. // Example configuration to allow publishing using the maven-publish task
  110. // we define a custom artifact that is sourced from the reobfJar output task
  111. // and then declare that to be published
  112. // Note you'll need to add a repository here
  113. def reobfFile = file("$buildDir/reobfJar/output.jar")
  114. def reobfArtifact = artifacts.add('default', reobfFile) {
  115.     type 'jar'
  116.     builtBy 'reobfJar'
  117. }
  118. publishing {
  119.     publications {
  120.         mavenJava(MavenPublication) {
  121.             artifact reobfArtifact
  122.         }
  123.     }
  124.     repositories {
  125.         maven {
  126.             url "file:///${project.projectDir}/mcmodsrepo"
  127.         }
  128.     }
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement