0

gradle: убран лишний плагин

This commit is contained in:
2021-01-07 02:25:29 +03:00
parent 1a23102f2e
commit 132dd2f4ca
4 changed files with 23 additions and 51 deletions

View File

@@ -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
}
}

View File

@@ -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)
}
}

View File

@@ -7,12 +7,14 @@ class LibsExtention {
final def lombok = 'org.projectlombok:lombok:1.18.12'
final def refobj = 'ru.dmitriymx:reflection-object:1.0-BETA'
final def bukkit = [lib: 'org.bukkit:bukkit:1.12.2-R0.1-SNAPSHOT', exclude: [
'com.google.code.gson:gson',
'com.googlecode.json-simple:json-simple',
'commons-lang:commons-lang',
'org.yaml:snakeyaml'
]]
final def bukkit = filter([
lib : 'org.bukkit:bukkit:1.12.2-R0.1-SNAPSHOT',
exclude: [
'com.google.code.gson:gson',
'com.googlecode.json-simple:json-simple',
'commons-lang:commons-lang',
'org.yaml:snakeyaml'
]])
final def test = [
junit5: [
@@ -22,4 +24,17 @@ class LibsExtention {
mock : ['org.mockito:mockito-core:1.10.19'],
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
}
}