Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
harry-xi committed Sep 5, 2024
0 parents commit afd0b02
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# macOS
.DS_Store

# sbt specific
dist/*
target/
lib_managed/
src_managed/
project/boot/
project/plugins/project/
project/local-plugins.sbt
.history
.ensime
.ensime_cache/
.sbt-scripted/
local.sbt

# Bloop
.bsp

# VS Code
.vscode/

# Metals
.bloop/
.metals/
metals.sbt

# IDEA
.idea
.idea_modules
/.worksheet/
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Allay Scala Plugin Template

## Usage

To compile the project

```bash
sbt compile
```

To package the score with scala library (using sbt-assembly)

``` bash
sbt assembly
```
31 changes: 31 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
val scala3Version = "3.5.0"

val Compilonly = config("Compilonly") hide

lazy val root = project
.in(file("."))
.settings(

resolvers +=
"opencollab-repository-maven-snapshots"
at "https://repo.opencollab.dev/maven-snapshots",
resolvers +=
"opencollab-repository-maven-releases"
at "https://repo.opencollab.dev/maven-releases",
resolvers +=
"storehouse" at "https://storehouse.okaeri.eu/repository/maven-public/",
resolvers +=
"jitpack" at "https://www.jitpack.io/",

ivyConfigurations += Compilonly,

name := "Scala-Plugin-For-Allay",
version := "0.1.0-SNAPSHOT",
scalaVersion := scala3Version,

libraryDependencies += "com.github.AllayMC.Allay" % "Allay-API" % "master-SNAPSHOT" % Compilonly,
libraryDependencies += "org.slf4j" % "slf4j-api" % "1.7.32" % Compilonly,

unmanagedClasspath in Compile ++=
update.value.select(configurationFilter("Compilonly"))
)
1 change: 1 addition & 0 deletions project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.10.1
1 change: 1 addition & 0 deletions project/plugin.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.2.0")
8 changes: 8 additions & 0 deletions src/main/resources/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

{
"entrance": "MyPlugin",
"name": "ScalaPluginTemplate",
"authors": ["harryxi"],
"version": "1.0.0"
}

12 changes: 12 additions & 0 deletions src/main/scala/Main.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import org.allaymc.api.plugin.Plugin
import org.slf4j.LoggerFactory

class MyPlugin extends Plugin {
val log = LoggerFactory.getLogger(getClass)
override def onLoad(): Unit =
log.info("onLoad")
override def onEnable(): Unit =
log.info("onEnable")
override def onDisable(): Unit =
log.info("onDisable")
}

0 comments on commit afd0b02

Please sign in to comment.