Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Rewrite of ModManager #154

Draft
wants to merge 13 commits into
base: 1.18
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2.4.0
with:
submodules: 'true'

# Validate wrapper
- name: Gradle Wrapper Validation
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- name: Fetch Sources
uses: actions/checkout@v2.4.0
with:
submodules: 'true'
ref: ${{ github.event.release.tag_name }}

# Setup Java 17 environment for the next steps
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
submodules: 'true'
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk 17
Expand All @@ -16,7 +18,10 @@ jobs:
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: test
run: ./gradlew test
run: |
mkdir -p core/run
mkdir -p run
./gradlew test
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "core"]
path = core
url = https://github.com/ModManagerMC/core.git
121 changes: 0 additions & 121 deletions build.gradle

This file was deleted.

58 changes: 58 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("fabric-loom")
}

group = "net.modmanagermc"
version = "2.0.0"

repositories {
maven("https://maven.fabricmc.net") {
name = "Fabric"
}
maven("https://maven.terraformersmc.com/") {
name = "Terraformers"
}
mavenCentral()
}

val minecraftVersion: String by project
val yarnMappings: String by project
val loaderVersion: String by project
val fabricKotlinVersion: String by project

dependencies {
minecraft("com.mojang:minecraft:$minecraftVersion")
mappings("net.fabricmc:yarn:$yarnMappings:v2")

modImplementation("net.fabricmc:fabric-loader:${loaderVersion}")
modImplementation("com.terraformersmc:modmenu:3.2.1")
includeMod("net.fabricmc:fabric-language-kotlin:${fabricKotlinVersion}")
includeProject(project(":core"))
}

fun DependencyHandler.includeMod(dependencyNotation: Any) {
modImplementation(dependencyNotation)
include(dependencyNotation)
}

fun DependencyHandler.includeProject(dependencyNotation: Any) {
implementation(dependencyNotation)
include(dependencyNotation)
}

tasks.getByName<ProcessResources>("processResources") {
filesMatching("fabric.mod.json") {
expand(
mutableMapOf(
"version" to version,
"fabricKotlinVersion" to fabricKotlinVersion
)
)
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
1 change: 1 addition & 0 deletions core
Submodule core added at 85ab0c
40 changes: 10 additions & 30 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,30 +1,10 @@
#
# Copyright 2021 DeathsGun
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
org.gradle.jvmargs=-Xms2G -Xmx4G
# Fabric Properties
# check this on https://modmuss50.me/fabric.html
release_target=1.18
minecraft_version=1.18.1
yarn_mappings=1.18.1+build.17
loader_version=0.12.12
# Mod Properties
mod_version=1.2.3+1.18
maven_group=xyz.deathsgun
archives_base_name=modmanager
# Dependencies
modmenu_version=3.0.0
# Kotlin
fabric_kotlin_version=1.6.4+kotlin.1.5.30
kotlin.code.style=official
org.gradle.jvmargs=-Xmx2G

loomVersion=0.12-SNAPSHOT
minecraftVersion=1.18.2
yarnMappings=1.18.2+build.3
loaderVersion=0.14.9
fabricKotlinVersion=1.8.2+kotlin.1.7.10

kotlinVersion=1.7.10
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Empty file modified gradlew
100755 → 100644
Empty file.
26 changes: 0 additions & 26 deletions settings.gradle

This file was deleted.

18 changes: 18 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
pluginManagement {
repositories {
maven("https://maven.fabricmc.net") {
name = "Fabric"
}
gradlePluginPortal()
}
val kotlinVersion: String by settings
val loomVersion: String by settings
plugins {
kotlin("jvm") version kotlinVersion
kotlin("plugin.serialization") version kotlinVersion
id("fabric-loom") version loomVersion
}
}
rootProject.name = "modmanager"

include("core")
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2022 DeathsGun
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package net.modmanagermc.modmanager.mixin;

import net.minecraft.client.MinecraftClient;
import net.modmanagermc.core.task.TaskManager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(MinecraftClient.class)
public class MinecraftClientMixin {

@Inject(method = "render", at = {@At("HEAD")})
public void onRender(boolean tick, CallbackInfo ci) {
TaskManager.INSTANCE.executeTasks();
}

}
Loading