Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- buildscript {
- repositories {
- jcenter()
- maven { url 'http://files.minecraftforge.net/maven' }
- maven { url 'http://repo.spongepowered.org/maven' }
- maven { url 'https://www.jitpack.io' }
- }
- dependencies {
- classpath 'com.github.Chocohead:ForgeGradle:jitpack-SNAPSHOT'
- classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
- }
- }
- apply plugin: 'net.minecraftforge.gradle.tweaker-client'
- apply plugin: 'org.spongepowered.mixin'
- apply plugin: 'java'
- apply plugin: 'maven-publish'
- sourceCompatibility = 1.8
- targetCompatibility = 1.8
- repositories {
- mavenCentral()
- maven { url 'https://www.dimdev.org/maven/' }
- maven { url 'https://www.jitpack.io' }
- }
- dependencies {
- implementation 'com.github.Chocohead:Rift:jitpack-SNAPSHOT:dev'
- }
- ext.configFile = file "build.properties"
- configFile.withReader {
- def prop = new Properties()
- prop.load(it)
- project.ext.config = new ConfigSlurper().parse prop
- }
- minecraft {
- version = config.minecraft_version
- mappings = config.mappings_version
- runDir = 'minecraft'
- makeObfSourceJar = false
- tweakClass = 'org.dimdev.riftloader.launch.RiftLoaderClientTweaker'
- ext.mod_version = config.mod_version
- if (mod_version.endsWith('-dev')) {
- mod_version = mod_version + "." + new Date().format('yyyyMMdd.HHmmss')
- }
- replaceIn "MaLiLibReference.java"
- replace "@MOD_VERSION@", mod_version
- }
- compileJava {
- sourceCompatibility = 1.8
- targetCompatibility = 1.8
- options.encoding = 'UTF-8'
- }
- /*
- sourceSets {
- main {
- ext.refMap = 'mixins.' + config.mod_id + '.refmap.json'
- }
- }
- */
- group = config.group + "." + config.mod_id // http://maven.apache.org/guides/mini/guide-naming-conventions.html
- archivesBaseName = config.mod_file_name + '-' + config.minecraft_version_out
- version = project.minecraft.mod_version
- /**
- * This section allows you to customise the generated riftmod.json file
- */
- /*
- riftmod {
- json {
- id = config.mod_id
- name = config.mod_name
- version = config.mod_version
- authors = [ config.author ]
- // Uncomment any of the following lines and fill in your own details as required
- //dependsOn = [ 'modid', 'othermod' ]
- //requiredAPIs = [ 'someapi' ]
- //tweakClass = 'name.of.tweaker.here'
- mixinConfigs = [ 'mixins.' + config.mod_id + '.json' ]
- }
- }
- */
- /**
- * This section allows you to customise your generated jar (litemod) file. By
- * default it includes the generated litemod.json file, however if you prefer to
- * include your own file from resources, simply remove the line below.
- */
- jar {
- // Remove the "-mc1.12" suffix from the file name
- //classifier = ""
- // Don't append a 'mod-' filename prefix >_>
- baseName = archivesBaseName
- //from litemod.outputs
- /*
- manifest.mainAttributes (
- 'Built-By': System.properties['user.name'],
- 'Created-By': System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
- 'Implementation-Title': config.mod_id,
- 'Implementation-Version': project.version
- )
- */
- }
- mixin {
- defaultObfuscationEnv notch
- add sourceSets.main, 'mixins.' + config.mod_id + '.refmap.json'
- }
- //tasks.withType(Jar)*.baseName = archivesBaseName
- processResources
- {
- // Exclude the GIMP image files
- exclude '**/*.xcf'
- exclude '**/xcf'
- // this will ensure that this task is redone when the versions change.
- inputs.property "mod_version", project.minecraft.mod_version
- inputs.property "minecraft_version", project.config.minecraft_version
- // replace stuff in mcmod.info, nothing else
- from(sourceSets.main.resources.srcDirs) {
- include 'mcmod.info'
- // replace version and mcversion
- expand 'mod_version': project.minecraft.mod_version, 'minecraft_version': project.config.minecraft_version
- }
- // copy everything else, thats not the mcmod.info
- from(sourceSets.main.resources.srcDirs) {
- exclude 'mcmod.info'
- }
- }
- task deobfJar(type: Jar) {
- from sourceSets.main.output
- // This classifier is standard and should not be changed
- classifier = 'deobf'
- }
- // This section enables the last two tasks
- artifacts {
- //archives sourcesJar
- archives deobfJar
- }
- tasks.publish.dependsOn build
- publishing {
- publications {
- mavenJava(MavenPublication) {
- artifactId project.archivesBaseName
- from components.java
- artifact deobfJar
- artifact sourceJar
- }
- }
- repositories {
- maven {
- url "$projectDir/../../CommonMaven"
- }
- }
- }
- build.properties:
- group = dasd
- mod_id = skyblockaddons
- mod_name = SkyblockAddons
- author = biscuit
- mod_file_name = SkyblockAddons-rift
- # Current mod version
- mod_version = 1.0
- # Minecraft, Forge and MCP mappings versions
- minecraft_version_out = 1.13.2
- minecraft_version = 1.13.2
- mappings_version = snapshot_20181130
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement