aboutsummaryrefslogtreecommitdiff
path: root/src/test/groovy/net/fabricmc/loom/BuildUtils.groovy
diff options
context:
space:
mode:
authorMitchell Skaggs <skaggsm333@gmail.com>2019-06-15 16:28:37 -0500
committerMitchell Skaggs <skaggsm333@gmail.com>2019-06-15 16:28:37 -0500
commitc0a58d1bc7d2860ea9c5a94263f9930475c08d08 (patch)
treea2efd85c1c68e0e3411623f3c2d39a2dc0c8bea5 /src/test/groovy/net/fabricmc/loom/BuildUtils.groovy
parent52814a5b7bb673aa14cffd4a2b38dceff5395cef (diff)
downloadarchitectury-loom-c0a58d1bc7d2860ea9c5a94263f9930475c08d08.tar.gz
architectury-loom-c0a58d1bc7d2860ea9c5a94263f9930475c08d08.tar.bz2
architectury-loom-c0a58d1bc7d2860ea9c5a94263f9930475c08d08.zip
Add simple build functional test
Diffstat (limited to 'src/test/groovy/net/fabricmc/loom/BuildUtils.groovy')
-rw-r--r--src/test/groovy/net/fabricmc/loom/BuildUtils.groovy65
1 files changed, 62 insertions, 3 deletions
diff --git a/src/test/groovy/net/fabricmc/loom/BuildUtils.groovy b/src/test/groovy/net/fabricmc/loom/BuildUtils.groovy
index 3a64137a..f8f5d19f 100644
--- a/src/test/groovy/net/fabricmc/loom/BuildUtils.groovy
+++ b/src/test/groovy/net/fabricmc/loom/BuildUtils.groovy
@@ -87,10 +87,10 @@ publishing {
"""
}
-static String genPropsFile(String mcVersion, String yarnVersion, String loaderVersion, String fabricVersion) {
+static String genPropsFile(String mcVersion, String yarnVersion, String loaderVersion, String fabricVersion, boolean caching = true, boolean parallel = true) {
"""
-org.gradle.caching=true
-org.gradle.parallel=true
+org.gradle.caching=$caching
+org.gradle.parallel=$parallel
# Fabric Properties
# check these on https://fabricmc.net/use
@@ -114,3 +114,62 @@ static String genSettingsFile(String name) {
rootProject.name = '$name'
"""
}
+
+static String genModJsonFile() {
+ """
+{
+ "schemaVersion": 1,
+ "id": "modid",
+ "version": "\${version}",
+
+ "name": "Example Mod",
+ "description": "This is an example description! Tell everyone what your mod is about!",
+ "authors": [
+ "Me!"
+ ],
+ "contact": {
+ "homepage": "https://fabricmc.net/",
+ "sources": "https://github.com/FabricMC/fabric-example-mod"
+ },
+
+ "license": "CC0-1.0",
+
+ "environment": "*",
+ "entrypoints": {
+ "main": [
+ "net.fabricmc.example.ExampleMod"
+ ]
+ },
+ "mixins": [
+ "modid.mixins.json"
+ ],
+
+ "depends": {
+ "fabricloader": ">=0.4.0",
+ "fabric": "*"
+ },
+ "suggests": {
+ "flamingo": "*"
+ }
+}
+"""
+}
+
+static String genModExampleFile() {
+ """
+package net.fabricmc.example;
+
+import net.fabricmc.api.ModInitializer;
+
+public class ExampleMod implements ModInitializer {
+ @Override
+ public void onInitialize() {
+ // This code runs as soon as Minecraft is in a mod-load-ready state.
+ // However, some things (like resources) may still be uninitialized.
+ // Proceed with mild caution.
+
+ System.out.println("Hello Fabric world!");
+ }
+}
+"""
+}