aboutsummaryrefslogtreecommitdiff
path: root/build.gradle
blob: c955edb0ede0555ef653b52657a3a590800f1e82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import java.nio.file.Files

plugins {
    id 'fabric-loom' version '0.11-SNAPSHOT' apply false
    id 'io.shcm.shsupercm.fabric.fletchingtable' version '1.4' apply false
    id 'com.modrinth.minotaur' version '2.+' apply false
    id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
}

version = project.mod_version + "+" + project.minecraft_version
group = project.maven_group

allprojects {
    apply plugin: "fabric-loom"
    apply plugin: "io.shcm.shsupercm.fabric.fletchingtable"

    repositories {
        maven { url "https://maven.shedaniel.me/" }
        maven { url "https://maven.terraformersmc.com/releases" }
        maven { url "https://cursemaven.com" }
    }

    dependencies {
        minecraft "com.mojang:minecraft:${project.minecraft_version}"
        mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
        modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

        modImplementation fabricApi.module("fabric-api-base", "${project.fabric_api}")
        modImplementation fabricApi.module("fabric-resource-loader-v0", "${project.fabric_api}")
        modImplementation fabricApi.module("fabric-command-api-v1", "${project.fabric_api}")

        modCompileOnly("com.terraformersmc:modmenu:${project.modmenu}") {
            exclude(group: "net.fabricmc.fabric-api")
        }

        modCompileOnly("me.shedaniel.cloth:cloth-config-fabric:${project.cloth}") {
            exclude(group: "net.fabricmc.fabric-api")
        }
    }

    fletchingTable {
        defaultMixinEnvironment = "auto"
    }

    processResources {
        inputs.property "version", rootProject.version
        filteringCharset "UTF-8"

        filesMatching("fabric.mod.json") {
            expand "version": rootProject.version
        }
    }

    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17

    java {
        archivesBaseName = project.archives_base_name
    }

    jar {
        archiveClassifier.set "dev"

        from("LICENSE") {
            rename { "${it}_${project.archivesBaseName}" }
        }
    }

    loom {
        shareCaches()
    }
}

apply plugin: 'com.modrinth.minotaur'
apply plugin: 'com.matthewprenger.cursegradle'

loom {
    accessWidenerPath = file("src/main/resources/citresewn.accesswidener")
}

dependencies {
    afterEvaluate {
        include project("defaults:")
    }
}

java {
    withSourcesJar()
}

sourcesJar {
    from project("defaults:").sourceSets.main.java.srcDirs
}

modrinth {
    token = TOKEN_MODRINTH
    projectId = "otVJckYQ"
    uploadFile = remapJar
    changelog = Files.readString(projectDir.toPath().resolve("Changelog.md"))
    versionNumber = version
    versionName = "v" + version
    additionalFiles = [ sourcesJar.outputs.getFiles().singleFile ]
    gameVersions = ["1.18", "1.18.1", "1.18.2"]
}

curseforge {
    apiKey = TOKEN_CURSEFORGE
    project {
        id = '521427'
        changelogType = 'markdown'
        changelog = file('Changelog.md')
        releaseType = 'release'
        mainArtifact(remapJar) {
            displayName = "v" + version
        }
        addGameVersion 'Fabric'
        addGameVersion '1.18'
        addGameVersion '1.18.1'
        addGameVersion '1.18.2'
    }
    options {
        forgeGradleIntegration = false
    }
}