Improve Gradle build scripts
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
subprojects {
|
||||
apply plugin: 'kotlin-kapt'
|
||||
|
||||
dependencies {
|
||||
// compileOnly important!!! We do not want to put the api into the zip file since the main program has it already!
|
||||
compileOnly project(':api')
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||
kapt(group: 'org.pf4j', name: 'pf4j', version: "3.2.0")
|
||||
compileOnly(group: 'org.pf4j', name: 'pf4j', version: "3.2.0") {
|
||||
exclude group: "org.slf4j"
|
||||
}
|
||||
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.5'
|
||||
testCompile group: 'junit', name: 'junit', version: '4.+'
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes 'Plugin-Id': "${pluginId}",
|
||||
'Plugin-Class': "${pluginClass}",
|
||||
'Plugin-Version': "${pluginVersion}",
|
||||
'Plugin-Provider': "${pluginProvider}",
|
||||
'Plugin-Dependencies': "${pluginDependencies}"
|
||||
}
|
||||
}
|
||||
|
||||
task plugin(type: Jar) {
|
||||
archiveBaseName = "plugin-${pluginId}"
|
||||
into('classes') {
|
||||
with jar
|
||||
}
|
||||
into('lib') {
|
||||
from configurations.compile
|
||||
}
|
||||
archiveExtension = 'zip'
|
||||
}
|
||||
|
||||
task assemblePlugin(type: Copy) {
|
||||
from jar
|
||||
into pluginsDir
|
||||
}
|
||||
}
|
||||
|
||||
clean {
|
||||
dependsOn subprojects.clean
|
||||
}
|
||||
|
||||
task assemblePlugins(type: Copy) {
|
||||
dependsOn subprojects.assemblePlugin
|
||||
}
|
||||
|
||||
build.dependsOn assemblePlugins
|
||||
@@ -1,61 +0,0 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61"
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.jetbrains.kotlin.jvm'
|
||||
id 'kotlin-kapt'
|
||||
}
|
||||
|
||||
group 'io.bartek'
|
||||
version '1.0-SNAPSHOT'
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes 'Plugin-Id': "${pluginId}",
|
||||
'Plugin-Class': "${pluginClass}",
|
||||
'Plugin-Version': "${pluginVersion}",
|
||||
'Plugin-Provider': "${pluginProvider}",
|
||||
'Plugin-Dependencies': "${pluginDependencies}"
|
||||
}
|
||||
}
|
||||
|
||||
task plugin(type: Jar) {
|
||||
archiveBaseName = "plugin-${pluginId}"
|
||||
into('classes') {
|
||||
with jar
|
||||
}
|
||||
into('lib') {
|
||||
from configurations.compile
|
||||
}
|
||||
archiveExtension = 'zip'
|
||||
}
|
||||
|
||||
task assemblePlugin(type: Copy) {
|
||||
from jar
|
||||
into pluginsDir
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// compileOnly important!!! We do not want to put the api into the zip file since the main program has it already!
|
||||
compileOnly project(':api')
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||
kapt(group: 'org.pf4j', name: 'pf4j', version: "3.2.0")
|
||||
compileOnly(group: 'org.pf4j', name: 'pf4j', version: "3.2.0") {
|
||||
exclude group: "org.slf4j"
|
||||
}
|
||||
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.5'
|
||||
testCompile group: 'junit', name: 'junit', version: '4.+'
|
||||
}
|
||||
Reference in New Issue
Block a user