Skip to content

Instantly share code, notes, and snippets.

@pie-flavor
Last active July 21, 2017 03:47
Show Gist options
  • Save pie-flavor/46cd85897e53b693e3269c63d9656ec4 to your computer and use it in GitHub Desktop.
Save pie-flavor/46cd85897e53b693e3269c63d9656ec4 to your computer and use it in GitHub Desktop.

Spotlin

A Sponge plugin providing the Kotlin runtime, standard library, and reflection library to other plugins.

License

Licensed under the MIT License.

Depending on Spotlin - Build System

Gradle

First, ensure you have the Kotlin Gradle plugin enabled.

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.3'
    }
}
apply plugin: 'kotlin'

or

plugins {
    id "org.jetbrains.kotlin.jvm" version "1.1.3"
}

Next, add the JitPack repository:

repositories {
    maven {
        url 'https://jitpack.io/'
    }
}

Last, add a dependency on Spotlin:

dependencies {
    compile 'com.github.pxlpowered:Spotlin:0.1.0'
}

Maven

First, ensure you have the Kotlin Maven plugin enabled:

<build>
    <plugins>
        <plugin>
            <artifactId>kotlin-maven-plugin</artifactId>
            <groupId>org.jetbrains.kotlin</groupId>
            <version>${kotlin.version}</version>

            <executions>
                <execution>
                    <id>compile</id>
                    <goals> <goal>compile</goal> </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Second, add the JitPack repository:

<repositories>
    <repository>
	    <id>jitpack.io</id>
	    <url>https://jitpack.io</url>
    </repository>
</repositories>

Last, add a dependency on Spotlin:

<dependencies>
    <dependency>
        <groupId>com.github.pxlpowered</groupId>
        <artifactId>Spotlin</artifactId>
        <version>0.1.0</version>
    </dependency>
</dependencies>

Depending on Spotlin - Plugin Manifest

In order to make sure your plugin both requires and loads after Spotlin, add this to your @Plugin annotation:

@[Plugin(dependencies = arrayOf(Dependency(id = "spotlin", 
                                           optional = false, 
                                           version = "0.1.0")))]

If you do not have the kapt plugin enabled, you will also need to add this to your mcmod.info file:

{
    "requiredMods": [
        "spotlin@0.1.0"
    ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment