Skip to content

Commit

Permalink
Gradle: Added library conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
xDec0de committed Jul 14, 2024
1 parent e41f9e6 commit 3dff7a2
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 12 deletions.
5 changes: 5 additions & 0 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

plugins {
mcutils.`library-conventions`
}

dependencies {
implementation(libs.jetbrains.annotations)
}
9 changes: 9 additions & 0 deletions api/src/main/java/MCPlatform.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import org.jetbrains.annotations.NotNull;

public interface MCPlatform {

/**
* Gets the name of this {@link MCPlatform}
*
* @return the name of this {@link MCPlatform}
*
* @since MCUtils 1.0.0
*/
@NotNull
String getName();
}
8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

plugins {
mcutils.`library-conventions`
}

dependencies {
implementation(libs.jetbrains.annotations)
}
7 changes: 0 additions & 7 deletions buildSrc/settings.gradle.kts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ repositories {
mavenCentral()
}

dependencies {
implementation(libs.jetbrains-annotations)
}

java {
withSourcesJar()
withJavadocJar()
Expand Down
4 changes: 3 additions & 1 deletion platforms/spigot/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

plugins {
mcutils.`library-conventions`
}
Expand All @@ -7,6 +8,7 @@ repositories {
}

dependencies {
compileOnly("org.spigotmc:spigot-api:1.20-R0.1-SNAPSHOT")
api(project(":api"))
compileOnly(libs.spigot)
implementation(libs.jetbrains.annotations)
}
10 changes: 10 additions & 0 deletions platforms/spigot/src/main/java/SpigotPlatform.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import org.jetbrains.annotations.NotNull;

public class SpigotPlatform implements MCPlatform {

@NotNull
@Override
public String getName() {
return "Spigot";
}
}
8 changes: 8 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@ rootProject.name = "MCUtils"

include("api")
include("platforms:spigot")

dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("libs.versions.toml"))
}
}
}

0 comments on commit 3dff7a2

Please sign in to comment.