Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Commit

Permalink
Platform support
Browse files Browse the repository at this point in the history
  • Loading branch information
robotgryphon committed Jan 24, 2024
1 parent 9a79cdd commit 45263cb
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 136 deletions.
42 changes: 42 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
val versionMain: String = System.getenv("VERSION") ?: "0.0.0"

plugins {
id("java-platform")
id("maven-publish")
}

javaPlatform.allowDependencies()

base {
group = "dev.compactmods.compactmachines"
version = versionMain
}

afterEvaluate {
println(rootProject.name)
rootProject.childProjects.forEach {
println(it.key)
}
}

var deps: List<Project> = listOf(
project(":core-api"),
project(":room-api"),
project(":room-upgrade-api")
)

dependencies {
deps.forEach {
api(it)
runtime(it)
}
}

publishing {
publications {
create<MavenPublication>("platform") {
artifactId = "platform"
from(components["javaPlatform"])
}
}
}
109 changes: 0 additions & 109 deletions common-compat/build.gradle.kts

This file was deleted.

4 changes: 1 addition & 3 deletions core-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import java.text.SimpleDateFormat
import java.util.*

val versionMain: String = System.getenv("VERSION") ?: "0.0.0"
val mcVersion = property("minecraft_version") as String
// val parchmentVersion = property("parchment_version") as String

plugins {
java
Expand All @@ -13,7 +11,7 @@ plugins {
}

minecraft {
version(mcVersion)
version(libraries.versions.minecraft.get())
}

sourceSets {
Expand Down
21 changes: 10 additions & 11 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import java.text.SimpleDateFormat
import java.util.*

val versionMain: String = System.getenv("VERSION") ?: "0.0.0"
val mcVersion = property("minecraft_version") as String
// val parchmentVersion = property("parchment_version") as String
val feather_version = property("feather_version") as String

plugins {
java
Expand All @@ -14,7 +11,7 @@ plugins {
}

minecraft {
version(mcVersion)
version(libraries.versions.minecraft.get())
}

sourceSets {
Expand Down Expand Up @@ -64,19 +61,21 @@ repositories {
}

val cmModules = listOf(
project(":core-api"),
project(":room-api"),
project(":room-upgrade-api")
findProject(":core-api"),
findProject(":room-api"),
findProject(":room-upgrade-api")
)

dependencies {
cmModules.forEach {
implementation(it)
testImplementation(it)
if(it != null) {
implementation(it)
testImplementation(it)
}
}

compileOnly("com.aventrix.jnanoid", "jnanoid", "2.0.0")
implementation("dev.compactmods", "feather", feather_version)
compileOnly(libraries.feather)
implementation(libraries.jnanoid)
}

tasks.withType<JavaCompile> {
Expand Down
3 changes: 0 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

minecraft_version=1.20.4
feather_version=0.1.6

mod_id=compactmachines
4 changes: 1 addition & 3 deletions room-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import java.text.SimpleDateFormat
import java.util.*

val versionMain: String = System.getenv("VERSION") ?: "0.0.0"
val mcVersion = property("minecraft_version") as String
// val parchmentVersion = property("parchment_version") as String

plugins {
java
Expand All @@ -13,7 +11,7 @@ plugins {
}

minecraft {
version(mcVersion)
version(libraries.versions.minecraft.get())
}

base {
Expand Down
4 changes: 1 addition & 3 deletions room-upgrade-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import java.text.SimpleDateFormat
import java.util.*

val versionMain: String = System.getenv("VERSION") ?: "0.0.0"
val mcVersion = property("minecraft_version") as String
// val parchmentVersion = property("parchment_version") as String

plugins {
java
Expand All @@ -13,7 +11,7 @@ plugins {
}

minecraft {
version(mcVersion)
version(libraries.versions.minecraft.get())
}

base {
Expand Down
17 changes: 13 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
dependencyResolutionManagement {
versionCatalogs.create("libraries") {
library("feather", "dev.compactmods:feather:0.1.6")
library("jnanoid", "com.aventrix.jnanoid:jnanoid:2.0.0")

version("minecraft", "1.20.4")
}
}

pluginManagement {
repositories {
mavenCentral()
Expand Down Expand Up @@ -25,10 +34,10 @@ plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version("0.5.0")
}

rootProject.name = "Compact Machines Core"

include("core-api")
include("core")
// include("common-compat")
include("core-api")
include("room-api")
include("room-upgrade-api")

include("platform")

0 comments on commit 45263cb

Please sign in to comment.