mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
65 lines
1.7 KiB
Groovy
65 lines
1.7 KiB
Groovy
description = 'Apollo Game'
|
|
|
|
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
|
}
|
|
}
|
|
|
|
apply plugin: 'kotlin'
|
|
|
|
ext.pluginsDir = "$projectDir/src/plugins"
|
|
|
|
sourceSets {
|
|
plugins {
|
|
kotlin {
|
|
srcDir "$pluginsDir"
|
|
exclude 'stub.kt'
|
|
exclude '**/*.kts'
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compile project(':cache')
|
|
compile project(':net')
|
|
compile project(':util')
|
|
|
|
pluginsCompile(configurations.compile)
|
|
pluginsCompile(sourceSets.main.output)
|
|
|
|
compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jre8', version: "$kotlinVersion"
|
|
compile group: 'org.jetbrains.kotlin', name: 'kotlin-compiler', version: "$kotlinVersion"
|
|
|
|
runtime files("$buildDir/plugins")
|
|
runtime sourceSets.plugins.output
|
|
}
|
|
|
|
|
|
task compilePluginScripts(type: JavaExec, dependsOn: [classes, pluginsClasses]) {
|
|
group = LifecycleBasePlugin.BUILD_GROUP
|
|
description = 'Compile plugin script files (.plugin.kts) to java bytecode'
|
|
|
|
def compilerClasspath = [
|
|
configurations.compile.asPath,
|
|
configurations.runtime.asPath,
|
|
sourceSets.main.compileClasspath.asPath,
|
|
sourceSets.main.runtimeClasspath.asPath
|
|
]
|
|
|
|
def outputDir = "$buildDir/plugins"
|
|
def manifestPath = "$buildDir/plugins/manifest.txt"
|
|
|
|
inputs.source "$pluginsDir"
|
|
outputs.dir outputDir
|
|
|
|
classpath = sourceSets.main.compileClasspath + sourceSets.main.runtimeClasspath
|
|
main = 'org.apollo.game.plugin.kotlin.KotlinPluginCompiler'
|
|
args = ["$pluginsDir", outputDir, manifestPath, compilerClasspath.join(':')]
|
|
}
|
|
|
|
assemble.dependsOn compilePluginScripts |