Skip to content

Commit 5d53b6c

Browse files
committed
1.2 - Rework
0 parents  commit 5d53b6c

24 files changed

+2520
-0
lines changed

.claude/settings.local.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(dir:*)"
5+
]
6+
}
7+
}

.github/FUNDING.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# These are supported funding model platforms
2+
3+
github: [CroaBeast]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12+
polar: # Replace with a single Polar username
13+
buy_me_a_coffee: croabeast
14+
thanks_dev: # Replace with a single thanks.dev username
15+
custom: https://www.paypal.com/donate/?hosted_button_id=FQQR9FEHPLNQL

.github/workflows/publish.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
name: Package & Release Plugin
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
release:
9+
types: [ created ]
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up JDK 8
20+
uses: actions/setup-java@v3
21+
with:
22+
distribution: 'temurin'
23+
java-version: '8'
24+
25+
- name: Setup Gradle
26+
uses: gradle/actions/setup-gradle@v3
27+
28+
- name: Grant execute permission for Gradle wrapper
29+
run: chmod +x gradlew
30+
31+
- name: Build with Gradle
32+
run: ./gradlew build
33+
34+
- name: Extract project info
35+
run: |
36+
PROJECT_NAME=$(./gradlew properties -q | grep "^name:" | awk '{print $2}')
37+
VERSION=$(./gradlew properties -q | grep "^version:" | awk '{print $2}')
38+
echo "PROJECT_NAME=$PROJECT_NAME" >> $GITHUB_ENV
39+
echo "VERSION=$VERSION" >> $GITHUB_ENV
40+
41+
- name: Upload plugin artifact
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: Plugin
45+
path: build/libs/${{ env.PROJECT_NAME }}-*.jar
46+
47+
- name: Delete existing GitHub release (if exists)
48+
run: |
49+
RELEASE_ID=$(gh release view ${{ env.VERSION }} --json id -q '.id' || echo "")
50+
if [ -n "$RELEASE_ID" ]; then
51+
echo "Deleting existing release..."
52+
gh release delete ${{ env.VERSION }} --yes
53+
fi
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
57+
- name: Delete existing tag (if exists)
58+
run: |
59+
if git rev-parse "${{ env.VERSION }}" >/dev/null 2>&1; then
60+
echo "Deleting existing tag..."
61+
git tag -d ${{ env.VERSION }}
62+
git push origin :refs/tags/${{ env.VERSION }}
63+
fi
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
67+
- name: Prepare release JAR
68+
run: |
69+
JAR_FILE=$(ls build/libs/${{ env.PROJECT_NAME }}-*.jar | grep -vE '(-sources|-javadoc|-all).jar' | head -n 1)
70+
cp "$JAR_FILE" build/libs/${{ env.PROJECT_NAME }}-latest.jar
71+
72+
- name: Create GitHub Release
73+
uses: softprops/action-gh-release@v1
74+
with:
75+
tag_name: ${{ env.VERSION }}
76+
name: Release ${{ env.VERSION }}
77+
draft: false
78+
prerelease: false
79+
files: |
80+
build/libs/${{ env.PROJECT_NAME }}-latest.jar
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
84+
- name: Checkout Maven repository
85+
uses: actions/checkout@v4
86+
with:
87+
repository: CroaBeast/repo
88+
path: maven-repo
89+
token: ${{ secrets.MAVEN_DEPLOY_TOKEN }}
90+
91+
- name: Configure Git
92+
run: |
93+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
94+
git config --global user.name "github-actions[bot]"
95+
96+
- name: Deploy to Maven repository
97+
run: |
98+
NAME=${{ env.PROJECT_NAME }}
99+
100+
# Create directory structure
101+
mkdir -p maven-repo/me/croabeast/${NAME}/${{ env.VERSION }}
102+
103+
# Copy JAR files
104+
cp build/libs/${NAME}-${{ env.VERSION }}.jar \
105+
maven-repo/me/croabeast/${NAME}/${{ env.VERSION }}/
106+
cp build/libs/${NAME}-${{ env.VERSION }}-javadoc.jar \
107+
maven-repo/me/croabeast/${NAME}/${{ env.VERSION }}/
108+
cp build/libs/${NAME}-${{ env.VERSION }}-sources.jar \
109+
maven-repo/me/croabeast/${NAME}/${{ env.VERSION }}/
110+
111+
# Create POM file
112+
cat > maven-repo/me/croabeast/${NAME}/${{ env.VERSION }}/${NAME}-${{ env.VERSION }}.pom << EOF
113+
<?xml version="1.0" encoding="UTF-8"?>
114+
<project>
115+
<modelVersion>4.0.0</modelVersion>
116+
<groupId>me.croabeast</groupId>
117+
<artifactId>${NAME}</artifactId>
118+
<version>${{ env.VERSION }}</version>
119+
<packaging>jar</packaging>
120+
</project>
121+
EOF
122+
123+
# Update or create maven-metadata.xml
124+
cat > maven-repo/me/croabeast/${NAME}/maven-metadata.xml << EOF
125+
<?xml version="1.0" encoding="UTF-8"?>
126+
<metadata>
127+
<groupId>me.croabeast</groupId>
128+
<artifactId>${NAME}</artifactId>
129+
<versioning>
130+
<latest>${{ env.VERSION }}</latest>
131+
<release>${{ env.VERSION }}</release>
132+
<versions>
133+
<version>${{ env.VERSION }}</version>
134+
</versions>
135+
<lastUpdated>$(date +%Y%m%d%H%M%S)</lastUpdated>
136+
</versioning>
137+
</metadata>
138+
EOF
139+
140+
# Commit and push changes
141+
cd maven-repo
142+
git add .
143+
git commit -m "Deploy ${NAME} ${{ env.VERSION }}"
144+
git push
145+
146+
env:
147+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
### Java template
2+
# Compiled class file
3+
*.class
4+
5+
# Log file
6+
*.log
7+
8+
# BlueJ files
9+
*.ctxt
10+
11+
# Mobile Tools for Java (J2ME)
12+
.mtj.tmp/
13+
14+
# Package Files #
15+
*.jar
16+
*.war
17+
*.nar
18+
*.ear
19+
*.zip
20+
*.tar.gz
21+
*.rar
22+
23+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
24+
hs_err_pid*
25+
replay_pid*
26+
27+
### Example user template template
28+
### Example user template
29+
30+
# IntelliJ project files
31+
.idea
32+
*.iml
33+
out
34+
gen
35+
### Gradle template
36+
.gradle
37+
**/build/
38+
!src/**/build/
39+
40+
# Ignore Gradle GUI config
41+
gradle-app.setting
42+
43+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
44+
!gradle-wrapper.jar
45+
46+
# Avoid ignore Gradle wrappper properties
47+
!gradle-wrapper.properties
48+
49+
# Cache of project
50+
.gradletasknamecache
51+
52+
# Eclipse Gradle plugin generated files
53+
# Eclipse Core
54+
.project
55+
# JDT-specific (Eclipse Java Development Tools)
56+
.classpath
57+

build.gradle.kts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
plugins {
2+
kotlin("jvm") version "2.3.20-Beta1"
3+
id("java-library")
4+
id("io.freefair.lombok") version "8.10"
5+
id("com.gradleup.shadow") version "8.3.0"
6+
}
7+
8+
group = "me.croabeast"
9+
version = "1.2"
10+
11+
repositories {
12+
mavenCentral()
13+
mavenLocal()
14+
15+
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
16+
maven("https://oss.sonatype.org/content/repositories/snapshots/")
17+
}
18+
19+
tasks.withType<Javadoc>().configureEach {
20+
isFailOnError = false
21+
22+
(options as StandardJavadocDocletOptions).apply {
23+
addStringOption("Xdoclint:none", "-quiet")
24+
encoding = "UTF-8"
25+
charSet = "UTF-8"
26+
docEncoding = "UTF-8"
27+
28+
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_1_9))
29+
addBooleanOption("html5", true)
30+
}
31+
}
32+
33+
tasks.withType<JavaCompile>().configureEach {
34+
options.encoding = "UTF-8"
35+
sourceCompatibility = "1.8"
36+
targetCompatibility = "1.8"
37+
options.compilerArgs.add("-Xlint:-options")
38+
}
39+
40+
java {
41+
withSourcesJar()
42+
withJavadocJar()
43+
}
44+
45+
dependencies {
46+
compileOnly("org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT")
47+
48+
compileOnly("org.jetbrains:annotations:26.0.2-1")
49+
annotationProcessor("org.jetbrains:annotations:26.0.2-1")
50+
51+
compileOnly("org.projectlombok:lombok:1.18.42")
52+
annotationProcessor("org.projectlombok:lombok:1.18.42")
53+
}

gradle.properties

Whitespace-only changes.

gradle/wrapper/gradle-wrapper.jar

42.4 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)