Skip to content

Commit

Permalink
refactor: extract project 'common'
Browse files Browse the repository at this point in the history
  • Loading branch information
sakurawald committed Jun 4, 2024
1 parent 833af35 commit 62a19ad
Show file tree
Hide file tree
Showing 193 changed files with 34 additions and 177,022 deletions.
141 changes: 8 additions & 133 deletions build.gradle
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,139 +1,14 @@
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
id "com.modrinth.minotaur" version "2.+"
plugins{
id 'fabric-loom' version '1.6-SNAPSHOT' apply(false)
}

version = project.mod_version
group = project.maven_group
subprojects {
apply plugin: "fabric-loom"

base {
archivesName = project.archives_base_name
}

repositories {
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://jitpack.io" }
maven { url 'https://masa.dy.fi/maven' }
maven { url 'https://maven.nucleoid.xyz' }
maven { url 'https://projectlombok.org/edge-releases' }
}

loom {
// fix: adventure mod error in runServer()
// splitEnvironmentSourceSets()

accessWidenerPath = file("src/main/resources/fuji.accesswidener")

mods {
"fuji" {
sourceSet sourceSets.main
}
}

runs {
configureEach {
vmArgs("-Xms16G -Xmx16G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -XX:+UseLargePages -XX:+UseTransparentHugePages -Duser.timezone=GMT+08".split(" "))
}
}
}

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

compileOnly "org.projectlombok:lombok:${project.lombok_version}"
annotationProcessor "org.projectlombok:lombok:${project.lombok_version}"
testCompileOnly "org.projectlombok:lombok:${project.lombok_version}"
testAnnotationProcessor "org.projectlombok:lombok:${project.lombok_version}"

implementation group: 'com.google.code.gson', name: 'gson', version: "${project.gson_version}"

include(implementation(annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-fabric:${project.mixin_extras_version}")))

modImplementation("carpet:fabric-carpet:${project.carpet_core_version}")

modImplementation include("me.lucko:fabric-permissions-api:${project.fabric_permissions_version}")
modImplementation include("net.kyori:adventure-platform-fabric:${project.adventure_platform_fabric_version}")
include(implementation "net.kyori:adventure-text-minimessage:${project.adventure_api_version}")
include(implementation "net.kyori:adventure-text-serializer-plain:${project.adventure_api_version}")

modImplementation include("eu.pb4:sgui:${project.sgui_version}")

implementation "me.lucko:spark-api:${project.spark_version}"

include(implementation group: 'org.apache.commons', name: 'commons-compress', version: "${project.apache_commons_compression_version}")
include(implementation group: 'commons-io', name: 'commons-io', version: "${project.apache_commons_io_version}")
include(implementation group: 'org.quartz-scheduler', name: 'quartz', version: "${project.quartz_version}")
include(implementation "org.reflections:reflections:${project.reflections_version}")
include(implementation "org.javassist:javassist:${project.javaassist_version}")
}

processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}

tasks.withType(JavaCompile).configureEach {
it.options.release.set(21)
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

jar {
from("LICENSE") {
rename { "${it}-mc${minecraft_version}-${project.base.archivesName.get()}" }
}
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}

// build.gradle
modrinth {
token = "$System.env.modrinth_token"
projectId = "1TowMm2v"
versionNumber = "$mod_version"
versionType = "release"
uploadFile = remapJar
gameVersions = ['1.20.6']
loaders = ["fabric"]
dependencies {
required.project "fabric-api"
optional.project "carpet"
optional.project "spark"
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}"
}
syncBodyFrom = rootProject.file("README.md").text
}

// replace readme
tasks.modrinth.dependsOn(tasks.modrinthSyncBody)
tasks.register('replaceReadme') {
// todo
}
tasks.modrinthSyncBody.dependsOn(tasks.replaceReadme)

}
9 changes: 9 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
}

dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}"

}
26 changes: 17 additions & 9 deletions settings.gradle
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
pluginManagement {
repositories {
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
mavenCentral()
gradlePluginPortal()
}
}
repositories {
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
maven {
name = 'Forge'
url = 'https://maven.minecraftforge.net/'
}
gradlePluginPortal()
}
}

include(
'common',
'fabric'
)
6 changes: 0 additions & 6 deletions src/main/java/assets/fuji/Cat.java

This file was deleted.

44 changes: 0 additions & 44 deletions src/main/java/io/github/sakurawald/Fuji.java

This file was deleted.

16 changes: 0 additions & 16 deletions src/main/java/io/github/sakurawald/config/Configs.java

This file was deleted.

128 changes: 0 additions & 128 deletions src/main/java/io/github/sakurawald/config/handler/ConfigHandler.java

This file was deleted.

Loading

0 comments on commit 62a19ad

Please sign in to comment.