Skip to content

Commit

Permalink
refactor: Move the Kuma companion mod out of this repo to simplify bu…
Browse files Browse the repository at this point in the history
…ilds and since the API should change so seldomly that no benefits are gained from a monorepo
  • Loading branch information
BlayTheNinth committed Oct 24, 2024
1 parent 9b65cff commit 48c43e1
Show file tree
Hide file tree
Showing 96 changed files with 107 additions and 921 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/build.yml.disabled

This file was deleted.

67 changes: 0 additions & 67 deletions .github/workflows/publish-api-release.yml

This file was deleted.

37 changes: 4 additions & 33 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v3
- name: Extracting version from properties
shell: bash
run: echo "version=$(cat kuma/gradle.properties | grep -w "\bversion" | cut -d= -f2)" >> $GITHUB_OUTPUT
run: echo "version=$(cat gradle.properties | grep -w "\bversion" | cut -d= -f2)" >> $GITHUB_OUTPUT
id: extract-version
- name: Bumping version
uses: TwelveIterationMods/bump-version@v1
Expand All @@ -33,7 +33,7 @@ jobs:
id: bump-version
- name: Updating version properties
run: |
sed -i "s/^\s*version\s*=.*/version = ${{ steps.bump-version.outputs.version }}/g" kuma/gradle.properties
sed -i "s/^\s*version\s*=.*/version = ${{ steps.bump-version.outputs.version }}/g" gradle.properties
git config user.name "GitHub Actions"
git config user.email "<>"
git commit -am "Set version to ${{ steps.bump-version.outputs.version }}"
Expand All @@ -43,43 +43,14 @@ jobs:
shell: bash
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
publish-release-api:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
loader: [ common, fabric, forge, neoforge ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ needs.create-release.outputs.ref }}
- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
- name: Make gradle wrapper executable
run: chmod +x ./gradlew
- name: Publish API
run: ./gradlew :kuma-api:${{ matrix.loader }}:publish '-Pversion=${{needs.create-release.outputs.version}}' '-PtwelveIterationsNexusUsername=${{ secrets.NEXUS_USER }}' '-PtwelveIterationsNexusPassword=${{ secrets.NEXUS_PASSWORD }}'
needs: create-release
publish-release:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
loader: [ common, fabric, forge, neoforge ]
site: [ curseforge, modrinth, publish ]
exclude:
- loader: common
site: curseforge
- loader: common
site: modrinth
site: [ publish ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -95,7 +66,7 @@ jobs:
- name: Make gradle wrapper executable
run: chmod +x ./gradlew
- name: Publish
run: ./gradlew :kuma:${{ matrix.loader }}:${{ matrix.site }} '-Pversion=${{needs.create-release.outputs.version}}' '-PtwelveIterationsNexusUsername=${{ secrets.NEXUS_USER }}' '-PtwelveIterationsNexusPassword=${{ secrets.NEXUS_PASSWORD }}'
run: ./gradlew :${{ matrix.loader }}:${{ matrix.site }} '-Pversion=${{needs.create-release.outputs.version}}' '-PtwelveIterationsNexusUsername=${{ secrets.NEXUS_USER }}' '-PtwelveIterationsNexusPassword=${{ secrets.NEXUS_PASSWORD }}'
env:
CURSEFORGE_TOKEN: ${{secrets.CURSEFORGE_TOKEN}}
MODRINTH_TOKEN: ${{secrets.MODRINTH_TOKEN}}
Expand Down
18 changes: 3 additions & 15 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,15 @@ jobs:
distribution: temurin
- name: Make gradle wrapper executable
run: chmod +x ./gradlew
- name: Extracting API version from properties
shell: bash
run: echo "version=$(cat kuma-api/gradle.properties | grep -w "\bversion" | cut -d= -f2)" >> $GITHUB_OUTPUT
id: extract-api-version
- name: Extracting version from properties
shell: bash
run: echo "version=$(cat kuma/gradle.properties | grep -w "\bversion" | cut -d= -f2)" >> $GITHUB_OUTPUT
run: echo "version=$(cat gradle.properties | grep -w "\bversion" | cut -d= -f2)" >> $GITHUB_OUTPUT
id: extract-version
- name: Bumping API version
uses: TwelveIterationMods/bump-version@v1
with:
version: ${{ steps.extract-api-version.outputs.version }}
bump: patch
id: bump-api-version
- name: Bumping version
uses: TwelveIterationMods/bump-version@v1
with:
version: ${{ steps.extract-version.outputs.version }}
bump: minor
bump: patch
id: bump-version
- name: Publish API
run: ./gradlew :kuma-api:${{ matrix.loader }}:publish '-Pversion=${{ steps.bump-api-version.outputs.version }}-SNAPSHOT' '-PtwelveIterationsNexusUsername=${{ secrets.NEXUS_USER }}' '-PtwelveIterationsNexusPassword=${{ secrets.NEXUS_PASSWORD }}'
- name: Publish
run: ./gradlew :kuma:${{ matrix.loader }}:publish '-Pversion=${{ steps.bump-version.outputs.version }}-SNAPSHOT' '-PtwelveIterationsNexusUsername=${{ secrets.NEXUS_USER }}' '-PtwelveIterationsNexusPassword=${{ secrets.NEXUS_PASSWORD }}'
run: ./gradlew :${{ matrix.loader }}:publish '-Pversion=${{ steps.bump-version.outputs.version }}-SNAPSHOT' '-PtwelveIterationsNexusUsername=${{ secrets.NEXUS_USER }}' '-PtwelveIterationsNexusPassword=${{ secrets.NEXUS_PASSWORD }}'
46 changes: 19 additions & 27 deletions buildSrc/src/main/groovy/multiloader-common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ repositories {
}
}
filter { includeGroupAndSubgroups("org.spongepowered") }
exclusiveContent {
forRepositories(
maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org/'
},
maven {
name = "NeoForge"
url = 'https://maven.neoforged.net/releases'
}
)
filter { includeGroup('org.parchmentmc.data') }
}
}
maven { url "https://maven.twelveiterations.com/repository/maven-public/" }
exclusiveContent {
forRepositories(
maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org/'
},
maven {
name = "NeoForge"
url = 'https://maven.neoforged.net/releases'
}
)
filter { includeGroup('org.parchmentmc.data') }
}
}

dependencies {
Expand All @@ -50,8 +50,8 @@ dependencies {
// Read more about capabilities here: https://docs.gradle.org/current/userguide/component_capabilities.html#sec:declaring-additional-capabilities-for-a-local-component
['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements'].each { variant ->
configurations."$variant".outgoing {
capability("$group:${mod_id.replace('_', '-')}-${project.name}:$version")
capability("$group:${mod_id.replace('_', '-')}:$version")
capability("$group:$mod_id-${project.name}:$version")
capability("$group:$mod_id:$version")
}
publishing.publications.configureEach {
suppressPomMetadataWarningsFor(variant)
Expand All @@ -64,13 +64,6 @@ sourcesJar {
}
}

tasks.withType(Javadoc).tap {
configureEach {
failOnError false
options.addStringOption('Xdoclint:-missing', '-quiet')
}
}

jar {
from(rootProject.file("LICENSE")) {
rename { "${it}_${mod_name}" }
Expand All @@ -93,7 +86,7 @@ jar {
processResources {
def expandProps = [
"version": version,
"group": project.group,
"group": project.group, //Else we target the task's group.
"minecraft_version": minecraft_version,
"minimum_minecraft_version": minimum_minecraft_version,
"forge_version": forge_version,
Expand All @@ -106,7 +99,7 @@ processResources {
"mod_author": mod_author,
"mod_id": mod_id,
"license": license,
"description": description,
"description": project.description,
"neoforge_version": neoforge_version,
"neoforge_version_range": neoforge_version_range,
"neoforge_loader_version_range": neoforge_loader_version_range,
Expand All @@ -115,7 +108,7 @@ processResources {
"pack_format_number": pack_format_number,
"homepage": homepage,
"issues": issues,
"sources": sources,
"sources": sources
]

filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', 'META-INF/neoforge.mods.toml', '*.mixins.json']) {
Expand All @@ -128,8 +121,7 @@ publishing {
publications {
register('mavenJava', MavenPublication) {
version = project.version + (!project.version.endsWith("SNAPSHOT") ? "+" + minecraft_version : "")
artifactId "${mod_id.replace('_', '-')}-${project.name}"
group = project.group
artifactId "${mod_id}-${project.name}"
from components.java
}
}
Expand Down
10 changes: 5 additions & 5 deletions buildSrc/src/main/groovy/multiloader-loader.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ configurations {
}

dependencies {
compileOnly(project("${project.parent?.path}:common")) {
compileOnly(project(':common')) {
capabilities {
requireCapability "$group:${mod_id.replace('_', '-')}"
requireCapability "$group:$mod_id"
}
}
commonJava project(path: "${project.parent?.path}:common", configuration: 'commonJava')
commonResources project(path: "${project.parent?.path}:common", configuration: 'commonResources')
commonGeneratedResources project(path: "${project.parent?.path}:common", configuration: 'commonGeneratedResources')
commonJava project(path: ':common', configuration: 'commonJava')
commonResources project(path: ':common', configuration: 'commonResources')
commonGeneratedResources project(path: ':common', configuration: 'commonGeneratedResources')
}

tasks.named('compileJava', JavaCompile) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 8 additions & 6 deletions kuma-api/fabric/build.gradle → fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
plugins {
id 'multiloader-loader'
id 'fabric-loom'
id 'net.darkhax.curseforgegradle'
id "com.modrinth.minotaur"
}

dependencies {
Expand All @@ -17,7 +19,7 @@ apply from: rootProject.file('repositories.gradle')
apply from: 'dependencies.gradle'

loom {
def aw = project(":kuma-api:common").file("src/main/resources/${mod_id}.accesswidener")
def aw = project(":common").file("src/main/resources/${mod_id}.accesswidener")
if (aw.exists()) {
accessWidenerPath.set(aw)
}
Expand All @@ -29,25 +31,25 @@ loom {
runs {
client {
client()
setConfigName("fabric Client API")
setConfigName("fabric Client")
ideConfigGenerated(true)
runDir("runs/client")
}
server {
server()
setConfigName("fabric Server API")
setConfigName("fabric Server")
ideConfigGenerated(true)
runDir("runs/server")
}
data {
inherit client
setConfigName("fabric Data API")
setConfigName("fabric Data")
ideConfigGenerated(true)
runDir("build/datagen")

vmArg "-Dfabric-api.datagen"
vmArg "-Dfabric-api.datagen.output-dir=${project(":kuma-api:common").file("src/generated/resources")}"
vmArg "-Dfabric-api.datagen.output-dir=${project(":common").file("src/generated/resources")}"
vmArg "-Dfabric-api.datagen.modid=${mod_id}"
}
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 48c43e1

Please sign in to comment.