aboutsummaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-07-27 02:13:43 +0800
committershedaniel <daniel@shedaniel.me>2022-07-27 02:13:43 +0800
commitf2345acc57d7d347507505a6976e20378bc0fbf9 (patch)
treedbff335e174954e836c95f9344390feb3750da43 /build.gradle
parent1d8b8e4e91adb33d208a5c3b4b2ccc36a0ef25a4 (diff)
downloadRoughlyEnoughItems-f2345acc57d7d347507505a6976e20378bc0fbf9.tar.gz
RoughlyEnoughItems-f2345acc57d7d347507505a6976e20378bc0fbf9.tar.bz2
RoughlyEnoughItems-f2345acc57d7d347507505a6976e20378bc0fbf9.zip
Make Architectury Plugin compile only
Diffstat (limited to 'build.gradle')
-rwxr-xr-xbuild.gradle48
1 files changed, 32 insertions, 16 deletions
diff --git a/build.gradle b/build.gradle
index 863cf6844..3fefac531 100755
--- a/build.gradle
+++ b/build.gradle
@@ -3,16 +3,11 @@ plugins {
id("dev.architectury.loom") version("0.12.0-SNAPSHOT") apply false
id("org.cadixdev.licenser") version("0.6.1")
id("me.shedaniel.unified-publishing") version("0.1.+")
- id("java")
id("maven-publish")
}
import java.text.SimpleDateFormat
-base {
- archivesBaseName = "RoughlyEnoughItems"
-}
-
def runNumber = System.getenv("GITHUB_RUN_NUMBER") ?: "9999"
version = rootProject.base_version + "." + runNumber + (rootProject.unstable.toBoolean() ? "-alpha" : "")
@@ -20,8 +15,11 @@ group = "me.shedaniel"
subprojects {
apply plugin: "me.shedaniel.unified-publishing"
+ apply plugin: "java"
apply plugin: "dev.architectury.loom"
+ sourceCompatibility = targetCompatibility = 1.8
+
java {
withSourcesJar()
}
@@ -38,6 +36,31 @@ subprojects {
crane("dev.architectury:crane:1.17+build.11")
})
}
+
+ jar {
+ from rootProject.file("LICENSE")
+ }
+
+ tasks.withType(JavaCompile) {
+ options.encoding = "UTF-8"
+ options.release = 17
+ }
+}
+
+subprojects {
+ if (project.path == ':fabric' || project.path == ':forge') {
+ loom {
+ mods {
+ main { // to match the default mod generated for Forge
+ sourceSet project.sourceSets.main
+ def depProjects = [":api", ":runtime", ":default-plugin"]
+ depProjects.each {
+ sourceSet project(it).sourceSets.main
+ }
+ }
+ }
+ }
+ }
}
allprojects {
@@ -45,14 +68,16 @@ allprojects {
apply plugin: "architectury-plugin"
apply plugin: "org.cadixdev.licenser"
- sourceCompatibility = targetCompatibility = 1.8
+ architectury {
+ compileOnly()
+ }
repositories {
maven { url "https://maven.shedaniel.me" }
maven { url "https://maven.parchmentmc.org" }
maven { url "https://maven.terraformersmc.com/releases" }
}
-
+
license {
header rootProject.file("HEADER")
include "**/*.java"
@@ -64,15 +89,6 @@ allprojects {
}
}
- jar {
- from rootProject.file("LICENSE")
- }
-
- tasks.withType(JavaCompile) {
- options.encoding = "UTF-8"
- options.release = 17
- }
-
tasks.withType(GenerateModuleMetadata) {
enabled = false
}