-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from Diluv/1.4.x
1.4.x Release
- Loading branch information
Showing
63 changed files
with
2,171 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#################### | ||
## Fabric/Minecraft | ||
#################### | ||
/run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Minecraft Fabric Example | ||
This example is used to debug Diluv's integration with Fabric's Loom Gradle plugin. This example has been configured to connect to a locally hosted instance of the Diluv API that has been supplied with our mock database. | ||
|
||
## Usage Guide | ||
1. Make sure the local DiluvGradle plugin has been built. This is done by running `./gradlew clean build` in the root directory of this project repo. | ||
2. Make sure the local API is running and that the `gradle.properties` file reflects your local API and database. | ||
3. Run `./gradlew clean build publishDiluv` in the example directory. | ||
|
||
## ⚠️Security Note⚠️ | ||
Remember to never publish your auth token in a public environment such as Github. Auth tokens are private information and should be treated with the same level of security as an account password. When using with a build server like Jenkins or GitHub actions the auth token should be injected as a build secret. | ||
|
||
## Verifying Integration | ||
To verify that integration with Loom was successful run the `./gradlew build publishDiluv -d` command. then look for the following things in your log. | ||
|
||
1. The build was successful. | ||
2. The log contains `[DiluvGradle] Applying loader fabric because pluing fabric-loom was found.` | ||
3. The log contains `[DiluvGradle] Diluv Response Code: 200`. | ||
4. The file was uploaded to the expected Diluv project. |
100 changes: 100 additions & 0 deletions
100
examples/local_minecraft_fabric_loom_gradle/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
buildscript { | ||
|
||
dependencies { | ||
|
||
classpath files { file('../../build/libs').listFiles()} | ||
classpath group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.5.2' | ||
classpath group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.2' | ||
classpath group: 'com.google.code.gson', name: 'gson', version: '2.6.2' | ||
} | ||
} | ||
|
||
plugins { | ||
|
||
id 'fabric-loom' version '0.5-SNAPSHOT' | ||
} | ||
|
||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
|
||
archivesBaseName = project.archives_base_name | ||
version = "${project.mod_version}.${Math.abs(new Random().nextInt())}" | ||
|
||
dependencies { | ||
|
||
minecraft "com.mojang:minecraft:${project.minecraft_version}" | ||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" | ||
|
||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" | ||
} | ||
|
||
processResources { | ||
|
||
inputs.property "version", project.version | ||
|
||
filesMatching("fabric.mod.json") { | ||
|
||
expand "version": project.version | ||
} | ||
} | ||
|
||
java { | ||
|
||
withSourcesJar() | ||
} | ||
|
||
// Diluv Publishing | ||
import com.diluv.diluvgradle.TaskDiluvUpload | ||
|
||
task publishDiluv (type: TaskDiluvUpload) { | ||
|
||
// ====================== | ||
// === REQUIRED STUFF === | ||
// ====================== | ||
|
||
// This token is used to authenticate with Diluv. It should be handled with the same | ||
// sensitivity and security as a password. This means you should never share this token | ||
// or upload it to a public location such as GitHub. These are commonly stored as secret | ||
// environmental variables. | ||
token = findProperty('diluv_token'); | ||
|
||
// This tells Diluv what project you are uploading the file to. You can find the ID for | ||
// any project on the Diluv Project Page. This is not considered secret or sensitive. | ||
projectId = findProperty('diluv_project'); | ||
|
||
// Tells DiluvGradle what file to upload. This can be a Java file, a path to a file, or | ||
// certain tasks which produce files such as any AbstractArchiveTask. | ||
uploadFile = jar; | ||
|
||
// ====================== | ||
// === OPTIONAL STUFF === | ||
// ====================== | ||
|
||
// Specifies the version of the file. This is auto-detected from Gradle's project.version | ||
// property if you do not specify this yourself. | ||
// setVersion('1.3.22'); | ||
|
||
// Specifies game versions that the file is compatible with. DiluvGradle can auto-detect | ||
// detect this from ForgeGradle if you don't specify at least one version. | ||
// addGameVersion('1.12.2'); | ||
|
||
// Specifies a changelog for your file. This can be hard coded or generated at build time. | ||
// setChangelog('The changelog string for your file.'); | ||
|
||
// Relations between your file and other files on Diluv can be defined like this. | ||
// addDependency(projectId); - A project that your file requires. | ||
// addOptionalDependency(projectId); - A project that your file has additional support for. | ||
// addIncompatibility(projectId); - A project that your file is not compatible with. | ||
|
||
// Specifies a mod loader that your file is compatible with. When ForgeGradle is present | ||
// the loader 'forge' will be added by default. When Loom is present 'fabric' is added. | ||
// addLoader('loadername'); | ||
|
||
// Defines the type of release this file is. This is 'alpha' by default. | ||
// Accepts 'alpha', 'beta', and 'release'. | ||
// setReleaseType('beta'); | ||
|
||
// Changes the API URL that DiluvGradle uses to authenticate and upload the file to. This | ||
// is primarily intended for debugging. | ||
apiURL = findProperty('diluv_api'); | ||
} |
15 changes: 15 additions & 0 deletions
15
examples/local_minecraft_fabric_loom_gradle/gradle.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
org.gradle.jvmargs=-Xmx1G | ||
|
||
# Fabric Properties | ||
minecraft_version=1.16.4 | ||
yarn_mappings=1.16.4+build.6 | ||
loader_version=0.10.6+build.214 | ||
|
||
# Mod Properties | ||
mod_version = 1.0 | ||
archives_base_name = diluv-fabric-test | ||
|
||
# Diluv Properties | ||
diluv_token=8dfa96ba-44b0-4eb0-930a-fca183e73ec8 | ||
diluv_project=1 | ||
diluv_api=http://127.0.0.1:4567 |
Binary file added
BIN
+57.8 KB
examples/local_minecraft_fabric_loom_gradle/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
.../gradle/wrapper/gradle-wrapper.properties → .../gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-6.7-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip |
Oops, something went wrong.