Archived
0

перенос типичных настроек в logic.gradle

This commit is contained in:
2021-04-26 14:34:58 +03:00
parent 39b858696f
commit 612eef2361
2 changed files with 18 additions and 32 deletions

View File

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