Skip to content

Commit

Permalink
use sourceSet instead of subproject
Browse files Browse the repository at this point in the history
  • Loading branch information
Mari023 committed Jul 10, 2024
1 parent d3aa975 commit ca32ef0
Show file tree
Hide file tree
Showing 39 changed files with 64 additions and 143 deletions.
101 changes: 0 additions & 101 deletions api/build.gradle.kts

This file was deleted.

1 change: 0 additions & 1 deletion api/gradle.properties

This file was deleted.

104 changes: 64 additions & 40 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("net.neoforged.moddev") version "0.1.124"
id("net.neoforged.moddev") version "0.1.126"
id("com.diffplug.spotless") version "7.0.0.BETA1"
id("maven-publish")
java
Expand Down Expand Up @@ -35,11 +35,22 @@ val artifactVersion = version

java.toolchain.languageVersion = JavaLanguageVersion.of(21)

sourceSets {
create("api")
}

configurations {
get("apiCompileOnly").extendsFrom(compileOnly.get())
get("apiImplementation").extendsFrom(implementation.get())
get("apiRuntimeOnly").extendsFrom(runtimeOnly.get())
compileClasspath.get().extendsFrom(create("localCompileOnly"))
}

dependencies {
//implementation("top.theillusivec4.curios:curios-neoforge:${curiosVersion}")
implementation("appeng:appliedenergistics2:${ae2Version}")
jarJar(project(path = ":api"))
implementation(project(path = ":api"))
configurations["localCompileOnly"].invoke(sourceSets["api"].output)
jarJar(sourceSets["api"].output)

compileOnly("me.shedaniel:RoughlyEnoughItems-neoforge:${reiVersion}")
compileOnly("mezz.jei:jei-${jeiMinecraftVersion}-neoforge:${jeiVersion}")
Expand Down Expand Up @@ -69,48 +80,46 @@ dependencies {
//runtimeOnly(fg.deobf("maven.modrinth:aeinfinitybooster:1.20.1-1.0.0+20"))
}

allprojects {
repositories {
mavenLocal()
mavenCentral()
maven {
url = uri("https://modmaven.dev/")
content {
includeGroup("appeng")
includeGroup("mezz.jei")
}
}
maven {
url = uri("https://maven.shedaniel.me/")
content {
includeGroup("me.shedaniel")
includeGroup("me.shedaniel.cloth")
includeGroup("dev.architectury")
}
}
maven {
url = uri("https://maven.terraformersmc.com/")
content {
includeGroup("dev.emi")
}
}
maven {
url = uri("https://maven.theillusivec4.top/")
content {
includeGroup("top.theillusivec4.curios")
}
}
maven {
url = uri("https://api.modrinth.com/maven")
content {
includeGroup("maven.modrinth")
}
repositories {
mavenLocal()
mavenCentral()
maven {
url = uri("https://modmaven.dev/")
content {
includeGroup("appeng")
includeGroup("mezz.jei")
}
}
maven {
url = uri("https://maven.shedaniel.me/")
content {
includeGroup("me.shedaniel")
includeGroup("me.shedaniel.cloth")
includeGroup("dev.architectury")
}
}
maven {
url = uri("https://maven.terraformersmc.com/")
content {
includeGroup("dev.emi")
}
}
maven {
url = uri("https://maven.theillusivec4.top/")
content {
includeGroup("top.theillusivec4.curios")
}
}
maven {
url = uri("https://api.modrinth.com/maven")
content {
includeGroup("maven.modrinth")
}
}
}

tasks {
processResources {
withType<ProcessResources> {
// Ensure the resources get re-evaluate when the version changes
inputs.property("version", version)
inputs.property("ae2_version", ae2Version)
Expand All @@ -127,6 +136,9 @@ tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
}
register("apiJar", Jar::class) {
from(sourceSets["api"].output)
}
}

neoForge {
Expand All @@ -135,6 +147,9 @@ neoForge {
create(modID) {
sourceSet(sourceSets.main.get())
}
create(modID + "_api") {
sourceSet(sourceSets["api"])
}
}
runs {
configureEach {
Expand All @@ -160,6 +175,15 @@ publishing {

from(components["java"])
}
create<MavenPublication>(modID + "_api") {
groupId = mavenGroup
artifactId = modID + "_api"
version = artifactVersion.toString()

artifact(tasks["apiJar"])
}
tasks["publishAe2wtlib_apiPublicationToMavenLocal"].dependsOn(tasks["jar"])
tasks["generateMetadataFileForAe2wtlibPublication"].dependsOn(tasks["apiJar"])
}
}

Expand Down
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
rootProject.name = "ae2wtlib"
include("api")
File renamed without changes

0 comments on commit ca32ef0

Please sign in to comment.