Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `import org.example.JavaModuleTransform
- plugins {
- id("net.minecraftforge.gradle") version "6.+"
- id("com.github.johnrengelman.shadow") version "7.1.2"
- id("wtf.gofancy.fancygradle") version "1.1.+"
- id("org.gradlex.extra-java-module-info") version "1.6"
- }
- apply from: "buildSrc/build.gradle"
- dependencies.registerTransform(JavaModuleTransform.class) {
- from.attributes.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, "jar")
- to.attributes.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, "jar")
- }
- buildSrc/build.gradle
- buildscript {
- repositories {
- maven { url = "https://plugins.gradle.org/m2/" }
- maven { url = "https://mvnrepository.com/artifact/" }
- jcenter()
- gradlePluginPortal()
- maven {
- name 'MinecraftForge'
- url 'https://maven.minecraftforge.net/'
- }
- maven {
- name 'Garden of Fancy'
- url 'https://maven.gofancy.wtf/releases'
- }
- maven{ url = "https://maven.mcmoddev.com/" }
- maven{ url = "https://jitpack.io" }
- maven{ url = "https://maven.apache.org/" }
- maven{ url = "https://repository.ow2.org/nexus/" }
- maven{
- url = "https://libraries.minecraft.net"
- }
- maven{ url = "https://oss.sonatype.org/content/repositories/snapshots" }
- maven{ url = "https://repo.spring.io/milestone" }
- }
- dependencies {
- classpath("gradle.plugin.com.github.johnrengelman:shadow:7.1.2")
- classpath 'net.minecraftforge.gradle:ForgeGradle:6.+'
- classpath("org.gradlex:extra-java-module-info:1.6")
- classpath group: 'wtf.gofancy.fancygradle', name: 'wtf.gofancy.fancygradle.gradle.plugin', version: '1.1.+'
- }
- }
- apply {
- plugin("java-base")
- plugin("groovy")
- plugin("eclipse")
- plugin("wtf.gofancy.fancygradle")
- plugin("org.gradlex.extra-java-module-info")
- plugin("net.minecraftforge.gradle")
- plugin("java")
- plugin("com.github.johnrengelman.shadow")
- plugin("maven-publish")
- }
- fancyGradle {
- patches {
- resources
- coremods
- codeChickenLib
- asm
- mergetool
- }
- }
- sourceSets {
- main {
- java {
- srcDirs = ["src/main/java"]
- }
- }
- }
- version = "0.1"
- java {
- toolchain {
- languageVersion.set(JavaLanguageVersion.of(8))
- }
- }
- group = "com.nullptr.mod"
- minecraft {
- mappings channel: 'stable', version: '39-1.12'
- runs {
- client {
- workingDirectory project.file('run/client')
- property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
- property 'forge.logging.console.level', 'debug'
- }
- server {
- workingDirectory project.file('run/server')
- property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
- property 'forge.logging.console.level', 'debug'
- }
- }
- }
- extraJavaModuleInfo {
- failOnMissingModuleInfo.set(false)
- }
- configurations {
- library
- implementation.extendsFrom library
- shadow.extendsFrom library
- }
- dependencies {
- implementation 'javax.inject:javax.inject:1'
- implementation "org.codehaus.groovy:groovy-all:3.0.15"
- println("123")
- minecraft("net.minecraftforge:forge:1.12.2-14.23.5.2860")
- library "org.slf4j:slf4j-api:1.7.36"
- library 'commons-io:commons-io:2.15.0'
- library "net.dv8tion:JDA:5.0.0-beta.12"
- library 'com.neovisionaries:nv-websocket-client:2.14'
- library "com.squareup.okhttp3:okhttp:4.10.0"
- library "com.fasterxml.jackson.core:jackson-databind:2.15.2"
- library "club.minnced:discord-webhooks:0.8.4"
- library "net.sf.trove4j:trove4j:3.0.3"
- library "com.theokanning.openai-gpt3-java:service:0.12.0"
- library "org.apache.commons:commons-collections4:4.4"
- }
- tasks.withType(JavaCompile).configureEach {
- options.encoding = "UTF-8"
- }
- jar {
- archiveClassifier.set("mod")
- archiveBaseName.set("mod")
- duplicatesStrategy = DuplicatesStrategy.EXCLUDE
- manifest {
- attributes([
- "Specification-Title": "examplemod",
- "Specification-Vendor": "examplemodsareus",
- "Specification-Version": "1", // We are version 1 of ourselves
- "Implementation-Title": project.name,
- "Implementation-Version": "${version}",
- "Implementation-Vendor" :"examplemodsareus",
- "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
- ])
- }
- }
- shadowJar {
- configurations = [project.configurations.shadow]
- archiveClassifier.set("")
- manifest.attributes(jar.manifest.getAttributes())
- exclude 'module-info.class'
- exclude 'META-INF/versions/9/module-info.class'
- dependencies{
- exclude(dependency('org.jetbrains:annotations'))
- exclude(dependency('com.google.code.findbugs:jsr305'))
- }
- doFirst {
- project.configurations.library.incoming.resolutionResult.allComponents {
- if (it.id instanceof ModuleComponentIdentifier) {
- relocate(it.id.group, "${project.group}.shadow.${it.id.group}")
- println(it.id.group)
- }
- }
- }
- minimize()
- }
- reobf {
- shadowJar {}
- }
- tasks.build.dependsOn reobfShadowJar
- jar.finalizedBy('reobfJar')
- artifacts {
- archives jar
- archives shadowJar
- }
- processResources {
- duplicatesStrategy = "include"
- inputs.property "version", project.version
- inputs.property "mcversion", "1.12.2"
- from(sourceSets.main.resources.srcDirs) {
- include("mcmod.info")
- expand("version": project.version, "mcversion": "1.12.2")
- }
- from(sourceSets.main.resources.srcDirs) {
- exclude("mcmod.info")
- }
- }
- publishing {
- publications {
- mavenJava(MavenPublication) {
- artifact jar
- }
- }
- repositories {
- maven {
- url "file:///${project.projectDir}/mcmodsrepo"
- }
- }
- }
- legacy {
- fixClasspath = true
- }
- `
Add Comment
Please, Sign In to add comment