Skip to content

Commit d9174a8

Browse files
authored
Merge pull request #2 from YourMCGeek/main
Support Jitpack building
2 parents 79d419d + ec3c8f1 commit d9174a8

File tree

4 files changed

+55
-8
lines changed

4 files changed

+55
-8
lines changed

README.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
[jitpack]: https://img.shields.io/jitpack/v/github/swanis/mcmarket-api-java-wrapper?label=Version&style=for-the-badge
2+
3+
<a href="https://mc-market.org/"><img alt="mc-market logo" align="right" src="https://i.imgur.com/kYnUS4c.png?raw=true" height="200" width="200"></a>
4+
5+
[ ![jitpack][] ](https://jitpack.io/#swanis/mcmarket-api-java-wrapper)
16
# mcmarket-api-java-wrapper
27

8+
39
This is a complete and easy-to-use Java wrapper for the [MC-Market Ultimate API](https://www.mc-market.org/wiki/ultimate-api/) built with Java SE Development Kit 17.0.1.
410

511
# Sending a request
@@ -39,19 +45,30 @@ if (response.getError() == null) {
3945
```
4046
Sortable fields can be found at the official API documentation [here](https://www.mc-market.org/wiki/ultimate-api-v1/).
4147

42-
# Maven Installation Guide
43-
1. Download the latest JAR file [here](https://github.com/swanis/mcmarket-api-java-wrapper/releases).
48+
# Jitpack Installation
49+
## Gradle
50+
```groovy
51+
repositories {
52+
maven { url 'https://jitpack.io' }
53+
}
4454
45-
2. Run this command in your terminal to add the jar file as a maven dependency in your local repository:
46-
```bash
47-
mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile=<path-to-file>
55+
dependencies {
56+
implementation 'com.github.MC-Market-org:mcmarket-api-java-wrapper:VERSION'
57+
}
4858
```
4959

50-
3. Add it to your project's dependencies as such:
60+
## Maven
5161
```xml
62+
<repositories>
63+
<repository>
64+
<id>jitpack.io</id>
65+
<url>https://jitpack.io</url>
66+
</repository>
67+
</repositories>
68+
5269
<dependency>
53-
<groupId>is.swan</groupId>
70+
<groupId>com.github.MC-Market-org</groupId>
5471
<artifactId>mcmarket-api-java-wrapper</artifactId>
55-
<version>1.1-SNAPSHOT</version>
72+
<version>VERSION</version>
5673
</dependency>
5774
```

assets/icon-blue.png

12.3 KB
Loading

ensure-java-17

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
JV=$(java -version 2>&1 >/dev/null | head -1)
4+
echo $JV | sed -E 's/^.*version "([^.]*)\.[^"].*$/\1/'
5+
6+
if [ "$JV" != 17 ]; then
7+
case "$1" in
8+
install)
9+
echo "Installing SDKMAN..."
10+
curl -s "https://get.sdkman.io" | bash
11+
source ~/.sdkman/bin/sdkman-init.sh
12+
sdk version
13+
sdk install java 17.0.1-open
14+
;;
15+
use)
16+
echo "must source ~/.sdkman/bin/sdkman-init.sh"
17+
exit 1
18+
;;
19+
esac
20+
fi

jitpack.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
jdf:
2+
- openjdk17
3+
before_install:
4+
- echo "Before Install"
5+
- bash ensure-java-17 install
6+
install:
7+
- echo "Install"
8+
- if ! bash ensure-java-17 use; then source ~/.sdkman/bin/sdkman-init.sh; fi
9+
- java -version
10+
- mvn install clean -DskipTests

0 commit comments

Comments
 (0)