Skip to content

Commit

Permalink
move main project to a subdirectory & subprojects to root directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Pixaurora committed Jul 18, 2024
1 parent ed4046a commit afc9ff0
Show file tree
Hide file tree
Showing 182 changed files with 54 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: kit-tunes-artifacts
path: build/libs
path: kit-tunes/build/libs
if-no-files-found: error
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
import org.gradle.api.Project;

public class ProjectMetadata {
private final Project project;
private final ProjectProperties properties;

public ProjectMetadata(Project project) {
this.project = project;
this.properties = new ProjectProperties(project);
}

Expand All @@ -25,25 +23,25 @@ public String modId() {
return modId;
}

public String version() {
return this.properties.requireString(Property.MOD_VERSION);
}
public String version() {
return this.properties.requireString(Property.MOD_VERSION);
}

public String archiveName() {
String base = this.modId().replace("_", "-");

if (this.isRootProject()) {
if (this.isMainProject()) {
base += "-" + this.properties.requireString(Property.UPDATE_TITLE);
}

if (!this.project.hasProperty(Property.MINECRAFT_VERSION_MIN.key())) {
if (!this.properties.has(Property.MINECRAFT_VERSION_MIN)) {
return base;
} else {
return base + "-minecraft-" + this.properties.requireString(Property.MINECRAFT_VERSION_MIN);
}
}

private boolean isRootProject() {
return this.project.getRootProject().equals(this.project);
private boolean isMainProject() {
return this.properties.has(Property.IS_MAIN_PROJECT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ public Optional<String> optionalString(Property property) {
public String requireString(Property property) {
return this.optionalString(property).get();
}

public boolean has(Property property) {
return this.project.hasProperty(property.key());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ public enum Property {
SUB_MOD_ID("sub_mod_name"),
MOD_VERSION("mod_version"),
UPDATE_TITLE("update_title"),
MINECRAFT_VERSION_MIN("minecraft_version_min");
MINECRAFT_VERSION_MIN("minecraft_version_min"),
IS_MAIN_PROJECT("main_project");

private final String key;

Expand Down
18 changes: 0 additions & 18 deletions build.gradle.kts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

dependencies {
implementation(project(":subprojects:api"))
implementation(project(":api"))

implementation(libs.annotations)
implementation(libs.quilt.loader)
Expand Down
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions kit-tunes/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
plugins {
id("kit_tunes.java.17")
id("kit_tunes.module")
}

dependencies {
include(project(":api"))
include(project(":heart"))

include(project(":sound_events:r1.20.4"))

include(project(":ui:r1.20.4"))
include(project(":ui:r1.21.0"))
}

tasks.withType<Jar> {
from("LICENSE")
}
1 change: 1 addition & 0 deletions kit-tunes/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main_project=
File renamed without changes.
12 changes: 7 additions & 5 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ plugins {

includeBuild("build-logic")

include("subprojects:api")
include("subprojects:core")
include("kit-tunes")

include("subprojects:sound_events:r1.20.4")
include("api")
include("heart")

include("subprojects:ui:r1.20.4")
include("subprojects:ui:r1.21.0")
include("sound_events:r1.20.4")

include("ui:r1.20.4")
include("ui:r1.21.0")
9 changes: 9 additions & 0 deletions sound_events/r1.20.4/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
id("kit_tunes.java.17")
id("kit_tunes.module")
}

dependencies {
implementation(project(":api"))
implementation(project(":heart"))
}
File renamed without changes.
9 changes: 0 additions & 9 deletions subprojects/sound_events/r1.20.4/build.gradle.kts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ repositories {
}

dependencies {
implementation(project(":subprojects:api"))
implementation(project(":subprojects:core"))
implementation(project(":api"))
implementation(project(":heart"))

modImplementation(libs.qsl.resource.loader)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ repositories {
}

dependencies {
implementation(project(":subprojects:api"))
implementation(project(":subprojects:core"))
implementation(project(":api"))
implementation(project(":heart"))

modImplementation(fabricApi.module("fabric-resource-loader-v0", project.property("fabric_api_version").toString()))

Expand Down
File renamed without changes.

0 comments on commit afc9ff0

Please sign in to comment.