Skip to content

Commit

Permalink
Merge branch 'dev-1.18' into dev-1.19-antimatter-port-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Dec 26, 2024
2 parents b83a61a + 5a162d4 commit 3d977be
Show file tree
Hide file tree
Showing 22 changed files with 170 additions and 821 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: TesseractAPI Nightly
on:
push:
branches:
- 'dev**'
- '*'
pull_request:
branches:
- 'dev**'
Expand All @@ -31,25 +31,25 @@ jobs:
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle','**/gradle/wrapper/gradle-wrapper.properties','**/*.properties') }}
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.properties') }}
- name: Build with Gradle
run: ./gradlew build --stacktrace
# The USERNAME and TOKEN need to correspond to the credential environment variables used in
# the publishing section of your build.gradle
- name: Upload Forge Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: TesseractAPI Forge JAR
path: forge/build/libs
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Fabric Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: TesseractAPI Fabric JAR
path: fabric/build/libs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ jobs:
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GITHUB_RELEASE: true
- name: Upload Forge Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Antimatter-forge-nightly-${{ steps.vars.outputs.sha_short }}
path: forge/build/libs
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Fabric Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Antimatter-fabric-nightly-${{ steps.vars.outputs.sha_short }}
path: fabric/build/libs
Expand Down
33 changes: 33 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
pipeline {
agent any
tools {
jdk "jdk-21" // valid options are: "jdk-8", "jdk-16", "jdk-17" or "jdk-21", choose which one you need
}
stages {
stage('Clean') {
steps {
echo 'Cleaning Project'
sh 'chmod +x gradlew'
sh './gradlew clean'
}
}
stage('Build & Publish') {
steps {
echo 'Building & Publishing'
sh './gradlew build publish'
}
}
}
post {
always {
discordSend(
webhookURL: "https://discord.com/api/webhooks/1313642177083216073/H8EnQ65JusCjpqGTqLXDZI1BYBe4ArLJn3xSjEOWthg4Nwa7ZFSHu1SYag8fU4v4DB8k",
thumbnail: "https://raw.githubusercontent.com/GT-Reimagined/gt-reimagined.github.io/refs/heads/main/icon.png",
title: "Tesseract API ${TAG_NAME} #${BUILD_NUMBER}",
link: env.BUILD_URL,
result: currentBuild.currentResult,
description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})\nStatus: ${currentBuild.currentResult}"
)
}
}
}
88 changes: 10 additions & 78 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,54 +1,24 @@
plugins {
id "maven-publish"
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.3-SNAPSHOT" apply(false)
id "com.github.johnrengelman.shadow" version "7.0.0" apply(false)
id "idea"
id "fabric-loom" version "1.7-SNAPSHOT" apply false
id "net.neoforged.moddev.legacyforge" version "2.0.58-beta" apply false
}

architectury {
minecraft = rootProject.minecraft_version
}

def isCI = System.getenv("GITHUB_ACTION")
def isRELEASE = System.getenv("GITHUB_RELEASE")
def isGITHU_ACTION = System.getenv("GITHUB_ACTION")
def gitHash() {
String hash = System.getenv("GITHUB_SHA")
if (hash != null) return hash.substring(0,8)
return ""
}

subprojects {
apply plugin: "dev.architectury.loom"
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

loom {
silentMojangMappingsLicense()
}

dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
// The following line declares the mojmap mappings, you may use other mappings as well
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.mappings_version}@zip")
}

// The following line declares the yarn mappings you may select this one as well.
// mappings "net.fabricmc:yarn:1.17.1+build.32:v2"
}


}

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



apply plugin: "idea"
group = rootProject.maven_group

version = "${project.mod_version}-${rootProject.minecraft_version}"
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
apply from: 'https://raw.githubusercontent.com/GregTech-Intergalactical/GradleSripts/main/repositories.gradle'

java {
Expand All @@ -59,46 +29,8 @@ allprojects {
it.options.encoding = 'UTF-8'
}

if (isCI) {
if (isGITHU_ACTION) {
version = version + "-" + gitHash()
println("In CI mode")
}
}

subprojects{
if (!project.path.contains("common")){
apply plugin: "com.github.johnrengelman.shadow"

configurations {
common
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
if (project.path.contains("forge")){
developmentForge.extendsFrom common
} else{
developmentFabric.extendsFrom common
}
}

shadowJar {
configurations = [project.configurations.shadowCommon]
archiveClassifier.set "dev-shadow"
}

remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
archiveClassifier.set null
}

jar {
archiveClassifier.set "dev"
}

components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}
}
}
}
69 changes: 17 additions & 52 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,70 +1,35 @@
archivesBaseName = rootProject.tesseract_archive_base_name
version = "${project.mod_version}-${rootProject.minecraft_version}"

sourceSets {
test {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath
}
}

loom {
runs {
testClient {
client()
ideConfigGenerated project.rootProject == project
name = "Testmod Client"
source sourceSets.test
}
testServer {
server()
ideConfigGenerated project.rootProject == project
name = "Testmod Server"
source sourceSets.test
}
}
plugins {
id "fabric-loom"
}
archivesBaseName = "${project.tesseract_archive_base_name}-common"

dependencies{
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
compileOnly("com.electronwill.night-config:toml:${rootProject.nightconfig_version}")
compileOnly("com.electronwill.night-config:core:${rootProject.nightconfig_version}")
modImplementation("earth.terrarium:botarium-common-${project.minecraft_version}:${project.botarium_version}")
modImplementation "maven.modrinth:carbon-config:${project.carbon_config_fabric_version}"
testImplementation('junit:junit:4.11')
testImplementation(sourceSets.main.output)
}

architectury {
common("forge", "fabric")
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${project.minecraft_version}:${project.mappings_version}@zip")
}
//compileOnly("com.electronwill.night-config:toml:${rootProject.nightconfig_version}")
//compileOnly("com.electronwill.night-config:core:${rootProject.nightconfig_version}")
modImplementation("earth.terrarium:botarium-fabric-${project.minecraft_version}:${project.botarium_version}")
implementation 'com.github.Carbon-Config-Project:CarbonConfigLib:1.3.0'
}

publishing {
publications {
mavenJava(org.gradle.api.publish.maven.MavenPublication) {
artifact(sourcesJar) {
builtBy remapSourcesJar
}

afterEvaluate {
artifact remapJar
}
from components.java
}
}

repositories {
def isCI = System.getenv("GITHUB_ACTION")
def isRELEASE = System.getenv("GITHUB_RELEASE")
if (isCI && isRELEASE) {
def isCI = System.getenv("CI")
if (isCI) {
maven {
url = "https://repo.repsy.io/mvn/trinsdar/gregtech-intergalactical/"
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
url System.getenv("local_maven_url")
}
} else {
maven { url "file:///${project.projectDir}/mcmodsrepo"}
mavenLocal()
}
}
}
3 changes: 2 additions & 1 deletion common/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
mod_version=0.2.3
mod_version=0.2.4.1
fabric.loom.dontRemap=true
3 changes: 0 additions & 3 deletions common/src/main/java/tesseract/FluidPlatformUtils.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package tesseract;

import dev.architectury.injectables.annotations.ExpectPlatform;


import earth.terrarium.botarium.common.fluid.base.FluidHolder;
import earth.terrarium.botarium.common.fluid.base.PlatformFluidHandler;
import earth.terrarium.botarium.common.fluid.base.PlatformFluidItemHandler;
Expand Down
7 changes: 0 additions & 7 deletions common/src/main/java/tesseract/Tesseract.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
package tesseract;

import carbonconfiglib.config.Config;
import carbonconfiglib.config.ConfigHandler;
import dev.architectury.injectables.annotations.ExpectPlatform;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import net.minecraft.world.level.LevelAccessor;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import tesseract.api.GraphWrapper;
import tesseract.api.gt.GTTransaction;
import tesseract.api.gt.IGTCable;
import tesseract.api.gt.IGTNode;

import java.util.Set;

Expand Down
1 change: 0 additions & 1 deletion common/src/main/java/tesseract/TesseractCapUtils.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package tesseract;

import dev.architectury.injectables.annotations.ExpectPlatform;
import earth.terrarium.botarium.common.fluid.base.PlatformFluidHandler;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
Expand Down
1 change: 0 additions & 1 deletion common/src/main/java/tesseract/TesseractPlatformUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import carbonconfiglib.config.Config;
import carbonconfiglib.config.ConfigHandler;
import dev.architectury.injectables.annotations.ExpectPlatform;
import net.minecraft.core.Direction;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
Expand Down
1 change: 0 additions & 1 deletion common/src/main/java/tesseract/util/ItemHandlerUtils.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package tesseract.util;

import dev.architectury.injectables.annotations.ExpectPlatform;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.NotNull;
import tesseract.TesseractPlatformUtils;
Expand Down
Loading

0 comments on commit 3d977be

Please sign in to comment.