Skip to content

Commit ebb7d08

Browse files
committed
Update README.md to reflect Maven changes
1 parent c819ec4 commit ebb7d08

File tree

1 file changed

+18
-26
lines changed

1 file changed

+18
-26
lines changed

README.md

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,29 @@ If your mod is written in Java (and is, hence, a Jar mod), use this method.
3232

3333
2. **Add the library Jar file into your project as a Java dependency:**
3434

35-
This is a necessary step before you can compile your mod, since the library Jar contains the methods (functions) used to access custom JSON tags.\
36-
To get the library file, either download the latest release of `CustomJsonLib.jar` (NOT `CustomJsonLibCrossPlatform.jar`) from Releases, or compile your own (See [Building](#building) below).
35+
CustomJsonLib is available as a Maven package on GitHub. To include it as a dependency you're going to need to add the repository to your `build.gradle.kts` (or `build.gradle` if you're using Groovy) file:
3736

37+
```kotlin
38+
allprojects{
39+
// ...
40+
41+
repositories{
42+
// ...
43+
maven("https://raw.githubusercontent.com/ThePythonGuy3/CustomJSONLibMaven/main")
44+
//...
45+
}
46+
47+
// ...
48+
}
3849

39-
Copy the file into a directory called `lib/` you must create on your mod's root directory:
40-
```
41-
- YourAwesomeMod/
42-
- src/
43-
- assets/
44-
- ...
45-
- lib/
46-
- CustomJsonLib.jar
47-
```
50+
// ...
4851

49-
Assuming you're using Gradle as your build system, add the Jar file as a dependency in your mod's `build.gradle.kts`:
50-
```kotlin
5152
project(":"){
5253
// ...
5354

5455
dependencies{
5556
// ...
56-
compileOnly(files(layout.projectDirectory.dir("lib").file("CustomJsonLib.jar")))
57+
compileOnly("com.github.ThePythonGuy3.CustomJSONLib:pyguy.jsonlib:latest")
5758
}
5859

5960
// ...
@@ -311,30 +312,21 @@ This mod is, in theory, cross-platform, but only Windows has been tested. The on
311312
|-----------------|-----------------------|-----------------------|-----------------------|------------|
312313
| Fully supported | Untested, should work | Untested, should work | Untested, should work | No support |
313314
314-
### Building as a Library
315-
316-
If you want to include this mod as a library for your own Java mods (explained in [How do I use this library?](#how-do-i-use-this-library) above) you're going to need a library `jar` file.
317-
318-
The latest release can be found in Releases under the name `CustomJsonLib.jar`, but if you want to build your own, here are the steps:
319-
1. Open your terminal, and `cd` to your local copy of the mod.
320-
2. Ensure your internet connection is stable on the first or clean builds, as the project will try to fetch prerequisites from the internet.
321-
3. Run `gradlew lib` *(replace `gradlew` with `./gradlew` on Mac/Linux)*. This should create a JAR inside `build/libs/` that you can copy over to your mod's `lib/` folder to use it.
322-
323315
### Desktop Build
324316
325-
Desktop builds are convenient for testing, but will obviously **not** work on Android, so never include this in your releases. Desktop JARs have `Desktop` suffixed to their name (`CustomJsonLibDesktop.jar`). Here's how you can build the mod:
317+
Desktop builds are convenient for testing, but they will **not** work on Android. Desktop JARs have `Desktop` suffixed to their name (`CustomJsonLibDesktop.jar`). Here's how you can build the mod:
326318
327319
1. Open your terminal, and `cd` to your local copy of the mod.
328320
2. Ensure your internet connection is stable on the first or clean builds, as the project will try to fetch prerequisites from the internet.
329-
3. Run `gradlew jar` *(replace `gradlew` with `./gradlew` on Mac/Linux)*. This should create a JAR inside `build/libs/` that you can copy over to the Mindustry mods folder to install it.
321+
3. Run `gradlew jar` *(replace `gradlew` with `./gradlew` on Mac/Linux/Powershell)*. This should create a JAR inside `build/libs/` that you can copy over to the Mindustry mods folder to install it.
330322
4. You can also then run `gradlew install` to automatically install the mod JAR, or even `gradlew jar install` to do both compiling and installing at once.
331323
332324
### Android Build
333325
334326
Android builds are automated on the CI hosted by GitHub Actions, so you should be able to just push a commit and wait for the CI to provide your build. If you still want to build locally, though, follow these steps.
335327
336328
#### Installing Android SDK
337-
1. Install [Android SDK](https://developer.android.com/studio#command-line-tools-only), specifically the "**Command line tools only**" section. Download the tools that match your platform.
329+
1. Install the [Android SDK](https://developer.android.com/studio#command-line-tools-only), specifically the "**Command line tools only**" section. Download the tools that match your platform.
338330
2. Unzip the Android SDK command line tools inside a folder; let's call it `AndroidSDK/` for now.
339331
3. Inside this folder is a folder named `cmdline-tools/`. Put everything inside `cmdline-tools/` to a new folder named `latest/`, so that the folder structure looks like `AndroidSDK/cmdline-tools/latest/`.
340332
4. Open your terminal, `cd` to the `latest/` folder.

0 commit comments

Comments
 (0)