gradle: убран лишний плагин
This commit is contained in:
@@ -1,11 +1,9 @@
|
|||||||
import fildep.FilteringDependenciesPlugin
|
|
||||||
import libs.LibsPlugin
|
import libs.LibsPlugin
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java'
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: FilteringDependenciesPlugin
|
|
||||||
apply plugin: LibsPlugin
|
apply plugin: LibsPlugin
|
||||||
|
|
||||||
def publishScript = file(rootProject.getProjectDir().getPath() + '/publish.gradle')
|
def publishScript = file(rootProject.getProjectDir().getPath() + '/publish.gradle')
|
||||||
@@ -27,13 +25,13 @@ dependencies {
|
|||||||
compileOnly libs.lombok
|
compileOnly libs.lombok
|
||||||
annotationProcessor libs.lombok
|
annotationProcessor libs.lombok
|
||||||
|
|
||||||
compileOnly fildep.filter(libs.bukkit)
|
compileOnly libs.bukkit
|
||||||
implementation libs.commons_text
|
implementation libs.commons_text
|
||||||
implementation libs.refobj
|
implementation libs.refobj
|
||||||
|
|
||||||
testImplementation libs.test.junit5
|
testImplementation libs.test.junit5
|
||||||
testImplementation libs.test.mock
|
testImplementation libs.test.mock
|
||||||
testImplementation fildep.filter(libs.bukkit)
|
testImplementation libs.bukkit
|
||||||
testImplementation libs.test.h2db
|
testImplementation libs.test.h2db
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
package fildep
|
|
||||||
|
|
||||||
class FilteringDependenciesExtention {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* example for 'library':
|
|
||||||
* <pre>
|
|
||||||
* [lib: 'org.bukkit:bukkit:1.12.2-R0.1-SNAPSHOT',
|
|
||||||
* exclude: [
|
|
||||||
* 'com.google.code.gson:gson',
|
|
||||||
* 'com.googlecode.json-simple:json-simple'
|
|
||||||
* ]]
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @param library see example
|
|
||||||
*/
|
|
||||||
def filter(library) {
|
|
||||||
Object[] result = new Object[2]
|
|
||||||
result[0] = library.lib
|
|
||||||
result[1] = {
|
|
||||||
library.exclude.each { String excludeLibStr ->
|
|
||||||
String[] excludeLib = excludeLibStr.split(':')
|
|
||||||
exclude group: excludeLib[0], module: excludeLib[1]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
package fildep
|
|
||||||
|
|
||||||
import org.gradle.api.Plugin
|
|
||||||
import org.gradle.api.Project
|
|
||||||
|
|
||||||
class FilteringDependenciesPlugin implements Plugin<Project> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
void apply(Project target) {
|
|
||||||
target.extensions.create('fildep', FilteringDependenciesExtention)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,12 +7,14 @@ class LibsExtention {
|
|||||||
final def lombok = 'org.projectlombok:lombok:1.18.12'
|
final def lombok = 'org.projectlombok:lombok:1.18.12'
|
||||||
final def refobj = 'ru.dmitriymx:reflection-object:1.0-BETA'
|
final def refobj = 'ru.dmitriymx:reflection-object:1.0-BETA'
|
||||||
|
|
||||||
final def bukkit = [lib: 'org.bukkit:bukkit:1.12.2-R0.1-SNAPSHOT', exclude: [
|
final def bukkit = filter([
|
||||||
'com.google.code.gson:gson',
|
lib : 'org.bukkit:bukkit:1.12.2-R0.1-SNAPSHOT',
|
||||||
'com.googlecode.json-simple:json-simple',
|
exclude: [
|
||||||
'commons-lang:commons-lang',
|
'com.google.code.gson:gson',
|
||||||
'org.yaml:snakeyaml'
|
'com.googlecode.json-simple:json-simple',
|
||||||
]]
|
'commons-lang:commons-lang',
|
||||||
|
'org.yaml:snakeyaml'
|
||||||
|
]])
|
||||||
|
|
||||||
final def test = [
|
final def test = [
|
||||||
junit5: [
|
junit5: [
|
||||||
@@ -22,4 +24,17 @@ class LibsExtention {
|
|||||||
mock : ['org.mockito:mockito-core:1.10.19'],
|
mock : ['org.mockito:mockito-core:1.10.19'],
|
||||||
h2db : 'com.h2database:h2:1.4.200'
|
h2db : 'com.h2database:h2:1.4.200'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
private static def filter(library) {
|
||||||
|
Object[] result = new Object[2]
|
||||||
|
result[0] = library.lib
|
||||||
|
result[1] = {
|
||||||
|
library.exclude.each { String excludeLibStr ->
|
||||||
|
String[] excludeLib = excludeLibStr.split(':')
|
||||||
|
exclude group: excludeLib[0], module: excludeLib[1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user