Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add Kotlin DSL support for delegations
  • Loading branch information
DerEchtePilz committed Aug 17, 2023
commit bf86f2bf72420a2329188d2b9722bc9e3ac93e7c
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package dev.jorel.commandapi.examples.kotlin

import de.tr7zw.changeme.nbtapi.NBTContainer
import dev.jorel.commandapi.*
import dev.jorel.commandapi.arguments.*
import dev.jorel.commandapi.arguments.LiteralArgument.of
import dev.jorel.commandapi.executors.*
import dev.jorel.commandapi.kotlindsl.*
import dev.jorel.commandapi.wrappers.*
import dev.jorel.commandapi.wrappers.Rotation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<parent>
<groupId>dev.jorel</groupId>
<artifactId>commandapi-bukkit</artifactId>
<artifactId>commandapi-kotlin</artifactId>
<version>9.2.0-SNAPSHOT</version>
</parent>

Expand Down Expand Up @@ -89,5 +89,10 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>dev.jorel</groupId>
<artifactId>commandapi-core-kotlin</artifactId>
<version>9.2.0-SNAPSHOT</version>
Comment thread
DerEchtePilz marked this conversation as resolved.
Outdated
</dependency>
</dependencies>
</project>
75 changes: 75 additions & 0 deletions commandapi-kotlin/commandapi-core-kotlin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>dev.jorel</groupId>
<artifactId>commandapi-kotlin</artifactId>
<version>9.2.0-SNAPSHOT</version>
</parent>

<artifactId>commandapi-core-kotlin</artifactId>

<build>
<sourceDirectory>src/main/kotlin</sourceDirectory>
<plugins>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<jvmTarget>16</jvmTarget>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>empty-javadoc-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>javadoc</classifier>
<classesDirectory>${basedir}/javadoc</classesDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>dev.jorel</groupId>
<artifactId>commandapi-core</artifactId>
<version>9.2.0-SNAPSHOT</version>
Comment thread
DerEchtePilz marked this conversation as resolved.
Outdated
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package dev.jorel.commandapi.kotlindsl

import dev.jorel.commandapi.executors.CommandArguments
import kotlin.reflect.KProperty

// CommandArguments DSL
inline operator fun <reified T> CommandArguments.getValue(nothing: Nothing?, property: KProperty<*>) = this[property.name] as T
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@

<parent>
<groupId>dev.jorel</groupId>
<artifactId>commandapi-velocity</artifactId>
<artifactId>commandapi-kotlin</artifactId>
<version>9.2.0-SNAPSHOT</version>
</parent>

<artifactId>commandapi-velocity-kotlin</artifactId>
<packaging>jar</packaging>

<build>
<sourceDirectory>src/main/kotlin</sourceDirectory>
Expand Down Expand Up @@ -59,13 +58,18 @@
<scope>provided</scope>
</dependency>

<!--- CommandAPI velocity core dependency -->
<!--- CommandAPI dependencies -->
<dependency>
<groupId>dev.jorel</groupId>
<artifactId>commandapi-velocity-core</artifactId>
<version>9.2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>dev.jorel</groupId>
<artifactId>commandapi-core-kotlin</artifactId>
<version>9.2.0-SNAPSHOT</version>
Comment thread
DerEchtePilz marked this conversation as resolved.
Outdated
</dependency>

<!--- Kotlin dependencies -->
<dependency>
Expand All @@ -74,11 +78,5 @@
<version>${kotlin.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
15 changes: 15 additions & 0 deletions commandapi-kotlin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>dev.jorel</groupId>
<artifactId>commandapi</artifactId>
<version>9.2.0-SNAPSHOT</version>
</parent>

<artifactId>commandapi-kotlin</artifactId>
<packaging>pom</packaging>

</project>

This file was deleted.

1 change: 0 additions & 1 deletion commandapi-platforms/commandapi-bukkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@
<module>commandapi-bukkit-plugin</module>
<module>commandapi-bukkit-test</module>
<module>commandapi-bukkit-shade</module>
<module>commandapi-bukkit-kotlin</module>
</modules>
</project>
Loading