перенос типичных настроек в logic.gradle
This commit is contained in:
33
build.gradle
33
build.gradle
@@ -5,44 +5,13 @@
|
|||||||
|
|
||||||
import ru.dmitriymx.gradle.plugin.LibsPlugin
|
import ru.dmitriymx.gradle.plugin.LibsPlugin
|
||||||
|
|
||||||
class Logic {
|
|
||||||
private final Project project
|
|
||||||
|
|
||||||
Logic(Project project) {
|
|
||||||
this.project = project
|
|
||||||
}
|
|
||||||
|
|
||||||
String getProperty1(String propertyName1, String propertyName2) {
|
|
||||||
return (String) (project.hasProperty(propertyName1) ? project.property(propertyName1) : project.property(propertyName2))
|
|
||||||
}
|
|
||||||
|
|
||||||
String getProperty1(String propertyName) {
|
|
||||||
return (String) (project.hasProperty(propertyName) ? project.property(propertyName) : null)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java'
|
||||||
id 'application'
|
id 'application'
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: LibsPlugin
|
apply plugin: LibsPlugin
|
||||||
|
apply from: rootDir.toPath().resolve('logic.gradle').toFile()
|
||||||
def logic = new Logic(project)
|
|
||||||
|
|
||||||
project.group = logic.getProperty1('project.group')
|
|
||||||
project.version = logic.getProperty1('project.version')
|
|
||||||
jar.archiveBaseName.set(logic.getProperty1('project.name'))
|
|
||||||
|
|
||||||
compileJava {
|
|
||||||
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_11
|
|
||||||
options.encoding = 'UTF-8'
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
annotationProcessor libs.lombok
|
annotationProcessor libs.lombok
|
||||||
|
|||||||
17
logic.gradle
Normal file
17
logic.gradle
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
String getProperty1(String propertyName1, String propertyName2) {
|
||||||
|
return (String) (project.hasProperty(propertyName1) ? project.property(propertyName1) : project.property(propertyName2))
|
||||||
|
}
|
||||||
|
|
||||||
|
project.group = getProperty1('module.group', 'project.group')
|
||||||
|
project.version = getProperty1('module.version', 'project.version')
|
||||||
|
project.jar.archiveBaseName.set(getProperty1('module.name', 'project.name'))
|
||||||
|
|
||||||
|
compileJava {
|
||||||
|
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_11
|
||||||
|
options.encoding = 'UTF-8'
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user