Skip to content

Commit

Permalink
refactor!: move HTTP to its own module
Browse files Browse the repository at this point in the history
- util: add publishing script
  • Loading branch information
radstevee committed Nov 3, 2024
1 parent 3b0f6df commit 4615545
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 15 deletions.
1 change: 1 addition & 0 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies {
modImplementation("net.fabricmc:fabric-loader:${prop("loader_version")}")

implementation(project(":api"))
testImplementation(project(":http"))
}

tasks.processResources {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

import io.netty.channel.ChannelHandlerContext;
import net.fabricmc.api.DedicatedServerModInitializer;
import net.fabricmc.api.ModInitializer;
import net.mcbrawls.inject.api.InjectorContext;
import net.mcbrawls.inject.api.http.HttpByteBuf;
import net.mcbrawls.inject.api.http.HttpInjector;
import net.mcbrawls.inject.api.http.HttpRequest;
import net.mcbrawls.inject.http.HttpByteBuf;
import net.mcbrawls.inject.http.HttpInjector;
import net.mcbrawls.inject.http.HttpRequest;
import net.mcbrawls.inject.fabric.InjectFabric;

public class InjectTestMod implements DedicatedServerModInitializer {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ yarn_mappings=1.21.1+build.3
loader_version=0.16.7

# Mod Properties
version=2.1.1
version=2.2.0
group=net.mcbrawls.inject
id=inject

Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.mcbrawls.inject.api.http;
package net.mcbrawls.inject.http;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.mcbrawls.inject.api.http;
package net.mcbrawls.inject.http;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelFutureListener;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.mcbrawls.inject.api.http;
package net.mcbrawls.inject.http;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufInputStream;
Expand Down
4 changes: 4 additions & 0 deletions paper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ dependencies {
val version = prop("minecraft_version") + "-R0.1-SNAPSHOT"

implementation(project(":api"))
implementation(project(":http"))

paperweight.paperDevBundle(version)

exampleCompileOnly("io.papermc.paper:paper-api:$version")
exampleImplementation(project(":api"))
exampleImplementation(project(":http"))
}

tasks {
Expand All @@ -47,6 +50,7 @@ tasks {
from(sourceSets["main"].output)
from(sourceSets["example"].output)
from(project(":api").sourceSets.main.get().output) // Cursed. But it works (I spent 2 hours on this)
from(project(":http").sourceSets.main.get().output)

group = "build"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package net.mcbrawls.inject.paper.example;

import io.netty.channel.ChannelHandlerContext;
import net.mcbrawls.inject.api.http.HttpByteBuf;
import net.mcbrawls.inject.api.http.HttpInjector;
import net.mcbrawls.inject.api.http.HttpRequest;
import net.mcbrawls.inject.http.HttpByteBuf;
import net.mcbrawls.inject.http.HttpInjector;
import net.mcbrawls.inject.http.HttpRequest;
import net.mcbrawls.inject.paper.InjectPaper;
import org.bukkit.plugin.java.JavaPlugin;

Expand Down
5 changes: 5 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

for dir in *; do
[[ -f "$dir/build.gradle.kts" ]] && ./gradlew "$dir:publish"
done
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ include(":api")
include(":fabric")
include(":paper")
include(":spigot")
include(":http")
1 change: 1 addition & 0 deletions spigot/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ tasks {
from(sourceSets["main"].output)
from(sourceSets["example"].output) // Include the example source set
from(project(":api").sourceSets.main.get().output) // Cursed. But it works (I spent 2 hours on this)
from(project(":http").sourceSets.main.get().output)

configurations = listOf(exampleImplementation) // Include example dependencies
mergeServiceFiles() // Optional: If you need to merge service files
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package net.mcbrawls.inject.spigot.example;

import io.netty.channel.ChannelHandlerContext;
import net.mcbrawls.inject.api.http.HttpByteBuf;
import net.mcbrawls.inject.api.http.HttpInjector;
import net.mcbrawls.inject.api.http.HttpRequest;
import net.mcbrawls.inject.http.HttpByteBuf;
import net.mcbrawls.inject.http.HttpInjector;
import net.mcbrawls.inject.http.HttpRequest;
import net.mcbrawls.inject.spigot.InjectSpigot;
import org.bukkit.plugin.java.JavaPlugin;

Expand Down

0 comments on commit 4615545

Please sign in to comment.