Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal development. #3

Merged
merged 57 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
3aad692
pre format.
portlek Jun 23, 2024
3b18937
format.
portlek Jun 23, 2024
52ea09c
format *.kts files.
portlek Jun 23, 2024
f83b62e
format *.kt files.
portlek Jun 23, 2024
0fd3223
move spotless.
portlek Jun 23, 2024
90f87b2
format *.toml files.
portlek Jun 23, 2024
943c0a7
Update spotless.kt
portlek Jun 23, 2024
66eb77b
format.
portlek Jun 23, 2024
78441ab
format *.json files.
portlek Jun 23, 2024
8acb939
Update libs.versions.toml
portlek Jun 23, 2024
8405830
include more things.
portlek Jun 23, 2024
abe6394
Update ResourceProducers.java
portlek Jun 23, 2024
f83663c
move things.
portlek Jun 23, 2024
147843f
Update Language.java
portlek Jun 23, 2024
056a3ff
default spaces.
portlek Jun 23, 2024
aa2ea4d
fix.
portlek Jun 23, 2024
4fc1bb7
desc.
portlek Jun 23, 2024
59a5668
Update ResourceProducers.java
portlek Jun 23, 2024
7a1743a
Update ResourceProducers.java
portlek Jun 23, 2024
6528a2c
move things.
portlek Jun 23, 2024
ed81e09
doc.
portlek Jun 23, 2024
7d8b965
lazy load.
portlek Jun 23, 2024
375a08b
Update ArbitraryCharacterFactoryReserved.java
portlek Jun 23, 2024
c443479
start working on pack generator.
portlek Jun 24, 2024
d5cef5b
pack writer.
portlek Jun 24, 2024
7b40af2
fix.
portlek Jun 24, 2024
708da26
simplify.
portlek Jun 24, 2024
edfb382
fix.
portlek Jun 24, 2024
b333868
fix.
portlek Jun 24, 2024
75bb35e
simplify.
portlek Jun 24, 2024
10d99ed
start part parser.
portlek Jun 24, 2024
403206c
rename.
portlek Jun 24, 2024
3c44f85
fix.
portlek Jun 24, 2024
2272692
Update PackReferencePart.java
portlek Jun 24, 2024
dd94ed8
add images first.
portlek Jun 24, 2024
d7dbe0c
subtypes.
portlek Jun 24, 2024
392a79d
use parent folder names.
portlek Jun 24, 2024
96ebdff
default namespace.
portlek Jun 25, 2024
d362d99
format.
portlek Jun 25, 2024
c8accbf
Update PackReferencePartImage.java
portlek Jun 25, 2024
0670242
Update PackReferencePartImage.java
portlek Jun 25, 2024
8eda643
split.
portlek Jun 25, 2024
681986d
Update PackReferencePartImage.java
portlek Jun 25, 2024
b176bfe
move.
portlek Jul 1, 2024
b9a2ffc
change the space icon.
portlek Jul 3, 2024
97bdd51
simplify dependencies.
portlek Jul 7, 2024
8903cf9
Refactor code to merge duplicate resources in a pack
portlek Jul 12, 2024
2e779d1
Add unmerged resources to 'remainings'
portlek Jul 12, 2024
974575f
Add sorting for ItemOverride in FileResourceMerger
portlek Jul 12, 2024
a59a820
Move output directory/file from PackGeneratorContext to PackWriterSet…
portlek Jul 12, 2024
d7e923d
fix.
portlek Jul 16, 2024
8de9239
simplify.
portlek Jul 16, 2024
986940d
simplify.
portlek Jul 16, 2024
153aca5
use list instead of set.
portlek Jul 16, 2024
071e16d
use list instead of set.
portlek Jul 16, 2024
f0cfab0
move.
portlek Jul 29, 2024
1e8ca03
Merge branch 'master' into dev
portlek Jul 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 23 additions & 24 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
---
name-template: "$RESOLVED_VERSION"
tag-template: "$RESOLVED_VERSION"
prerelease: true
template: |
# What's Changed

$CHANGES
categories:
- title: Breaking
label: breaking
- title: New
label: enhancement
- title: Bug Fixes
label: bug
- title: Maintenance
label: maintenance
- title: Documentation
label: documentation
- title: Dependency Updates
label: dependencies

- title: "Breaking"
label: "breaking"
- title: "New"
label: "enhancement"
- title: "Bug Fixes"
label: "bug"
- title: "Maintenance"
label: "maintenance"
- title: "Documentation"
label: "documentation"
- title: "Dependency Updates"
label: "dependencies"
version-resolver:
major:
labels:
- breaking
- "breaking"
minor:
labels:
- enhancement
- "enhancement"
patch:
labels:
- bug
- maintenance
- documentation
- dependencies
- security

- "bug"
- "maintenance"
- "documentation"
- "dependencies"
- "security"
exclude-labels:
- skip-changelog
- "skip-changelog"
58 changes: 27 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
name: Build

on:
---
name: "Build"
"on":
pull_request:
branches: [ master ]

branches:
- "master"
jobs:
build:
name: Build
runs-on: ubuntu-latest
name: "Build"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'

- uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-

- uses: actions/cache@v4
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradlew-

- run: |
chmod +x gradlew
./gradlew build
- uses: "actions/checkout@v4"
- uses: "actions/setup-java@v4"
with:
distribution: "adopt"
java-version: "11"
- uses: "actions/cache@v4"
with:
path: "~/.gradle/caches"
key: "${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle.kts') }}"
restore-keys: |
${{ runner.os }}-gradle-
- uses: "actions/cache@v4"
with:
path: "~/.gradle/wrapper"
key: "${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }}"
restore-keys: |
${{ runner.os }}-gradlew-
- run: |
chmod +x gradlew
./gradlew build
24 changes: 12 additions & 12 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Update Changelog

on:
---
name: "Update Changelog"
"on":
push:
branches: [ master ]

branches:
- "master"
jobs:
changelog:
name: Update Changelog
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'skip-snapshot') }}
name: "Update Changelog"
runs-on: "ubuntu-latest"
if: "${{ !contains(github.event.head_commit.message, 'skip-snapshot') }}"
steps:
- uses: release-drafter/release-drafter@master
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: "release-drafter/release-drafter@master"
id: "release"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
57 changes: 27 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
name: Release
on:
---
name: "Release"
"on":
release:
types:
- released
- "released"
jobs:
build:
name: Release
runs-on: ubuntu-latest
name: "Release"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'

- uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-

- uses: actions/cache@v4
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradlew-

- run: |
[[ "${{ github.event.release.tag_name }}" =~ ^[0-9]+(\.[0-9]+)*$ ]] || exit -1
chmod +x gradlew
./gradlew -Psign-required=true publish -Pversion="${{ github.event.release.tag_name }}" -PmavenCentralUsername="${{ secrets.MAVEN_CENTRAL_USERNAME }}" -PmavenCentralPassword="${{ secrets.MAVEN_CENTRAL_PASSWORD }}" -PsigningInMemoryKey="${{ secrets.GPG_PRIVATE_KEY_ARMORED }}" -PsigningInMemoryKeyPassword="${{ secrets.GPG_PASSPHRASE }}"
- uses: "actions/checkout@v4"
- uses: "actions/setup-java@v4"
with:
distribution: "adopt"
java-version: "11"
- uses: "actions/cache@v4"
with:
path: "~/.gradle/caches"
key: "${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle.kts') }}"
restore-keys: |
${{ runner.os }}-gradle-
- uses: "actions/cache@v4"
with:
path: "~/.gradle/wrapper"
key: "${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }}"
restore-keys: |
${{ runner.os }}-gradlew-
- run: |
[[ "${{ github.event.release.tag_name }}" =~ ^[0-9]+(\.[0-9]+)*$ ]] || exit -1
chmod +x gradlew
./gradlew -Psign-required=true publish -Pversion="${{ github.event.release.tag_name }}" -PmavenCentralUsername="${{ secrets.MAVEN_CENTRAL_USERNAME }}" -PmavenCentralPassword="${{ secrets.MAVEN_CENTRAL_PASSWORD }}" -PsigningInMemoryKey="${{ secrets.GPG_PRIVATE_KEY_ARMORED }}" -PsigningInMemoryKeyPassword="${{ secrets.GPG_PASSPHRASE }}"
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,25 @@ repositories {
dependencies {
// Base module
implementation "net.infumia:pack:VERSION"
// Required, https://mvnrepository.com/artifact/net.kyori/adventure-api/
implementation "net.kyori:adventure-api:4.17.0"
// Required, https://mvnrepository.com/artifact/team.unnamed/creative-api/
implementation "team.unnamed:creative-api:1.7.2"

// Blank Slot (Optional)
implementation "net.infumia:pack-blank:VERSION"

// Language (Optional)
implementation "net.infumia:pack-language:VERSION"

// Generator (Optional)
implementation "net.infumia:pack-generator:VERSION"
// Required, https://mvnrepository.com/artifact/team.unnamed/team.unnamed:creative-serializer-minecraft/
implementation "team.unnamed:team.unnamed:creative-serializer-minecraft:1.7.2"
// Required, https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind/
implementation "com.fasterxml.jackson.core:jackson-databind:"
// Required, https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:"
}
```
### Code
Expand Down
9 changes: 9 additions & 0 deletions blank/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import net.infumia.gradle.publish

publish("blank")

dependencies {
compileOnly(project(":common"))

compileOnly(libs.creative.api)
}
63 changes: 63 additions & 0 deletions blank/src/main/java/net/infumia/pack/BlankSlot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package net.infumia.pack;

import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import team.unnamed.creative.base.Writable;

/**
* Utility class for creating and retrieving blank slot file resources.
*/
public final class BlankSlot {

/**
* Retrieves a pre-configured blank slot file resource.
*
* @return A {@link FileResource} representing the blank slot.
*/
public static FileResource get() {
return Internal0.BLANK_SLOT.get();
}

/**
* Creates a blank slot file resource with the specified parameters.
*
* @param namespace The namespace for the model. Cannot be null.
* @param itemId The id for the item. Cannot be null.
* @param baseKey The key for the base model. Cannot be null.
* @param blankSlotImage The writable image for the blank slot. Cannot be null.
* @param customModelData The custom model data value.
* @return A {@link FileResource} representing the created blank slot.
*/
public static FileResource create(
@KeyPattern.Namespace final String namespace,
@KeyPattern.Value final String itemId,
final Key baseKey,
final Writable blankSlotImage,
final int customModelData
) {
return ResourceProducers.item(
Key.key(namespace, itemId),
baseKey,
blankSlotImage,
customModelData
);
}

private BlankSlot() {
throw new IllegalStateException("Utility class");
}

private static final class Internal0 {

private static final Lazy<FileResource> BLANK_SLOT = Lazy.of(
() ->
BlankSlot.create(
Internal.DEFAULT_NAMESPACE,
"blank_slot",
Key.key("item/paper"),
Internal.resourceFromJar("blank_slot.png"),
1
)
);
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 4 additions & 70 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,73 +1,7 @@
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.MavenPublishPlugin
import com.vanniktech.maven.publish.SonatypeHost
import net.infumia.gradle.spotless

plugins {
java
alias(libs.plugins.nexus) apply false
}
plugins { java }

repositories.mavenCentral()
subprojects { apply<JavaPlugin>() }

subprojects {
apply<JavaPlugin>()
apply<MavenPublishPlugin>()

repositories.mavenCentral()

java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

tasks {
val javadocJar by creating(Jar::class) {
dependsOn("javadoc")
archiveClassifier.set("javadoc")
from(javadoc)
}

val sourcesJar by creating(Jar::class) {
dependsOn("classes")
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
}

val moduleName = project.findProperty("artifact-id") as String?
val projectName = "pack${if (moduleName == null) "" else "-$moduleName"}"
val signRequired = project.hasProperty("sign-required")

extensions.configure<MavenPublishBaseExtension> {
coordinates(project.group.toString(), projectName, project.version.toString())
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
if (signRequired) {
signAllPublications()
}

pom {
name.set(projectName)
description.set("Minecraft resource pack generator.")
url.set("https://github.com/Infumia/pack")
licenses {
license {
name.set("MIT License")
url.set("https://mit-license.org/license.txt")
}
}
developers {
developer {
id.set("portlek")
name.set("Hasan Demirtaş")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/infumia/pack.git")
developerConnection.set("scm:git:ssh://github.com/infumia/pack.git")
url.set("https://github.com/infumia/pack/")
}
}
}
}
spotless()
Loading