gradle: libs.gradle преобразован в gradle-plugin
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import fildep.FilteringDependenciesPlugin
|
||||
import libs.LibsPlugin
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
apply plugin: FilteringDependenciesPlugin
|
||||
apply from: 'libs.gradle'
|
||||
apply plugin: LibsPlugin
|
||||
|
||||
def publishScript = file(rootProject.getProjectDir().getPath() + '/publish.gradle')
|
||||
if (publishScript.exists()) {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
package fildep
|
||||
|
||||
class FilteringDependenciesExtention {
|
||||
|
||||
/**
|
||||
@@ -1,3 +1,5 @@
|
||||
package fildep
|
||||
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
|
||||
25
buildSrc/src/main/groovy/libs/LibsExtention.groovy
Normal file
25
buildSrc/src/main/groovy/libs/LibsExtention.groovy
Normal file
@@ -0,0 +1,25 @@
|
||||
package libs
|
||||
|
||||
class LibsExtention {
|
||||
private def junit_version = '5.5.2'
|
||||
|
||||
final def commons_text = 'org.apache.commons:commons-text:1.9'
|
||||
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 test = [
|
||||
junit5: [
|
||||
"org.junit.jupiter:junit-jupiter-api:$junit_version",
|
||||
"org.junit.jupiter:junit-jupiter-engine:$junit_version"
|
||||
],
|
||||
mock : ['org.mockito:mockito-core:1.10.19'],
|
||||
h2db : 'com.h2database:h2:1.4.200'
|
||||
]
|
||||
}
|
||||
12
buildSrc/src/main/groovy/libs/LibsPlugin.groovy
Normal file
12
buildSrc/src/main/groovy/libs/LibsPlugin.groovy
Normal file
@@ -0,0 +1,12 @@
|
||||
package libs
|
||||
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
|
||||
class LibsPlugin implements Plugin<Project> {
|
||||
|
||||
@Override
|
||||
void apply(Project project) {
|
||||
project.extensions.create('libs', LibsExtention)
|
||||
}
|
||||
}
|
||||
25
libs.gradle
25
libs.gradle
@@ -1,25 +0,0 @@
|
||||
ext {
|
||||
versions = [junit: '5.5.2']
|
||||
|
||||
//noinspection GroovyAssignabilityCheck
|
||||
libs = [
|
||||
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'
|
||||
]],
|
||||
commons_text: 'org.apache.commons:commons-text:1.9',
|
||||
lombok : 'org.projectlombok:lombok:1.18.12',
|
||||
refobj : 'ru.dmitriymx:reflection-object:1.0-BETA',
|
||||
|
||||
test : [
|
||||
junit5: [
|
||||
"org.junit.jupiter:junit-jupiter-api:$versions.junit",
|
||||
"org.junit.jupiter:junit-jupiter-engine:$versions.junit"
|
||||
],
|
||||
mock : ['org.mockito:mockito-core:1.10.19'],
|
||||
h2db : 'com.h2database:h2:1.4.200'
|
||||
]
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user