init commit of working things
This commit is contained in:
commit
06a0ff2060
66 changed files with 1917 additions and 0 deletions
240
build.gradle
Normal file
240
build.gradle
Normal file
|
|
@ -0,0 +1,240 @@
|
|||
plugins {
|
||||
id "idea"
|
||||
id "maven-publish"
|
||||
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
|
||||
id "com.matthewprenger.cursegradle" version "1.4.0"
|
||||
id 'org.spongepowered.mixin' version '0.7.+'
|
||||
}
|
||||
|
||||
apply plugin: 'org.spongepowered.mixin'
|
||||
apply from: "minecraft.gradle"
|
||||
|
||||
allprojects {
|
||||
gradle.projectsEvaluated {
|
||||
tasks.withType(JavaCompile) {
|
||||
options.compilerArgs << "-Xmaxerrs" << "1000"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def getGitRef() {
|
||||
try {
|
||||
final def stdout = new ByteArrayOutputStream()
|
||||
exec {
|
||||
commandLine "git", "rev-parse", "--short", "HEAD"
|
||||
standardOutput = stdout
|
||||
}
|
||||
return stdout.toString().trim()
|
||||
} catch (final Throwable ignored) {
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
version = "${semver}+${getGitRef()}"
|
||||
group = "li.cil.oc2r"
|
||||
|
||||
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = "utf-8"
|
||||
}
|
||||
|
||||
final def hasGithubPackageCredentials =
|
||||
(project.hasProperty("gpr.user") && project.hasProperty("gpr.key")) ||
|
||||
(System.getenv("GITHUB_ACTOR") && System.getenv("GITHUB_TOKEN"))
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url "https://cursemaven.com"
|
||||
}
|
||||
maven {
|
||||
// location of the maven that hosts JEI files since January 2023
|
||||
name = "Jared's maven"
|
||||
url = "https://maven.blamejared.com/"
|
||||
}
|
||||
maven { url = "https://proxy-maven.covers1624.net/" }
|
||||
if (hasGithubPackageCredentials) {
|
||||
final def GithubPackages = [
|
||||
["fnuecke/ceres", "li.cil.ceres"],
|
||||
["fnuecke/sedna", "li.cil.sedna"],
|
||||
["fnuecke/buildroot", "li.cil.sedna"]
|
||||
]
|
||||
GithubPackages.each { final repo, final group ->
|
||||
maven {
|
||||
url = uri("https://maven.pkg.github.com/${repo}")
|
||||
credentials {
|
||||
username = project.findProperty("gpr.user") ?: System.getenv("GPR_USER")
|
||||
password = project.findProperty("gpr.key") ?: System.getenv("GPR_KEY")
|
||||
}
|
||||
content { includeGroup group }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||
annotationProcessor "org.spongepowered:mixin:0.8.5:processor"
|
||||
|
||||
// Specify the libs embedded in the library mod explicitly for local development, where
|
||||
// we can include these directly (and will have a local library mod using the local
|
||||
// versions). Can't get these to get properly resolved in the IDE otherwise (doesn't
|
||||
// pick them up via the library mod due to the embed configuration).
|
||||
if (hasGithubPackageCredentials) {
|
||||
compileOnly "li.cil.ceres:ceres:0.0.4"
|
||||
compileOnly "li.cil.sedna:sedna:2.0.8"
|
||||
compileOnly "li.cil.sedna:sedna-buildroot:0.0.8"
|
||||
}
|
||||
implementation "curse.maven:sedna-511276:3885542"
|
||||
minecraftLibrary "org.apache.commons:commons-collections4:4.4"
|
||||
|
||||
implementation fg.deobf("curse.maven:markdownmanual-502485:4873115")
|
||||
implementation fg.deobf("curse.maven:architectury-api-419699:5137938")
|
||||
|
||||
compileOnly fg.deobf("mezz.jei:jei-1.20.1-common-api:15.3.0.4")
|
||||
compileOnly fg.deobf("mezz.jei:jei-1.20.1-forge-api:15.3.0.4")
|
||||
|
||||
runtimeOnly fg.deobf("mezz.jei:jei-1.20.1-forge:15.3.0.4")
|
||||
|
||||
compileOnly fg.deobf("mrtjp:ProjectRed:${minecraft_version}-${pr_version}:api")
|
||||
runtimeOnly fg.deobf("io.codechicken:CodeChickenLib:${minecraft_version}-${ccl_version}:universal")
|
||||
runtimeOnly fg.deobf("io.codechicken:CBMultipart:${minecraft_version}-${cbm_version}:universal")
|
||||
runtimeOnly fg.deobf("mrtjp:ProjectRed:${minecraft_version}-${pr_version}:core")
|
||||
runtimeOnly fg.deobf("mrtjp:ProjectRed:${minecraft_version}-${pr_version}:transmission")
|
||||
|
||||
if (debug_embeddium)
|
||||
{
|
||||
runtimeOnly fg.deobf("curse.maven:embeddium-908741:5521846")
|
||||
}
|
||||
|
||||
if (debug_embeddium_plus_plus)
|
||||
{
|
||||
runtimeOnly fg.deobf("curse.maven:embeddiumplus-931925:5436746")
|
||||
}
|
||||
|
||||
if (debug_oculus)
|
||||
{
|
||||
runtimeOnly fg.deobf("curse.maven:oculus-581495:5299671")
|
||||
}
|
||||
|
||||
testImplementation "org.mockito:mockito-inline:4.3.1"
|
||||
testImplementation "org.junit.jupiter:junit-jupiter-api:5.8.2"
|
||||
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.8.2"
|
||||
implementation fg.deobf("curse.maven:oc2r-1037738:5544316")
|
||||
}
|
||||
|
||||
System.setProperty("line.separator", "\n")
|
||||
|
||||
minecraft {
|
||||
mappings channel: "official", version: minecraft_version
|
||||
|
||||
runs {
|
||||
all {
|
||||
property "forge.logging.markers", "REGISTRIES"
|
||||
property "forge.logging.console.level", "debug"
|
||||
|
||||
mods {
|
||||
librecomponents {
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
client {
|
||||
workingDirectory project.file("runclient")
|
||||
property "forge.enabledGameTestNamespaces", "librecomponents"
|
||||
}
|
||||
|
||||
server {
|
||||
workingDirectory project.file("run")
|
||||
property "forge.enabledGameTestNamespaces", "librecomponents"
|
||||
arg "--nogui"
|
||||
}
|
||||
|
||||
gameTestServer {
|
||||
workingDirectory project.file('run')
|
||||
property "forge.enabledGameTestNamespaces", "librecomponents"
|
||||
}
|
||||
|
||||
data {
|
||||
workingDirectory project.file("run")
|
||||
args "--mod", "librecomponents", "--all", "--output", file("src/generated/resources/"), "--existing", file("src/main/resources")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task copyGeneratedResources(type: Copy) {
|
||||
from "src/generated"
|
||||
into "src/main"
|
||||
exclude "resources/.cache"
|
||||
}
|
||||
|
||||
jar {
|
||||
finalizedBy "reobfJar"
|
||||
|
||||
manifest {
|
||||
attributes([
|
||||
"FMLAT" : "accesstransformer.cfg",
|
||||
"Specification-Title" : "librecomponents",
|
||||
"Specification-Vendor" : "The Realm 18 Studios",
|
||||
"Specification-Version" : "1",
|
||||
"Implementation-Title" : project.name,
|
||||
"Implementation-Version" : "${semver}",
|
||||
"Implementation-Vendor" : "The Realm 18 Studios",
|
||||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
||||
"MixinConfigs" : "mixins.ld.json",
|
||||
"ContainedDeps" : "commons-collections4-4.4.jar"
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
groupId = project.group
|
||||
artifactId = project.name
|
||||
version = semver
|
||||
artifact jar
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
name = "GitHubPackages"
|
||||
url = System.getenv("GITHUB_MAVEN_URL") ?: ""
|
||||
credentials {
|
||||
username = System.getenv("GITHUB_ACTOR")
|
||||
password = System.getenv("GITHUB_TOKEN")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
//curseforge {
|
||||
// apiKey = System.getenv("CURSEFORGE_API_KEY") ?: ""
|
||||
// project {
|
||||
// id = curse_project_id
|
||||
// releaseType = System.getenv('CURSEFORGE_RELEASE_TYPE') ?: "alpha"
|
||||
// changelogType = 'markdown'
|
||||
// changelog = System.getenv("CHANGELOG") ?: "Changelog not available."
|
||||
// addGameVersion "Forge"
|
||||
// addGameVersion minecraft_version
|
||||
// addGameVersion "Java 17"
|
||||
// relations {
|
||||
// requiredDependency "markdownmanual"
|
||||
// requiredDependency "sedna"
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
idea {
|
||||
module {
|
||||
for (final String exclude in ["assets", "run", "out", "logs", "src/generated"]) {
|
||||
excludeDirs += file(exclude)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue