Skip to content

Commit

Permalink
Stop using conventions for java/version
Browse files Browse the repository at this point in the history
  • Loading branch information
robotgryphon committed Dec 14, 2024
1 parent 4de8ce7 commit 22cf245
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 44 deletions.
30 changes: 1 addition & 29 deletions buildSrc/src/main/kotlin/gander-convention.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import dev.compactmachines.GanderConstants
import org.slf4j.event.Level

var envVersion: String = System.getenv("VERSION") ?: "9.9.9"
if (envVersion.startsWith("v"))
envVersion = envVersion.trimStart('v')

plugins {
id("java-library")
id("idea")
Expand All @@ -17,13 +13,7 @@ plugins {
// pulling in version data from GanderConstants since version catalogs
// from the main outer project are not accessible here

base {
archivesName = project.name
group = "dev.compactmods.gander"
version = envVersion

libsDirectory.convention(rootProject.layout.projectDirectory.dir("libs/${project.name}"))
}
base.libsDirectory.convention(rootProject.layout.projectDirectory.dir("libs/${project.name}"))

idea.module {
if(!GanderConstants.IS_CI) {
Expand Down Expand Up @@ -93,21 +83,3 @@ javaToolchains.compilerFor {
languageVersion.convention(GanderConstants.JAVA_VERSION)
vendor.convention(GanderConstants.JAVA_VENDOR)
}

val PACKAGES_URL = System.getenv("GH_PKG_URL") ?: "https://maven.pkg.github.com/compactmods/gander"
publishing {
publications.register<MavenPublication>(project.name) {
from(components.getByName("java"))
}

repositories {
// GitHub Packages
maven(PACKAGES_URL) {
name = "GitHubPackages"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
28 changes: 27 additions & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
val isRelease: Boolean = (System.getenv("RELEASE") ?: "false").equals("true", true)
var envVersion: String = System.getenv("VERSION") ?: "9.9.9"
if (envVersion.startsWith("v"))
envVersion = envVersion.trimStart('v')

plugins {
id("gander-convention")
}

base {
archivesName = project.name
group = "dev.compactmods.gander"
version = envVersion
}

val PACKAGES_URL = System.getenv("GH_PKG_URL") ?: "https://maven.pkg.github.com/compactmods/gander"
publishing {
publications.register<MavenPublication>(project.name) {
from(components.getByName("java"))
}

repositories {
// GitHub Packages
maven(PACKAGES_URL) {
name = "GitHubPackages"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
33 changes: 26 additions & 7 deletions levels/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
var envVersion: String = System.getenv("VERSION") ?: "9.9.9"
if (envVersion.startsWith("v"))
envVersion = envVersion.trimStart('v')

plugins {
id("gander-convention")
}

// simply exists to apply the module convention script
// sets up MDG workspace and includes manifest data from resources dir
// additional setup specific to this module may be applied here
base {
archivesName = project.name
group = "dev.compactmods.gander"
version = envVersion
}

val PACKAGES_URL = System.getenv("GH_PKG_URL") ?: "https://maven.pkg.github.com/compactmods/gander"
publishing {
publications.register<MavenPublication>(project.name) {
from(components.getByName("java"))
}

//mixin {
// add(sourceSets[SourceSet.MAIN_SOURCE_SET_NAME], "gander_levels.mixins.json")
// config("gander_levels.mixins.json")
//}
repositories {
// GitHub Packages
maven(PACKAGES_URL) {
name = "GitHubPackages"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
33 changes: 26 additions & 7 deletions rendering/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
var envVersion: String = System.getenv("VERSION") ?: "9.9.9"
if (envVersion.startsWith("v"))
envVersion = envVersion.trimStart('v')

plugins {
id("gander-convention")
}

// simply exists to apply the module convention script
// sets up MDG workspace and includes manifest data from resources dir
// additional setup specific to this module may be applied here
base {
archivesName = project.name
group = "dev.compactmods.gander"
version = envVersion
}

val PACKAGES_URL = System.getenv("GH_PKG_URL") ?: "https://maven.pkg.github.com/compactmods/gander"
publishing {
publications.register<MavenPublication>(project.name) {
from(components.getByName("java"))
}

//mixin {
// add(sourceSets[SourceSet.MAIN_SOURCE_SET_NAME], "gander_render.mixins.json")
// config("gander_render.mixins.json")
//}
repositories {
// GitHub Packages
maven(PACKAGES_URL) {
name = "GitHubPackages"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
28 changes: 28 additions & 0 deletions ui/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
var envVersion: String = System.getenv("VERSION") ?: "9.9.9"
if (envVersion.startsWith("v"))
envVersion = envVersion.trimStart('v')

plugins {
id("gander-convention")
}

base {
archivesName = project.name
group = "dev.compactmods.gander"
version = envVersion
}

dependencies {
implementation(project(":core"))
implementation(project(":rendering"))
}

val PACKAGES_URL = System.getenv("GH_PKG_URL") ?: "https://maven.pkg.github.com/compactmods/gander"
publishing {
publications.register<MavenPublication>(project.name) {
from(components.getByName("java"))
}

repositories {
// GitHub Packages
maven(PACKAGES_URL) {
name = "GitHubPackages"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

0 comments on commit 22cf245

Please sign in to comment.