Improve Gradle build scripts
This commit is contained in:
@@ -1,17 +1,3 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.jetbrains.kotlin.jvm'
|
||||
}
|
||||
|
||||
group 'io.bartek'
|
||||
version '1.0-SNAPSHOT'
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||
@@ -20,9 +6,3 @@ dependencies {
|
||||
}
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions.jvmTarget = "1.8"
|
||||
}
|
||||
compileTestKotlin {
|
||||
kotlinOptions.jvmTarget = "1.8"
|
||||
}
|
||||
@@ -1,17 +1,3 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.jetbrains.kotlin.jvm'
|
||||
}
|
||||
|
||||
group 'io.bartek'
|
||||
version '1.0-SNAPSHOT'
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile project(':api')
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||
@@ -20,13 +6,6 @@ dependencies {
|
||||
compile group: 'org.pf4j', name: 'pf4j', version: '3.2.0'
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions.jvmTarget = "1.8"
|
||||
}
|
||||
compileTestKotlin {
|
||||
kotlinOptions.jvmTarget = "1.8"
|
||||
}
|
||||
|
||||
jar {
|
||||
zip64 true
|
||||
manifest {
|
||||
|
||||
37
build.gradle
37
build.gradle
@@ -1,32 +1,43 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.3.61'
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.3.61' apply false
|
||||
}
|
||||
|
||||
subprojects {
|
||||
allprojects {
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'org.jetbrains.kotlin.jvm'
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
ext.pluginsDir = rootProject.buildDir.path + '/modules'
|
||||
|
||||
group 'io.bartek'
|
||||
version '1.0-SNAPSHOT'
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions.jvmTarget = "1.8"
|
||||
}
|
||||
compileTestKotlin {
|
||||
kotlinOptions.jvmTarget = "1.8"
|
||||
}
|
||||
}
|
||||
|
||||
ext.pluginsDir = rootProject.buildDir.path + '/modules'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||
compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: '1.3.61'
|
||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||
compile group: 'org.pf4j', name: 'pf4j', version: '3.2.0'
|
||||
clean {
|
||||
dependsOn ':app:clean'
|
||||
dependsOn ':api:clean'
|
||||
dependsOn ':modules:clean'
|
||||
}
|
||||
|
||||
build.dependsOn ':app:jar'
|
||||
|
||||
build {
|
||||
dependsOn ':app:jar'
|
||||
dependsOn ':api:build'
|
||||
dependsOn ':modules:build'
|
||||
}
|
||||
|
||||
@@ -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