/Sonar

Some simple utilities that are used in all of my mods

Primary LanguageJavaGNU Lesser General Public License v2.1LGPL-2.1

Sonar

General 1.15 Mod utilties in one spot so they can be added to future mods without having to clone code over.

How to add to your workspace

Insert the plugins block just below buildscript.

plugins {
    id 'com.github.johnrengelman.shadow' version "4.0.4"
}

Add the shade configuration, repository, and the sonar dependency.

configurations {
    shade
}

repositories {
    maven {
        name = "JitPack"
        url = "https://jitpack.io"
    }
}

dependencies {
    compileOnly fg.deobf("com.github.Ocelot5836:Sonar:${project.sonar}:api")
    runtimeOnly fg.deobf("com.github.Ocelot5836:Sonar:${project.sonar}")
    shade "com.github.Ocelot5836.Sonar:${project.sonar}"
}

These remaining settings are added to allow the jar to build properly.

shadowJar {
    configurations = [project.configurations.shade]
}

reobf {
    shadowJar {}
}

artifacts {
    archives jar
    archives shadowJar
}

build.dependsOn reobfShadowJar

Finally, choose the version of Sonar you wish to use and add the following to the gradle.properties

sonar=SonarVersion

Optional

If you want, you can add this so Sonar will be compiled into a different package to allow better compatibility.

shadowJar {
    configurations = [project.configurations.shade]
    relocate 'io.github.ocelot', 'your.project.lib.ocelot'
}