Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Mar 31, 2024
0 parents commit 3fbc692
Show file tree
Hide file tree
Showing 13 changed files with 1,423 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build
on: [workflow_dispatch, push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: temurin
cache: gradle

- name: Validate Gradle Wrapper Integrity
uses: gradle/wrapper-validation-action@v1

- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

- name: Build
run: ./gradlew build

- name: Capture build artifacts
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: build/libs

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: build/libs/*.jar
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# eclipse
bin
*.launch
.settings
.metadata
.classpath
.project

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

# gradle
build
.gradle

# other
eclipse
run

# Custom
.DS_Store
857 changes: 857 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

74 changes: 74 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
plugins {
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'maven-publish'
}

version = mod_version
group = maven_group

base {
archivesName = archives_base_name
}

repositories {
maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings
maven { url = "https://maven.parchmentmc.org" } // Parchment mappings
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${minecraft_version}"

mappings(loom.layered {
it.mappings("org.quiltmc:quilt-mappings:${minecraft_version}+build.${qm_version}:intermediary-v2")
it.parchment("org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip")
it.officialMojangMappings { nameSyntheticMembers = false }
})

modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_api_version}"
}

processResources {
// set up properties for filling into metadata
Map<String, String> properties = Map.of(
"version", version as String,
"fabric_loader_version", fabric_loader_version,
"fabric_api_version", fabric_api_version,
"minecraft_version", minecraft_version,
)
properties.forEach((k, v) -> inputs.property(k, v))

filesMatching("fabric.mod.json") {
expand properties
}
}

def targetJavaVersion = 17
tasks.withType(JavaCompile).configureEach {
// 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
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
it.options.release.set(targetJavaVersion)
}
}

java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
// 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()
}

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}
20 changes: 20 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Done to increase the memory available to Gradle.
org.gradle.jvmargs=-Xmx2G

# Mod Properties
mod_version = 0.0.1
maven_group = dev.ithundxr
archives_base_name = RailwaysTweaks

minecraft_version=1.20.1

# Mappings
# https://lambdaurora.dev/tools/import_quilt.html
qm_version = 23
# https://parchmentmc.org/docs/getting-started
parchment_version = 2023.09.03

# Fabric Properties
# check these on https://modmuss50.me/fabric.html
fabric_loader_version=0.15.7
fabric_api_version=0.92.0+1.20.1
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 3fbc692

Please sign in to comment.