Skip to content

Commit 78d1211

Browse files
committed
Clean-up README and misc gradle stuff
1 parent e547774 commit 78d1211

File tree

3 files changed

+73
-18
lines changed

3 files changed

+73
-18
lines changed

README.md

Lines changed: 60 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,75 @@
11
# Patchify
22

3-
Tool used to manage/automate code projects that require source-code patching.
3+
Tool used to manage/automate code projects that require source-code patching. This project was inspired by the tool used
4+
by [PaperMC](https://github.com/PaperMC/Paper).
45

5-
This project was inspired by the tool used by [PaperMC](https://github.com/PaperMC/Paper).
6+
## Gradle Plugin
67

7-
# Example
8+
The Gradle plugin is used to automatically manage the source-code patching process for projects that use Gradle without
9+
requiring manual use of the cli tool.
10+
11+
To use the Gradle plugin, add the following to your settings.gradle.kts file:
12+
13+
```kotlin
14+
pluginManagement {
15+
repositories {
16+
gradlePluginPortal()
17+
maven("https://maven.quiltmc.org/repository/release/")
18+
maven("https://raw.githubusercontent.com/NickAcPT/LightCraftMaven/main/")
19+
}
20+
}
21+
```
22+
23+
Now that the required plugin repositories have been added, Gradle can now find the plugin. To add it to your project,
24+
add the following to your build.gradle.kts file:
25+
26+
```kotlin
27+
plugins {
28+
id("io.github.nickacpt.patchify.gradle") version "2.1.0-SNAPSHOT"
29+
}
30+
```
31+
32+
Then you can define the patchify configuration in your build.gradle.kts file:
33+
34+
```kotlin
35+
patchify {
36+
projectWorkspace(/* Name */ "Api", /* Project */ project(":sample-api")) {
37+
initializer {
38+
decompileJar(project.file("path/to/jar/to/decompile.jar"), "src/main/java")
39+
}
40+
}
41+
}
42+
```
43+
44+
When using the `projectWorkspace` workspace definition, the Patchify Gradle plugin willautomatically find the best paths
45+
to use.
46+
47+
If you want Patchify to handle decompilation and patching for you, use the `decompileJar` initializer. This is the step
48+
that is done to prepare the source-code for patching.
49+
50+
## Command-line interface
51+
52+
Patchify also provides a command-line interface that can be used to manage and automate patching of source-code.
853

954
```
1055
Usage: patchify [OPTIONS] COMMAND [ARGS]...
1156
57+
Patchify is a tool used to manage/automate code projects that require
58+
source-code patching.
59+
1260
Options:
1361
-h, --help Show this message and exit
1462
1563
Commands:
16-
init Initializes a git repository to be able to patch
17-
source-code
18-
rebuild-patches Rebuild patches.
19-
apply-patches Apply all patches to the project.
20-
edit-patch Edits a patch
64+
init Initialize a new patchify workspace
65+
apply-patches Apply all patches to the source code
66+
rebuild-patches Rebuilds all patches
2167
```
2268

23-
## Commands
69+
### Commands
2470

25-
| Command | Description |
26-
|:-----------------------:| ---------------------------------------------------------------------------- |
27-
| `init` | Initializes a git repository to be able to patch source-code. |
28-
| `rebuild-patches` | Rebuild patch files through the commits done to the source directory. |
29-
| `apply-patches` | Applies the patches on the `patches` directory to the `source` directory |
30-
| `edit-patch` | Allows you to edit an existing patch by rolling back to the commit. |
31-
| `edit-patch --continue` | Finishes the edit of the specific patch. Automatically rebuilds the patches. |
32-
| `edit-patch --abort` | Cancels the edit of the specific patch. |
71+
| Command | Description |
72+
|:-----------------------:|------------------------------------------------------------------------------|
73+
| `init` | Initializes a git repository to be able to patch source-code. |
74+
| `rebuild-patches` | Rebuild patch files through the commits done to the source directory. |
75+
| `apply-patches` | Applies the patches on the `patches` directory to the `source` directory |

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ allprojects {
77
version = "2.1.0-SNAPSHOT"
88
}
99

10-
arrayOf("core", "gradle-plugin").forEach { name ->
10+
arrayOf("core", "cli", "gradle-plugin").forEach { name ->
1111
project(name) {
1212
apply(plugin = "org.jetbrains.kotlin.jvm")
1313
apply(plugin = "java-library")

cli/build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,16 @@ dependencies {
1616

1717
/* Jackson - Json Parser */
1818
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.3")
19+
}
20+
21+
application {
22+
mainClass.set("io.github.nickacpt.patchify.cli.EntrypointKt")
23+
}
24+
25+
tasks {
26+
shadowJar {
27+
manifest {
28+
attributes(mapOf("Main-Class" to application.mainClassName))
29+
}
30+
}
1931
}

0 commit comments

Comments
 (0)