Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
andantet committed Nov 23, 2023
0 parents commit fd041d2
Show file tree
Hide file tree
Showing 15 changed files with 728 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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: [
17, # Current Java LTS & minimum supported by Minecraft
]
# and run on both Linux and Windows
os: [ubuntu-22.04, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- name: checkout repository
uses: actions/checkout@v3
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'microsoft'
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: build/libs/
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2023 MC Brawls

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
165 changes: 165 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
//file:noinspection All

plugins {
id "fabric-loom" version "1.4-SNAPSHOT"
id "org.jetbrains.kotlin.jvm"
id "maven-publish"
}

def ENV = System.getenv()

version = mod_version
group = maven_group

base {
archivesName = mod_id
}

repositories {
maven {
name = "Andante"
url = "https://maven.andante.dev/releases/"
}

maven {
name = "Nucleoid"
url = "https://maven.nucleoid.xyz/"
}
}

loom.splitEnvironmentSourceSets()

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

testClient {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath

compileClasspath += client.compileClasspath
runtimeClasspath += client.runtimeClasspath

compileClasspath += test.compileClasspath
runtimeClasspath += test.runtimeClasspath
}
}

dependencies {
minecraft "com.mojang:minecraft:$minecraft_version"
mappings "net.fabricmc:yarn:$minecraft_version+build.$yarn_build:v2"
modImplementation "net.fabricmc:fabric-loader:$loader_version"

modImplementation "net.fabricmc.fabric-api:fabric-api:$fabric_version"
modImplementation "net.fabricmc:fabric-language-kotlin:$fabric_kotlin_version"

modImplementation "com.ptsmods:devlogin:$devlogin_version"

// test
testImplementation sourceSets.main.output
testImplementation "org.apache.logging.log4j:log4j-slf4j2-impl:2.21.1"

testClientImplementation sourceSets.main.output
testClientImplementation sourceSets.client.output
testClientImplementation sourceSets.test.output
}

loom {
runtimeOnlyLog4j = true

mods {
mod_id {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}

runs {
authenticatedClient {
client()
name("Minecraft Client (Authenticated)")
programArg("--msa")
}

testClient {
client()
name("Minecraft Client (Test)")
source(sourceSets.testClient)
runDir("runtest")
}

testClientAuthenticated {
inherit(testClient)
name("Minecraft Client (Test Authenticated)")
programArg("--msa")
runDir("runtest")
}

testServer {
server()
name("Minecraft Server (Test)")
source(sourceSets.test)
runDir("runtest")
}
}
}

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

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

tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}

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

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = 17
}
}

java {
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

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

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}

repositories {
// Andante's Maven
def mavenUsername = ENV["MAVEN_USERNAME_ANDANTE"]
def mavenPassword = ENV["MAVEN_PASSWORD_ANDANTE"]
if (mavenUsername && mavenPassword) {
maven {
name = "Andante"
url = "https://maven.andante.dev/releases/"
credentials.username = mavenUsername
credentials.password = mavenPassword
}
}
}
}
22 changes: 22 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.3-pre2
yarn_build=2
loader_version=0.14.24

kotlin_version=1.9.20
fabric_kotlin_version=1.10.13+kotlin.1.9.20

devlogin_version=3.4.1

# Mod Properties
mod_version=1.0.0
maven_group=net.mcbrawls
mod_id=packmanager

# Dependencies
fabric_version=0.90.12+1.20.3
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.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit fd041d2

Please sign in to comment.