Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcmd committed Sep 5, 2024
0 parents commit 77b23a1
Show file tree
Hide file tree
Showing 12 changed files with 541 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build with Gradle

on:
push:
branches: [ "master" ]
paths:
- .github/workflows/build.yml
- src/**
pull_request:
paths:
- .github/workflows/build.yml
- src/**

jobs:
build:
runs-on: ubuntu-latest
steps:
# Support for ipv6
- name: Set up WARP
uses: fscarmen/warp-on-actions@v1.1
if: contains(github.ref_name, 'master')
with:
stack: dual
- uses: actions/checkout@v4
- run: chmod +x gradlew
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'zulu'
- name: Setup gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: wrapper
cache-overwrite-existing: true
cache-read-only: false
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
- name: Build
run: ./gradlew build
- name: Upload Artifact
uses: actions/upload-artifact@v4
if: success() && contains(github.ref_name, 'master')
with:
path: build/libs/*.jar
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 AllayMC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Allay Java Plugin Template

Welcome to the java plugin template for allay.

## Prerequisites

- Java21 or higher.
- Allay installed.

## Getting Started

1. **Clone this Repository**

```bash
git clone https://github.com/AllayMC/JavaPluginTemplate.git
```

2. **Navigate to the Cloned Directory**

```bash
cd JavaPluginTemplate
```

3. **Change Plugin Information**

- Rename package name from `org.allaymc.javaplugintemplate` to `your.group.name.and.pluginname`
- Edit [build.gradle.kts](build.gradle.kts) and [settings.gradle.kts](settings.gradle.kts)
- Edit [plugin.json](src/main/resources/plugin.json)
- Reload gradle

4. **Build and Run Your Plugin**

```bash
gradlew shadowJar
```

This command will produce a `.jar` file in the `build/libs` directory.
Copy the `.jar` file to the `plugins` directory of your allay server.
Start the allay server and check the logs to ensure your plugin loads and operates
as expected.

## Documentation

For a deeper dive into the Allay API and its functionalities, please refer to our [documentation](https://docs.allaymc.org) (WIP).

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
29 changes: 29 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
plugins {
id("java-library")
id("com.github.johnrengelman.shadow") version "8.1.1"
}

group = "org.allaymc.myplugin"
description = "My plugin"
version = "1.0.0"

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

repositories {
mavenCentral()
maven("https://www.jitpack.io/")
maven("https://repo.opencollab.dev/maven-releases/")
maven("https://repo.opencollab.dev/maven-snapshots/")
maven("https://storehouse.okaeri.eu/repository/maven-public/")
}

dependencies {
compileOnly(group = "com.github.AllayMC.Allay", name = "Allay-API", version = "master-SNAPSHOT")
compileOnly(group = "org.projectlombok", name = "lombok", version = "1.18.34")

annotationProcessor(group = "org.projectlombok", name = "lombok", version = "1.18.34")
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Sun Sep 01 22:03:52 CST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 77b23a1

Please sign in to comment.