-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add examples for both java and kotlin
- Loading branch information
Showing
8 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
plugins { | ||
id("java") | ||
} | ||
|
||
group = "com.example" | ||
version = "0.0.0" | ||
|
||
repositories { | ||
mavenCentral() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
plugins { | ||
id 'io.freefair.lombok' version '8.11' | ||
id 'com.gradleup.shadow' version '8.3.2' | ||
id 'io.github.revxrsal.zapper' version '1.0.0' | ||
} | ||
|
||
group = 'com.example' | ||
version = '0.0.0' | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' } | ||
maven { url = 'https://oss.sonatype.org/content/repositories/central' } | ||
maven { url = 'https://hub.spigotmc.org/nexus/content/groups/public/' } | ||
} | ||
|
||
dependencies { | ||
zap 'com.zaxxer:HikariCP:6.2.1' | ||
compileOnly 'org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT' | ||
} | ||
|
||
zapper { | ||
libsFolder = 'libs' | ||
relocationPrefix = 'com.example.plugin.libs' | ||
|
||
repositories { includeProjectRepositories() } | ||
|
||
// relocation path is com.example.plugin.libs.hikaricp | ||
relocate 'com.zaxxer.hikari', 'hikaricp' | ||
} |
16 changes: 16 additions & 0 deletions
16
examples/bukkit-java/src/main/java/com/example/ExamplePlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.example; | ||
|
||
import com.zaxxer.hikari.HikariConfig; | ||
import revxrsal.zapper.ZapperJavaPlugin; | ||
|
||
public class ExamplePlugin extends ZapperJavaPlugin { | ||
|
||
@Override | ||
public void onEnable() { | ||
System.out.println(HikariConfig.class); | ||
} | ||
|
||
@Override | ||
public void onDisable() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name: ExamplePlugin | ||
main: com.example.ExamplePlugin | ||
version: 0.0.0 | ||
author: Example Author |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
plugins { | ||
id("io.freefair.lombok") version "8.11" | ||
id("com.gradleup.shadow") version "8.3.2" | ||
id("io.github.revxrsal.zapper") version "1.0.0" | ||
kotlin("jvm") | ||
} | ||
|
||
group = "com.example" | ||
version = "0.0.0" | ||
|
||
repositories { | ||
mavenCentral() | ||
maven(url = "https://oss.sonatype.org/content/repositories/snapshots") | ||
maven(url = "https://oss.sonatype.org/content/repositories/central") | ||
maven(url = "https://hub.spigotmc.org/nexus/content/groups/public/") | ||
} | ||
|
||
dependencies { | ||
zap(kotlin("stdlib-jdk8")) | ||
compileOnly("org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT") | ||
} | ||
|
||
zapper { | ||
libsFolder = "libs" | ||
relocationPrefix = "com.example.plugin.libs" | ||
|
||
repositories { includeProjectRepositories() } | ||
|
||
// relocation path is com.example.plugin.libs.kotlin | ||
relocate("kotlin", "kotlin") | ||
} | ||
|
||
kotlin { | ||
jvmToolchain(8) | ||
} |
19 changes: 19 additions & 0 deletions
19
examples/bukkit-kotlin/src/main/java/com/example/ExamplePlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.example | ||
|
||
import revxrsal.zapper.ZapperJavaPlugin | ||
|
||
class ExamplePlugin : ZapperJavaPlugin() { | ||
|
||
companion object { | ||
init { | ||
println("Kotlin is already loaded!") | ||
} | ||
} | ||
|
||
override fun onEnable() { | ||
println("Hello from Kotlin!") | ||
} | ||
|
||
override fun onDisable() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name: ExamplePlugin | ||
main: com.example.ExamplePlugin | ||
version: 0.0.0 | ||
author: Example Author |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters