@ -90,7 +90,7 @@ dependencies {
implementation group: 'org.apache.commons' , name: 'commons-compress' , version: '1.21'
implementation group: 'org.apache.commons' , name: 'commons-compress' , version: '1.21'
implementation group: 'commons-fileupload' , name: 'commons-fileupload' , version: '1.4'
implementation group: 'commons-fileupload' , name: 'commons-fileupload' , version: '1.4'
implementation group: 'com.google.guava' , name: 'guava' , version: '31.0.1-jre'
implementation group: 'com.google.guava' , name: 'guava' , version: '31.0.1-jre'
implementation group: 'com.hazelcast' , name: 'hazelcast' , version: '4.2 '
implementation group: 'com.hazelcast' , name: 'hazelcast' , version: '4.2 .4 '
implementation group: 'com.ibm.icu' , name: 'icu4j' , version: '63.1'
implementation group: 'com.ibm.icu' , name: 'icu4j' , version: '63.1'
implementation group: 'com.twelvemonkeys.imageio' , name: 'imageio-bmp' , version: '3.8.1'
implementation group: 'com.twelvemonkeys.imageio' , name: 'imageio-bmp' , version: '3.8.1'
implementation group: 'com.twelvemonkeys.imageio' , name: 'imageio-tiff' , version: '3.8.1'
implementation group: 'com.twelvemonkeys.imageio' , name: 'imageio-tiff' , version: '3.8.1'
@ -136,7 +136,7 @@ configurations.implementation {
exclude group: 'org.slf4j' , module: 'slf4j-log4j12'
exclude group: 'org.slf4j' , module: 'slf4j-log4j12'
}
}
// output to lib / yacycore . jar ( like with ant with downside by determine class - path )
// configure jar
jar {
jar {
archiveFileName = 'yacycore.jar'
archiveFileName = 'yacycore.jar'
manifest {
manifest {
@ -186,27 +186,38 @@ compileJava.dependsOn(prepYaCyProperties) // must be executed before compile (du
// implement ant task to simulate old Ant build for htroot ,
// implement ant task to simulate old Ant build for htroot ,
// to avoid import of complete build . xml ( as currently used )
// to avoid import of complete build . xml ( as currently used )
task compileHtrootServlets ( dependsOn: [ 'jar' ] ) {
task compileHtrootServlets ( dependsOn: [ 'jar' ] ) {
if ( file ( jar . archiveFile ) . exists ( ) ) { // prevent buildscript failing on prime build with fresh git clone due to javac error during gradle init
inputs . files ( fileTree ( 'htroot' ) { // allow lifecycle UP - TO - DATE even with doLast block
ant {
include '**/*.java'
path ( id: 'project.class.path' ) {
include '**/*.class' // to detect missing class file
// place yacycore . jar on classpath ( not automatically done )
exclude 'processing/**'
pathelement ( location: jar . archiveFile . get ( ) )
} )
// construct path elements
outputs . files ( fileTree ( 'htroot' ) {
configurations . compileClasspath . each { pathelement ( location: it ) }
include '**/*.class'
}
} )
javac ( srcdir: 'htroot' , excludes: 'processing/**' ,
source: java . sourceCompatibility , target: java . targetCompatibility ,
doLast {
debug: "true" , debuglevel: "lines,vars,source" , includeantruntime: "false" , encoding: "UTF-8" ) {
if ( file ( jar . archiveFile ) . exists ( ) ) { // prevent buildscript failing on prime build with fresh git clone due to javac error during gradle init
classpath ( refid: 'project.class.path' )
// logger . warn ( "if java files changed in source AND htroot at the same time and build fails during 'Configure project' with javac error -> delete build/libs/yacycore.jar or build directory once" )
ant {
path ( id: 'project.class.path' ) {
// place yacycore . jar on classpath ( not automatically done )
pathelement ( location: jar . archiveFile . get ( ) )
// construct path elements
configurations . compileClasspath . each { pathelement ( location: it ) }
}
javac ( srcdir: 'htroot' , excludes: 'processing/**' ,
source: java . sourceCompatibility , target: java . targetCompatibility ,
debug: "true" , debuglevel: "lines,vars,source" , includeantruntime: "false" , encoding: "UTF-8" ) {
classpath ( refid: 'project.class.path' )
}
}
}
}
}
}
}
}
}
// copy additional files into directory used to create distribution archive ( distZip / distTar )
// copy additional files into directory used to create distribution archive ( distZip / distTar )
task copyFilesToDistDir ( type: Copy , dependsOn : [ 'compileJava' , 'jar' , 'compileHtrootServlets' ] ) {
task copyFilesToDistDir ( type: Copy , dependsOn : [ ' jar', 'compileHtrootServlets' ] ) {
String instDir = "$buildDir/RELEASE/MAIN/"
String instDir = "$buildDir/RELEASE/MAIN/"
outputs . files fileTree ( instDir )
from projectDir
from projectDir
include 'addon/**'
include 'addon/**'