Skip to content

Commit

Permalink
Initial Fabrication
Browse files Browse the repository at this point in the history
  • Loading branch information
thecatcore committed May 29, 2023
1 parent d4cd7b0 commit c12077e
Show file tree
Hide file tree
Showing 29 changed files with 829 additions and 774 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain Java versions, and provides a first line of defence against bad commits.

name: Build

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
java: [
"17" # Latest version
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v2
with:
distribution: "temurin"
java-version: ${{ matrix.java }}

- name: Grant execute permission
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew build
38 changes: 18 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
# gradle
.gradle/
build/
out/
classes/

# eclipse
eclipse
bin
*.launch
.settings
.metadata
.classpath
.project

# idea
out
classes
.idea/
*.iml
*.ipr
*.iws
*.iml
.idea

# gradle
build
.gradle
# vscode
.settings/
.vscode/
bin/
.classpath
.project

#Netbeans
.nb-gradle
.nb-gradle-properties
# fabric
run/

# other
run
.DS_Store
Thumbs.db
# macos
*.DS_Store
229 changes: 113 additions & 116 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,145 +1,142 @@
buildscript {
repositories {
jcenter()
maven { url 'https://www.dimdev.org/maven/' }
maven { url 'https://jitpack.io' }
maven { url = "https://files.minecraftforge.net/maven" }
maven { url 'http://repo.spongepowered.org/maven' }
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath "com.github.Chocohead:ForgeGradle:jitpack-SNAPSHOT"
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
classpath 'gradle.plugin.com.github.breadmoirai:github-release:2.0.1'
}
plugins {
id 'java'
id 'xyz.wagyourtail.unimined' version "0.4.10-SNAPSHOT"
id 'maven-publish'
}

apply plugin: 'net.minecraftforge.gradle.tweaker-client'
apply plugin: 'java'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'maven-publish'
apply plugin: 'com.github.breadmoirai.github-release'

def travisBuildNumber = System.getenv('TRAVIS_BUILD_NUMBER')
def versionSuffix = travisBuildNumber != null ? travisBuildNumber : 'SNAPSHOT'

group 'org.dimdev'
version '1.0.4-' + versionSuffix
archivesBaseName = 'Rift'

sourceCompatibility = 1.8
targetCompatibility = 1.8
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group

repositories {
mavenCentral()
maven { url 'https://libraries.minecraft.net/' }
maven { url = "https://files.minecraftforge.net/maven" }
maven { url 'https://www.dimdev.org/maven/' }
maven { url = 'https://repo.spongepowered.org/maven/' }
maven { url 'https://www.jitpack.io' }
mavenCentral()

maven {
name = 'Fabric'
url = "https://maven.fabricmc.net/"
}
maven {
name = "Legacy Fabric"
url = "https://maven.legacyfabric.net/"
}
// WagYourTail Mavens
maven { url "https://maven.wagyourtail.xyz/releases" }
maven { url "https://maven.wagyourtail.xyz/snapshots" }

maven {
url "https://maven.minecraftforge.net/"
metadataSources {
artifact()
mavenPom()
}
}

maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
}

dependencies {
implementation('org.dimdev:mixin:0.7.11-SNAPSHOT') { transitive = false }
implementation('net.minecraft:launchwrapper:1.12') { transitive = false }
implementation 'org.ow2.asm:asm:6.2'
implementation 'org.ow2.asm:asm-commons:6.2'
//sourceSets {
// main
// debug {
// compileClasspath += main.compileClasspath
// }
//}

unimined {
useGlobalCache = false
}

minecraft {
version = '1.13.2'
mappings = 'snapshot_20181106'
runDir = 'run'
tweakClass = 'org.dimdev.riftloader.launch.RiftLoaderClientTweaker'
makeObfSourceJar = false

replace "@VERSION@", project.version
replaceIn "org/dimdev/riftloader/Main.java"
legacyFabric {
accessWidener = file("src/main/resources/fabricated-rift.accesswidener")
}

mcRemapper.tinyRemapperConf = {
// most mcp mappings (except older format) dont include field desc
ignoreFieldDesc(true)
// this also fixes some issues with them, as it tells tiny remapper to try harder to resolve conflicts
ignoreConflicts(true)
}
}

mixin {
defaultObfuscationEnv notch
add sourceSets.main, 'mixins.rift.refmap.json'
extraSrgFile notch, "$projectDir/optimap.srg"
token("OPTIFINE", 1)
dependencies {
minecraft "net.minecraft:minecraft:${project.minecraft_version}"

mappings "de.oceanlabs.mcp:mcp_config:${project.minecraft_version}@zip"
mappings "de.oceanlabs.mcp:mcp_${project.mcp_channel}:${project.mcp_version}-${project.minecraft_version}@zip"

mappings "net.legacyfabric.v2:intermediary:${project.minecraft_version}:v2"
//mappings "net.legacyfabric.v2:yarn:${project.yarn_mappings}:v2"

fabric "net.fabricmc:fabric-loader:${project.loader_version}"

modImplementation("maven.modrinth:mod-remapping-api:${project.mod_remapping_api}")
}

sourceSets {
shim
main {
compileClasspath += shim.output
}
debug {
compileClasspath += main.compileClasspath
}
base {
archivesName = project.archives_base_name
}

processResources {
filesMatching('profile.json') {
def process = 'git rev-parse --short HEAD'.execute()
process.waitFor()
def things = ['version': project.version, 'build': process.exitValue() ? 'jitpack-SNAPSHOT' : "${process.text.trim()}"]
inputs.property "version", project.version

expand things
}

// Re-run this task when these change
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}

jar {
finalizedBy reobfJar
manifest.attributes(
'Main-Class': 'org.dimdev.riftloader.Main'
)
}
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
if (JavaVersion.current().isJava9Compatible()) it.options.release = 8

task devJar(type: Jar, dependsOn: classes) {
classifier 'dev'
from sourceSets.main.output
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier 'sources'
from sourceSets.main.allSource
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()
}

artifacts {
archives jar
archives devJar
archives sourcesJar
jar {
from("LICENSE") {
rename { "${it}_${base.archivesName.get()}" }
}
from("./libs") {
into("libs")
}
}

// configure the maven publication
publishing {
repositories {
maven { url "$buildDir/repo/" }
maven {
url 'sftp://www.dimdev.org:22/data/www/html/maven/'
credentials {
username 'www'
password System.getenv('dimdev_maven_password')
}
}
}

publications {
mavenJava(MavenPublication) {
artifactId = 'rift'

from components.java
artifact devJar
artifact sourcesJar
}
}
publications {
mavenJava(MavenPublication) {
from components.java
}
}

// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}

tasks.publish.dependsOn(tasks.githubRelease)
githubRelease {
token = System.getenv('dimdev_repo_token')
owner = 'DimensionalDevelopment'
repo = 'Rift'
targetCommitish = 'master'
prerelease = true
releaseAssets = jar.destinationDir.listFiles()
}
// minecraft {
// version = '1.13.1'
// mappings = 'snapshot_20181106'
// runDir = 'run'
// tweakClass = 'org.dimdev.riftloader.launch.RiftLoaderClientTweaker'
// makeObfSourceJar = false

// }
Loading

0 comments on commit c12077e

Please sign in to comment.