chore: improving build configuration

This commit is contained in:
Georgy Litvinov 2021-12-08 13:52:09 +01:00
parent 56a44ea1fd
commit 7d03b2a02d

View file

@ -23,10 +23,9 @@ sourceSets {
}
sourceCompatibility = 1.8
configurations{
bundledLibs
regressionTestsCompile.extendsFrom mainCompile
regressionTestsRuntime.extendsFrom mainRuntime
regressionTestsRuntime.extendsFrom bundledLibs
regressionTestsRuntime.extendsFrom compileClasspath
}
dependencies{
regressionTestsImplementation group: 'commons-io', name: 'commons-io', version: '2.8.0'
@ -34,22 +33,21 @@ dependencies{
regressionTestsImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.7.1'
regressionTestsRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
bundledLibs 'org.libreoffice:jurt:5.3.2'
bundledLibs 'org.libreoffice:juh:5.3.2'
bundledLibs 'org.libreoffice:ridl:5.3.2'
bundledLibs 'org.libreoffice:unoil:5.3.2'
bundledLibs 'org.json:json:20190722'
bundledLibs group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
bundledLibs group: 'ch.qos.logback', name: 'logback-core', version: '1.2.3'
bundledLibs group: 'com.miglayout', name: 'miglayout-swing', version: '5.2'
bundledLibs group: 'org.apache.jena', name: 'jena-core', version: '3.15.0'
bundledLibs group: 'org.apache.jena', name: 'jena-arq', version: '3.15.0'
bundledLibs group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'
bundledLibs group: 'com.opencsv', name: 'opencsv', version: '5.1'
bundledLibs group: 'org.imgscalr', name: 'imgscalr-lib', version: '4.2'
bundledLibs group: 'org.apache.commons', name: 'commons-imaging', version: '1.0-alpha2'
compileClasspath 'org.libreoffice:jurt:5.3.2'
compileClasspath 'org.libreoffice:juh:5.3.2'
compileClasspath 'org.libreoffice:ridl:5.3.2'
compileClasspath 'org.libreoffice:unoil:5.3.2'
compileClasspath 'org.json:json:20190722'
compileClasspath group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
compileClasspath group: 'ch.qos.logback', name: 'logback-core', version: '1.2.3'
compileClasspath group: 'com.miglayout', name: 'miglayout-swing', version: '5.2'
compileClasspath group: 'org.apache.jena', name: 'jena-core', version: '3.15.0'
compileClasspath group: 'org.apache.jena', name: 'jena-arq', version: '3.15.0'
compileClasspath group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'
compileClasspath group: 'com.opencsv', name: 'opencsv', version: '5.1'
compileClasspath group: 'org.imgscalr', name: 'imgscalr-lib', version: '4.2'
compileClasspath group: 'org.apache.commons', name: 'commons-imaging', version: '1.0-alpha2'
configurations.compile.extendsFrom(configurations.bundledLibs)
}
jar {
archiveName 'w2phtml.jar'
@ -60,8 +58,9 @@ jar {
"Class-Path" : "jasp.jar parser.jar")
}
duplicatesStrategy = 'exclude'
from {
configurations.bundledLibs.collect { it.isDirectory() ? it : zipTree(it) }
configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
from('src/main/java') {
include '**/*.properties'
@ -85,9 +84,10 @@ task xhtml(type: Jar) {
"RegistrationClassName" : "pro.litvinovg.w2phtml.RegistrationHandler",
"Class-Path" : "jasp.jar parser.jar")
}
duplicatesStrategy = 'exclude'
baseName = "writer2phtml"
from {
configurations.bundledLibs.collect {
configurations.compileClasspath.collect {
exclude 'module-info.class'
exclude '.gradle'
exclude '**/LICENSE*'
@ -108,6 +108,7 @@ task xhtml(type: Jar) {
include 'etc/*'
include 'com/**'
include 'com/**/*'
exclude '**/DEPENDENCIES'
include 'w2phtml/pageSplitters/**/*.class'
include 'pro/litvinovg/**/*.class'
include 'pro/litvinovg/**/*.png'
@ -130,6 +131,7 @@ task xhtml(type: Jar) {
exclude '.gradle'
}
from ('src/main/java'){
exclude '**/DEPENDENCIES'
exclude '.gradle'
include 'w2phtml/xhtml/**/*.properties'
include 'w2phtml/xhtml/**/**/*.properties'
@ -164,6 +166,7 @@ task oxt(type: Zip){
from 'releasenotes.txt'
include '*'
}
task regressionTests(type: Test) {
testClassesDirs = sourceSets.regressionTests.output.classesDirs
classpath = sourceSets.regressionTests.runtimeClasspath