Skip to content

Commit

Permalink
Build sources are engine room too
Browse files Browse the repository at this point in the history
- Update buildSrc to use engine_room package
- Publish artifacts under engine_room
- Specify group in gradle.properties
  • Loading branch information
Jozufozu committed May 25, 2024
1 parent a69389c commit 9593126
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 22 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ repositories {
}
dependencies {
compileOnly fg.deobf("com.jozufozu.flywheel:flywheel-forge-api-${minecraft_version}:${flywheel_version}")
runtimeOnly fg.deobf("com.jozufozu.flywheel:flywheel-forge-${minecraft_version}:${flywheel_version}")
compileOnly fg.deobf("dev.engine_room.flywheel:flywheel-forge-api-${minecraft_version}:${flywheel_version}")
runtimeOnly fg.deobf("dev.engine_room.flywheel:flywheel-forge-${minecraft_version}:${flywheel_version}")
}
```
`${flywheel_version}` gets replaced by the version of Flywheel you want to use, eg. `1.0.0-beta`

`${minecraft_version}` gets replaced by the version of Minecraft you're on, eg. `1.20.1`

For a list of available Flywheel versions, you can check [the maven](https://maven.tterrag.com/com/jozufozu/flywheel/Flywheel-Forge/).
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ gradlePlugin {
plugins {
create("platformPlugin") {
id = "flywheel.platform"
implementationClass = "com.jozufozu.gradle.platform.PlatformPlugin"
implementationClass = "dev.engine_room.gradle.platform.PlatformPlugin"
}
create("subprojectPlugin") {
id = "flywheel.subproject"
implementationClass = "com.jozufozu.gradle.subproject.SubprojectPlugin"
implementationClass = "dev.engine_room.gradle.subproject.SubprojectPlugin"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jozufozu.gradle.jarset
package dev.engine_room.gradle.jarset

import net.fabricmc.loom.task.RemapJarTask
import net.fabricmc.loom.task.RemapSourcesJarTask
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jozufozu.gradle.jarset
package dev.engine_room.gradle.jarset

import net.fabricmc.loom.task.AbstractRemapJarTask
import net.fabricmc.loom.task.RemapJarTask
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jozufozu.gradle.nullability
package dev.engine_room.gradle.nullability

import org.apache.groovy.nio.extensions.NioExtensions
import org.codehaus.groovy.runtime.StringGroovyMethods
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jozufozu.gradle.nullability
package dev.engine_room.gradle.nullability

import org.gradle.api.Project
import org.gradle.api.tasks.Delete
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.jozufozu.gradle.platform
package dev.engine_room.gradle.platform

import com.jozufozu.gradle.jarset.JarTaskSet
import dev.engine_room.gradle.jarset.JarTaskSet
import net.fabricmc.loom.api.LoomGradleExtensionAPI
import org.gradle.api.Project
import org.gradle.api.tasks.SourceSet
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jozufozu.gradle.platform
package dev.engine_room.gradle.platform

import org.gradle.api.Plugin
import org.gradle.api.Project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.jozufozu.gradle.subproject
package dev.engine_room.gradle.subproject

import com.jozufozu.gradle.jarset.JarSetExtension
import com.jozufozu.gradle.nullability.PackageInfosExtension
import com.jozufozu.gradle.transitive.TransitiveSourceSetsExtension
import dev.engine_room.gradle.jarset.JarSetExtension
import dev.engine_room.gradle.nullability.PackageInfosExtension
import dev.engine_room.gradle.transitive.TransitiveSourceSetsExtension
import net.fabricmc.loom.api.LoomGradleExtensionAPI
import org.gradle.api.JavaVersion
import org.gradle.api.Plugin
Expand Down Expand Up @@ -38,12 +38,14 @@ class SubprojectPlugin: Plugin<Project> {
val dev = System.getenv("RELEASE")?.contentEquals("false", true) ?: true
val buildNumber = System.getenv("BUILD_NUMBER")

val mod_version: String by project
project.group = "com.jozufozu.flywheel"
project.version = mod_version + if (dev && buildNumber != null) "-${buildNumber}" else ""
val versionSuffix = if (dev && buildNumber != null) "-${buildNumber}" else ""

val artifact_minecraft_version: String by project
project.the<BasePluginExtension>().archivesName = "flywheel-${project.name}-${artifact_minecraft_version}"
project.group = project.property("group") as String
project.version = "${project.property("mod_version")}${versionSuffix}"

project.the<BasePluginExtension>().apply {
archivesName = "flywheel-${project.name}-${project.property("artifact_minecraft_version")}"
}
}

@Suppress("UnstableApiUsage")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jozufozu.gradle.transitive
package dev.engine_room.gradle.transitive

import org.gradle.api.tasks.SourceSet

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jozufozu.gradle.transitive
package dev.engine_room.gradle.transitive

import org.gradle.api.Action
import org.gradle.api.Project
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ embeddium_version = 0.3.9+mc1.20.1
oculus_version = 1.20.1-1.6.15a

# Publication info
group = dev.engine_room.flywheel
artifact_minecraft_version = 1.20.1

0 comments on commit 9593126

Please sign in to comment.