Skip to content

Commit

Permalink
1.1.0: Now launching with processes
Browse files Browse the repository at this point in the history
- You can now specify the java executable and the jvm options for runtime
- Optimised native extraction
- AccessToken is now hidden from output
- Added system property to disable ANSI logging
  • Loading branch information
LGatodu47 committed Apr 19, 2022
1 parent 64c6925 commit de3d2fc
Show file tree
Hide file tree
Showing 10 changed files with 249 additions and 332 deletions.
26 changes: 15 additions & 11 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,32 @@ launches it. MeoWrapper is intended to be used for development projects where a
is needed (e.g. plugin development) or when you're having issues with your Minecraft launcher.

MeoWrapper can run in 3 environments:
- Client (The most stable one)
- Data (Also very stable, but not very useful)
- Server (Very unstable for now and has a lot of issues)

I would recommend you **avoid using the Server environment** for now because the run directory is
usually set to MeoWrapper's run directory, causing a mess of server files (eula.txt,
server.properties, ...).
- Client (Normal Minecraft)
- Data (Generation of data files; documentation for data packs)
- Server (Minecraft Server)

****

### Using MeoWrapper in a Java Project

To use MeoWrapper in your java project, you will first need to declare it as a dependency. You can
find artifacts on [Sonatype Releases Maven](https://s01.oss.sonatype.org/) at
`io.github.lgatodu47.meowrapper`. If you are running on a Gradle project, your `build.gradle`
find artifacts on [Sonatype Releases Maven](https://s01.oss.sonatype.org/) or on [Maven Central](https://repo1.maven.org/maven2/)
at `io.github.lgatodu47.meowrapper`. If you are running on a Gradle project, your `build.gradle`
should look like this:

repositories {
// Archives can sometimes be found on maven central
// However, they aren't always up-to-date
mavenCentral()

// Should always work
maven {
url 'https://s01.oss.sonatype.org/content/repositories/releases'
}
}

dependencies {
runtimeOnly 'io.github.lgatodu47:meowrapper:1.0'
runtimeOnly 'io.github.lgatodu47:meowrapper:1.1.0'
}

We first declare the maven repository where the artifacts are located and then add the dependency
Expand All @@ -55,7 +56,10 @@ Once your run configuration is done, you should be able to run the game.

### Using MeoWrapper in Command Line

First go on the [releases page](https://github.com/LGatodu47/MeoWrapper/releases) and download the
You will first need to install **JDK 17** if you haven't installed it yet as MeoWrapper is compiled
in Java 17. There are many JDKs out there such as [OpenJDK](https://jdk.java.net/17/) or [Eclipse Temurin](https://adoptium.net/temurin/archive).

Next go on the [releases page](https://github.com/LGatodu47/MeoWrapper/releases) and download the
latest release of MeoWrapper. Put the downloaded jar in an empty folder and open the command line
in the run folder. You can then run the jar with argument `help-<env>` to have more info about an
environment.
Expand Down
54 changes: 7 additions & 47 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,80 +9,49 @@ version "${version}" + (snapshot == "true" ? "-SNAPSHOT" : "")

repositories {
mavenCentral()

ivy {
url 'https://github.com/'

patternLayout {
artifact '/[organisation]/[module]/releases/download/[revision]/[module].[ext]'
}

metadataSources {
artifact()
}
}
}

configurations {
agent
exports {
canBeConsumed = false
canBeResolved = true
}
implementation.extendsFrom(exports, agent)
implementation.extendsFrom(exports)
}

dependencies {
agent "CGJennings:jar-loader:${agent_version}@jar"
exports 'net.bytebuddy:byte-buddy-agent:1.12.8'
exports group: 'com.google.code.gson', name: 'gson', version: "${gson_version}"
}

jar {
manifest {
attributes(
"Main-class": "fr.lgatodu47.meowrapper.MeoWrapper",
"Premain-Class": "ca.cgjennings.jvm.JarLoader",
"Agent-Class": "ca.cgjennings.jvm.JarLoader"
"Main-class": "io.github.lgatodu47.meowrapper.MeoWrapper"
)
}

from { configurations.agent.collect { it.isDirectory() ? it : zipTree(it) } }
}

task fatJar(type: Jar) {
classifier 'fatJar'
classifier 'cmd'
group 'build'

manifest {
attributes(
"Main-class": "fr.lgatodu47.meowrapper.MeoWrapper",
"Premain-Class": "ca.cgjennings.jvm.JarLoader",
"Agent-Class": "ca.cgjennings.jvm.JarLoader"
)
}
manifest = jar.manifest;

from { configurations.exports.collect {it.isDirectory() ? it : zipTree(it)} } {
exclude "META-INF/versions/9/module-info.class"
}
from { configurations.exports.collect {it.isDirectory() ? it : zipTree(it)} }

with jar
}

task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
classifier 'javadoc'
from javadoc
}

task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
classifier 'sources'
from sourceSets.main.allSource
}

tasks.withType(GenerateModuleMetadata) {
enabled = false
}

publishing {
publications {
meowrapper(MavenPublication) {
Expand Down Expand Up @@ -115,15 +84,6 @@ publishing {
}
}
}

pom.withXml {
var pomNode = asNode()
pomNode.dependencies.'*'.findAll() {
it.artifactId.text() == 'jar-loader'
}.each() {
it.parent().remove(it)
}
}
}
}
repositories {
Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version=1.0
version=1.1.0
snapshot=false
agent_version=1.0.0
gson_version=2.9.0
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.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
135 changes: 0 additions & 135 deletions src/main/java/io/github/lgatodu47/meowrapper/AgentManager.java

This file was deleted.

Loading

0 comments on commit de3d2fc

Please sign in to comment.