Skip to content

Commit

Permalink
Added more 'dynamic' build options
Browse files Browse the repository at this point in the history
  • Loading branch information
svenar-nl committed Aug 18, 2023
1 parent 694c4bd commit e1e253b
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 17 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,22 @@ This mod uses Gradle to handle dependencies & building.
```sh
git clone https://github.com/svenar-nl/FabricBlockedServersBypass.git
cd FabricBlockedServersBypass/
```
After that run
```sh
./gradlew build jar
```
or
```sh
./build-all.sh
```

You can find the output jar in the `build/libs` directory.
You can find the output jar in the `build/libs` directory (or in the `dist/` directory if using `build-all.sh`).

# Installing
To install and use the mod you need to have following:
* Fabric
* mc-blacklist-bypass-X.X.X.jar
* mc-blacklist-bypass-X.X.X-X.X.(X).jar

## License
This mod is licensed under the permissive MIT license. Please see the [`LICENSE`](https://github.com/svenar-nl/FabricBlockedServersBypass/blob/master/LICENSE) file for more info.
38 changes: 38 additions & 0 deletions build-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

versions=(
"1.20.1 1.20.1+build.10 0.14.22 0.87.0+1.20.1"
"1.20 1.20+build.1 0.14.22 0.83.0+1.20"
"1.19.4 1.19.4+build.2 0.14.22 0.87.0+1.19.4"
"1.19.3 1.19.3+build.5 0.14.22 0.76.1+1.19.3"
"1.19.2 1.19.2+build.28 0.14.22 0.76.1+1.19.2"
"1.19 1.19+build.4 0.14.22 0.58.0+1.19"
"1.18.2 1.18.2+build.4 0.14.22 0.76.0+1.18.2"
"1.18.1 1.18.1+build.22 0.14.22 0.46.6+1.18"
"1.18 1.18+build.1 0.14.22 0.46.6+1.18"
"1.17.1 1.17.1+build.65 0.14.22 0.46.1+1.17"
"1.17 1.17+build.13 0.14.22 0.46.1+1.17"
)

echo "Cleaning up..."

./gradlew clean
rm -rf dist
mkdir dist

echo "Building..."
for version_info in "${versions[@]}"; do
read -r minecraft_version yarn_mappings loader_version fabric_version <<<$version_info

echo "> $minecraft_version"
./gradlew build jar -q \
-Dorg.gradle.project.minecraft_version="$minecraft_version" \
-Dorg.gradle.project.yarn_mappings="$yarn_mappings" \
-Dorg.gradle.project.loader_version="$loader_version" \
-Dorg.gradle.project.fabric_version="$fabric_version"
echo "Done"
done

mv build/libs/* dist

echo "Complete!"
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

archivesBaseName = project.archives_base_name
version = project.mod_version
version = "${project.mod_version}-${project.minecraft_version}"
group = project.maven_group

repositories {
Expand Down Expand Up @@ -38,7 +38,7 @@ processResources {
inputs.property "version", project.version

filesMatching("fabric.mod.json") {
expand "version": project.version
expand(project.properties)
}
}

Expand Down
21 changes: 11 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
java_version=17

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.19
yarn_mappings=1.19+build.4
loader_version=0.14.8
# check these on https://fabricmc.net/develop
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.14.22

# Mod Properties
mod_version = 1.0.2
maven_group = nl.svenar
archives_base_name = mc-blacklist-bypass
#Fabric api
fabric_version=0.87.0+1.20.1

# Dependencies
fabric_version=0.58.0+1.19
# Mod Properties
mod_version = 1.0.3
maven_group = nl.svenar
archives_base_name = mc-blacklist-bypass
6 changes: 3 additions & 3 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
],

"depends": {
"fabricloader": ">=0.14.6",
"minecraft": "~1.19",
"java": ">=17"
"fabricloader": ">=${loader_version}",
"minecraft": "~${minecraft_version}",
"java": ">=${java_version}"
},
"suggests": {
"another-mod": "*"
Expand Down

0 comments on commit e1e253b

Please sign in to comment.