From 6e8a16e36fd21daf4548f9fd7aa42cae23773b52 Mon Sep 17 00:00:00 2001 From: DmitriyMX Date: Thu, 7 Oct 2021 11:35:49 +0300 Subject: [PATCH] gradle: script update --- .gitattributes | 2 +- .gitignore | 1 - build.gradle | 88 ++++++++++++++++------------------------------- gradle.properties | 3 -- settings.gradle | 2 +- 5 files changed, 32 insertions(+), 64 deletions(-) delete mode 100644 gradle.properties diff --git a/.gitattributes b/.gitattributes index 72216f8..0f3666f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,4 +4,4 @@ gradlew.bat text eol=crlf gradle/wrapper/gradle-wrapper.properties text eol=lf # Other -.gitattributes text eol=lf \ No newline at end of file +.gitattributes text eol=lf diff --git a/.gitignore b/.gitignore index 90ae4d1..6132566 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,3 @@ out/ # GRADLE # .gradle/ build/ -publish.gradle diff --git a/build.gradle b/build.gradle index bc0e549..bcc696b 100644 --- a/build.gradle +++ b/build.gradle @@ -2,13 +2,14 @@ plugins { id 'java' } -def publishScript = file(rootProject.getProjectDir().getPath() + '/publish.gradle') -if (publishScript.exists()) { - apply from: publishScript.path -} +project.group = 'ghast' +project.version = '1.12.2-SNAPSHOT' +jar.archiveBaseName.set(project.name) -project.group = projectGroup -project.version = projectVersion +compileJava { + sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8 + options.encoding = 'UTF-8' +} repositories { mavenLocal() @@ -17,63 +18,34 @@ repositories { maven { url 'https://dmx-mc-project.gitlab.io/maven-repository/' } } -ext { - junitVersion = '5.5.2' - - 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', - reflection_object: 'ru.dmitriymx:reflection-object:1.2', - test: [ - junit5: [ - "org.junit.jupiter:junit-jupiter-api:$junitVersion", - "org.junit.jupiter:junit-jupiter-engine:$junitVersion" - ], - mock: ['org.mockito:mockito-core:1.10.19'], - h2db: 'com.h2database:h2:1.4.200' - ] - - ] -} - -def compileOnly2(library) { - dependencies.compileOnly library.lib, { - library.exclude.each { String excludeLibStr -> - String[] excludeLib = excludeLibStr.split(':') - exclude group: excludeLib[0], module: excludeLib[1] - } - } -} - -def testImplementation2(library) { - dependencies.testImplementation library.lib, { - library.exclude.each { String excludeLibStr -> - String[] excludeLib = excludeLibStr.split(':') - exclude group: excludeLib[0], module: excludeLib[1] - } - } -} +def lombokVersion = '1.18.12' +def junitVersion = '5.5.2' dependencies { - compileOnly libs.lombok - annotationProcessor libs.lombok + annotationProcessor("org.projectlombok:lombok:$lombokVersion") + compileOnly("org.projectlombok:lombok:$lombokVersion") - compileOnly2 libs.bukkit - implementation libs.commons_text - implementation libs.reflection_object + compileOnly('org.bukkit:bukkit:1.12.2-R0.1-SNAPSHOT') { + exclude(module: 'gson') + exclude(module: 'json-simple') + exclude(module: 'commons-lang') + exclude(module: 'snakeyaml') + } + implementation('org.apache.commons:commons-text:1.9') + implementation('ru.dmitriymx:reflection-object:1.2') - testImplementation libs.test.junit5 - testImplementation libs.test.mock - testImplementation2 libs.bukkit - testImplementation libs.test.h2db + testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion") + testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitVersion") + testImplementation('org.mockito:mockito-core:1.10.19') + testImplementation('org.bukkit:bukkit:1.12.2-R0.1-SNAPSHOT') { + exclude(module: 'gson') + exclude(module: 'json-simple') + exclude(module: 'commons-lang') + exclude(module: 'snakeyaml') + } + testImplementation('com.h2database:h2:1.4.200') } test { useJUnitPlatform() -} \ No newline at end of file +} diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index 645012a..0000000 --- a/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -projectGroup=ghast -projectName=ghast-tools -projectVersion=1.12.1 \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index de4b82c..8159b24 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -rootProject.name=projectName \ No newline at end of file +rootProject.name = 'ghast-tools'