Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
StellarWitch7 committed Nov 10, 2024
0 parents commit 76c0bfe
Show file tree
Hide file tree
Showing 32 changed files with 1,326 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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 platforms or Java versions, and provides a first line of defence
# against bad commits.

name: build
on: [pull_request, push]

jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
21, # Current Java LTS
]
runs-on: ubuntu-22.04
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'microsoft'
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: capture build artifacts
if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: build/libs/
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# gradle

.gradle/
build/
out/
classes/

# eclipse

*.launch

# idea

.idea/
*.iml
*.ipr
*.iws

# vscode

.settings/
.vscode/
bin/
.classpath
.project

# macos

*.DS_Store

# fabric

run/

# java

hs_err_*.log
replay_*.log
*.hprof
*.jfr

# direnv

.envrc
.direnv/

# idk something

.factorypath

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Initial project creation, moving code from https://github.com/enjarai/trickster. (@StellarWitch7)
158 changes: 158 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
plugins {
id 'fabric-loom' version '1.8-SNAPSHOT'
id 'maven-publish'
id "me.modmuss50.mod-publish-plugin" version "0.4.4"
id 'me.fallenbreath.yamlang' version '1.3.1'
}

version = project.mod_version
group = project.maven_group

base {
archivesName = project.archives_base_name
}

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.

maven {
url "https://maven.enjarai.dev/releases"
}
maven {
url "https://maven.enjarai.dev/mirrors"
}

maven {
name "Terraformers Maven"
url 'https://maven.terraformersmc.com'
}
}

loom {
splitEnvironmentSourceSets()

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

}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${property('deps.minecraft')}"
mappings "net.fabricmc:yarn:${property('deps.yarn')}:v2"
modImplementation "net.fabricmc:fabric-loader:${property('deps.floader')}"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${property('deps.fabric-api')}"

modImplementation "dev.enjarai:trickster:${property('deps.trickster')}"

modImplementation "com.terraformersmc:modmenu:${property('deps.modmenu')}"
}

processResources {
inputs.property "version", project.version

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

tasks.withType(JavaCompile).configureEach {
it.options.release = 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}_${project.base.archivesName.get()}"}
}
}

yamlang {
targetSourceSets = [sourceSets.main]
inputDir = "assets/illusionist/lang"
}

// configure the maven publication
publishing {
publications {
create("mavenJava", MavenPublication) {
artifactId = project.archives_base_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.
}
}

publishMods {
file = remapJar.archiveFile
displayName = "Illusionist ${property('mod_version')} for Trickster ${property('deps.trickster')}"
version = project.version
changelog = getRootProject().file("CHANGELOG.md").text
type = STABLE
modLoaders.add("fabric")

def min = property('publish_target_min')
def max = property('publish_target_max')

if (providers.gradleProperty('enjaraiModrinthToken').present) {
modrinth {
projectId = property('mod_modrinth')
accessToken = providers.gradleProperty('enjaraiModrinthToken').get()

if (min == max) {
minecraftVersions.add(min)
} else {
minecraftVersionRange {
start = min
end = max
}
}

requires {
slug = "trickster"
}
}
}

if (providers.gradleProperty('enjaraiGithubToken').present) {
github {
repository = property('mod_github')
accessToken = providers.gradleProperty('enjaraiGithubToken').get()

commitish = property('git_branch')
tagName = project.version
}
}
}

tasks.register('publishAll') {
group 'publishing'
dependsOn 'publish'
dependsOn 'publishMods'
}
26 changes: 26 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true

# Mod Properties
mod_version=1.0.0
maven_group=stellarwitch7
archives_base_name=illusionist

# Publish
publish_target_min=1.21
publish_target_max=1.21.1
mod_github=StellarWitch7/illusionist
git_branch=main
mod_modrinth=FA8JwR6I

# Fabric Properties
# check these on https://fabricmc.net/develop
deps.minecraft=1.21
deps.yarn=1.21+build.2
deps.floader=0.15.11

# Dependencies
deps.fabric-api=0.100.1+1.21
deps.trickster=2.0.0-alpha.40
deps.modmenu=11.0.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.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 76c0bfe

Please sign in to comment.