build: 更改项目结构

This commit is contained in:
2023-06-16 19:29:00 +08:00
parent 57357c6ae2
commit 20517e7207
61 changed files with 19 additions and 38 deletions

View File

@@ -16,9 +16,9 @@ repositories {
dependencies {
// 对于 Bukkit 插件
compileOnly "cn.hamster3.mc.plugin:hamster-core-bukkit:1.0.0"
compileOnly "cn.hamster3.mc.plugin:core-bukkit:1.0.0"
// 对于 BungeeCord 插件
compileOnly "cn.hamster3.mc.plugin:hamster-core-bungeecord:1.0.0"
compileOnly "cn.hamster3.mc.plugin:core-bungeecord:1.0.0"
}
```
@@ -40,13 +40,13 @@ dependencies {
<!--对于 Bukkit 插件-->
<dependency>
<groupId>cn.hamster3.mc.plugin</groupId>
<artifactId>hamster-core-bukkit</artifactId>
<artifactId>core-bukkit</artifactId>
<version>1.0.0</version>
</dependency>
<!--对于 BungeeCord 插件-->
<dependency>
<groupId>cn.hamster3.mc.plugin</groupId>
<artifactId>hamster-core-bungeecord</artifactId>
<artifactId>core-bungeecord</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>

View File

@@ -2,7 +2,7 @@ plugins {
id 'java'
}
group 'cn.hamster3.mc.plugin.core'
group 'cn.hamster3.mc.plugin'
version '1.0.0-SNAPSHOT'
subprojects {

View File

@@ -6,7 +6,7 @@ plugins {
}
setArchivesBaseName("HamsterCore-Bukkit")
evaluationDependsOn(':hamster-core-common')
evaluationDependsOn(':core-common')
dependencies {
//noinspection VulnerableLibrariesLocal
@@ -15,15 +15,15 @@ dependencies {
compileOnly 'net.milkbowl.vault:VaultAPI:1.7' transitive false
compileOnly 'org.black_ixx:playerpoints:2.1.3' transitive false
implementation project(":hamster-core-common") transitive false
implementation project(":core-common") transitive false
//noinspection GradlePackageUpdate
implementation "com.zaxxer:HikariCP:${HikariCP_version}"
//noinspection VulnerableLibrariesLocal
implementation "net.kyori:adventure-platform-bukkit:${adventure_version}" exclude group: 'org.jetbrains'
implementation "net.kyori:adventure-platform-bukkit:${adventure_version}" exclude group: 'org.jetbrains' exclude group: 'com.google.code.gson'
// https://mvnrepository.com/artifact/net.kyori/adventure-text-minimessage
implementation "net.kyori:adventure-text-minimessage:${adventure_serializer_version}" exclude group: 'org.jetbrains'
// https://mvnrepository.com/artifact/net.kyori/adventure-text-serializer-gson
implementation "net.kyori:adventure-text-serializer-gson:${adventure_serializer_version}" exclude group: 'org.jetbrains'
implementation "net.kyori:adventure-text-serializer-gson:${adventure_serializer_version}" exclude group: 'org.jetbrains' exclude group: 'com.google.code.gson'
// https://mvnrepository.com/artifact/net.kyori/adventure-text-serializer-legacy
implementation "net.kyori:adventure-text-serializer-legacy:${adventure_serializer_version}" exclude group: 'org.jetbrains'
implementation "de.tr7zw:item-nbt-api:2.11.2"
@@ -40,12 +40,12 @@ jar {
classifier = 'dev'
}
tasks.compileJava.dependsOn(":hamster-core-common:build")
tasks.compileJava.dependsOn(":core-common:build")
shadowJar {
classifier = ''
dependencies {
exclude(dependency {
it.moduleGroup == 'com.google.code.gson' || it.moduleName == 'org.jetbrains'
it.moduleGroup == 'com.google.code.gson'
})
}
relocate 'org.slf4j', 'cn.hamster3.mc.plugin.core.lib.slf4j'
@@ -61,8 +61,6 @@ publishing {
publications {
shadow(MavenPublication) { publication ->
{
def projectNameSplit = project.name.split('-')
artifactId = projectNameSplit[projectNameSplit.length - 1]
from components.java
}
}

View File

@@ -6,21 +6,21 @@ plugins {
}
setArchivesBaseName("HamsterCore-BungeeCord")
evaluationDependsOn(':hamster-core-common')
evaluationDependsOn(':core-common')
dependencies {
//noinspection VulnerableLibrariesLocal
compileOnly 'net.md-5:bungeecord-api:1.19-R0.1-SNAPSHOT'
implementation project(":hamster-core-common") transitive false
implementation project(":core-common") transitive false
//noinspection GradlePackageUpdate
implementation "com.zaxxer:HikariCP:${HikariCP_version}"
// https://mvnrepository.com/artifact/net.kyori/adventure-platform-bungeecord
implementation "net.kyori:adventure-platform-bungeecord:${adventure_version}" exclude group: 'org.jetbrains'
implementation "net.kyori:adventure-platform-bungeecord:${adventure_version}" exclude group: 'org.jetbrains' exclude group: 'com.google.code.gson'
// https://mvnrepository.com/artifact/net.kyori/adventure-text-minimessage
implementation "net.kyori:adventure-text-minimessage:${adventure_serializer_version}" exclude group: 'org.jetbrains'
// https://mvnrepository.com/artifact/net.kyori/adventure-text-serializer-gson
implementation "net.kyori:adventure-text-serializer-gson:${adventure_serializer_version}" exclude group: 'org.jetbrains'
implementation "net.kyori:adventure-text-serializer-gson:${adventure_serializer_version}" exclude group: 'org.jetbrains' exclude group: 'com.google.code.gson'
// https://mvnrepository.com/artifact/net.kyori/adventure-text-serializer-legacy
implementation "net.kyori:adventure-text-serializer-legacy:${adventure_serializer_version}" exclude group: 'org.jetbrains'
}
@@ -36,14 +36,9 @@ jar {
classifier = 'dev'
}
tasks.compileJava.dependsOn(":hamster-core-common:build")
tasks.compileJava.dependsOn(":core-common:build")
shadowJar {
classifier = ''
dependencies {
exclude(dependency {
it.moduleGroup == 'com.google.code.gson' || it.moduleName == 'org.jetbrains'
})
}
relocate 'org.slf4j', 'cn.hamster3.mc.plugin.core.lib.slf4j'
relocate 'net.kyori', 'cn.hamster3.mc.plugin.core.lib.kyori'
relocate 'com.zaxxer.hikari', 'cn.hamster3.mc.plugin.core.lib.hikari'
@@ -55,8 +50,6 @@ publishing {
publications {
shadow(MavenPublication) { publication ->
{
def projectNameSplit = project.name.split('-')
artifactId = projectNameSplit[projectNameSplit.length - 1]
from components.java
}
}

View File

@@ -29,8 +29,6 @@ test {
publishing {
publications {
mavenJava(MavenPublication) {
def projectNameSplit = project.name.split('-')
artifactId = projectNameSplit[projectNameSplit.length - 1]
from project.components.java
}
}

View File

@@ -25,12 +25,4 @@ public abstract class CoreAPI {
public Connection getConnection() throws SQLException {
return getDataSource().getConnection();
}
public void reportError(@NotNull String apiKey, @NotNull String projectID, @NotNull Throwable exception) {
// todo
}
public void reportFile(@NotNull String apiKey, @NotNull String projectID, @NotNull String filename, byte @NotNull [] bytes) {
// todo
}
}

View File

@@ -1,5 +1,5 @@
rootProject.name = 'hamster-core'
include 'hamster-core-common'
include 'hamster-core-bukkit'
include 'hamster-core-bungeecord'
include 'core-common'
include 'core-bukkit'
include 'core-bungeecord'