Skip to content

Commit

Permalink
Migrate to polymer
Browse files Browse the repository at this point in the history
  • Loading branch information
samolego committed Feb 7, 2024
1 parent 2ce633d commit faafb65
Show file tree
Hide file tree
Showing 113 changed files with 802 additions and 1,525 deletions.
53 changes: 0 additions & 53 deletions .circleci/config.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,9 @@ bin/

run/

# Architectury
.architectury-transformer
# java

hs_err_*.log
replay_*.log
*.hprof
*.jfr
284 changes: 153 additions & 131 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,141 +1,163 @@
plugins {
// Fabric loom
id "fabric-loom" version "1.1-SNAPSHOT" apply false
// Forge Gradle
id 'net.minecraftforge.gradle' version '6.0.+' apply false
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'maven-publish'

id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
id "com.modrinth.minotaur" version "2.+" apply false
id 'com.matthewprenger.cursegradle' version '1.4.0'
id "com.modrinth.minotaur" version "2.+"
}

version = project.mod_version
group = project.maven_group

base {
archivesName = project.archives_base_name
}

repositories {
mavenCentral()
maven {
url 'https://jitpack.io'
}
maven { url "https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven" }
maven { url 'https://maven.nucleoid.xyz' }
maven {
url 'https://masa.dy.fi/maven'
}
maven { url 'https://jitpack.io' }
}

loom {
splitEnvironmentSourceSets()

mods {
"taterzens" {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}

}

allprojects {
apply plugin: "java"
apply plugin: "maven-publish"

archivesBaseName = rootProject.archives_base_name + "-" + project.name + "-" + rootProject.minecraft_version
version = rootProject.mod_version
group = rootProject.maven_group

repositories {
mavenCentral()
maven {
url 'https://jitpack.io'
}
maven { url 'https://maven.nucleoid.xyz' }
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"

def javaTarget = 17
it.options.release = javaTarget

sourceCompatibility = JavaVersion.toVersion(javaTarget)
targetCompatibility = JavaVersion.toVersion(javaTarget)

if (JavaVersion.current() < JavaVersion.toVersion(javaTarget)) {
toolchain.languageVersion.set(JavaLanguageVersion.of(javaTarget))
}
}

publishing {
publications {
mavenJava(MavenPublication) {
artifactId = rootProject.archives_base_name + "-" + project.name
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.
mavenLocal()
}
}
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.layered {
//mappings("net.fabricmc:yarn:$project.yarn_mappings:v2")
it.officialMojangMappings()
}
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

// Dependencies
// Carpet Mod
modCompileOnly("com.github.gnembon:fabric-carpet:${project.carpet_core_version}")
// Disguiselib
//modCompileOnly("xyz.nucleoid:disguiselib-fabric:${project.disguiselib_version}")
//modCompileOnly 'com.github.NucleoidMC:DisguiseLib:1.20.4-SNAPSHOT'

// Permission API
modImplementation(include('me.lucko:fabric-permissions-api:0.1-SNAPSHOT'))

// Server translations
modImplementation(include("xyz.nucleoid:server-translations-api:${project.translations_api}"))

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

// C2B
modImplementation(include("com.github.samolego.Config2Brigadier:config2brigadier-fabric:${project.c2b_version}"))

// Polymer
modImplementation(include("eu.pb4:polymer-core:${project.polymer_version}"))

}

subprojects {

// Publishing plugins
if (it.name != "common") {
apply plugin: "com.modrinth.minotaur"
apply plugin: "com.matthewprenger.cursegradle"
}

if (it.name != "forge") {
apply plugin: "fabric-loom"
repositories {
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
maven {
url 'https://masa.dy.fi/maven'
}
}

loom {
accessWidenerPath = file("${project.rootDir}/common/src/main/resources/taterzens.accesswidener")
}

dependencies {
// To change the versions see the gradle.properties file
modImplementation "net.fabricmc:fabric-loader:${rootProject.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_version}"
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.layered {
//mappings("net.fabricmc:yarn:$project.yarn_mappings:v2")
it.officialMojangMappings()
}

// C2B
modImplementation("com.github.samolego.Config2Brigadier:config2brigadier-fabric:${rootProject.c2b_version}")


// Disguiselib
modImplementation("xyz.nucleoid:disguiselib-fabric:${project.disguiselib_version}")
}
}

if (it.name != "common") {
dependencies {
compileOnly project(":common")
}

processResources {
from project(":common").sourceSets.main.resources
}

tasks.withType(JavaCompile) {
source(project(":common").sourceSets.main.allSource)
}
}

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
manifest {
attributes([
"Specification-Title" : rootProject.archives_base_name,
"Specification-Vendor" : "",
"Specification-Version" : rootProject.mod_version,
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "",
"MixinConfigs" : "${rootProject.archives_base_name}.mixins.json",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
processResources {
inputs.property "version", project.version

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

tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}

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_17
targetCompatibility = JavaVersion.VERSION_17
}

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

// configure the maven publication
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.
}
}

def ENV = System.getenv()

// from FAPI https://github.com/FabricMC/fabric/blob/1.16/build.gradle
curseforge {
if (ENV.CURSEFORGE_API_KEY) {
apiKey = ENV.CURSEFORGE_API_KEY
}

project {
id = "446499"
changelog = ENV.CHANGELOG ?: "A changelog can be found at https://github.com/samolego/Taterzens/releases/tag/${version}"
releaseType = "release"
addGameVersion "${project.minecraft_version}"
addGameVersion "Fabric"
addGameVersion "Quilt"

mainArtifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}-fabric.jar")) {
displayName = "[${project.minecraft_version}] Taterzens ${version}"
}

afterEvaluate {
uploadTask.dependsOn("remapJar")
}
}

options {
forgeGradleIntegration = false
}
}

modrinth {
token = ENV.MODRINTH_TOKEN
projectId = "vE972Kux"
versionNumber = project.minecraft_version + "+" + version + "-fabric"
versionType = "release"
changelog = ENV.CHANGELOG ?: "A changelog can be found at https://github.com/samolego/Taterzens/releases/tag/${version}"
versionName = "[${project.minecraft_version}] Taterzens ${version} [Fabric]"

uploadFile = file("${project.buildDir}/libs/${archivesBaseName}-${version}-fabric.jar")

gameVersions = ["${project.minecraft_version}"]
loaders = ['fabric', 'quilt']

dependencies { // A special DSL for creating dependencies
required.project "fabric-api" // Creates a new required dependency on Fabric API
}
}
Empty file removed common/build.gradle
Empty file.
Loading

0 comments on commit faafb65

Please sign in to comment.