Implement the Ant javac task to compile htroot direct in Gradle

- import of the build.xml not longer needed and removed
This commit is contained in:
reger24 2022-01-21 07:42:47 +01:00
parent eb69d535a3
commit 4df29edd03
2 changed files with 18 additions and 27 deletions

View File

@ -242,18 +242,23 @@ task prepYaCyProperties (type: Copy) {
prepYaCyProperties.dependsOn(runGitComInf)
compileJava.dependsOn(prepYaCyProperties) // must be executed before compile
/** -----------------------------------------------------------
* Settings during the migration from Ant to Gradle build
* importing Ant targets and to use them within this Gradle build
* until/where functionality has not been migrated yet
* ------------------------------------------------------------
*/
// Import Ant build and prefix all task names with 'ant_' to prevent naming conflict with Gradle tasks.
ant.importBuild('build.xml') { antTaskName -> "ant_${antTaskName}".toString() }
// implement ant task to simulate old Ant build for htroot,
// to avoid import of complete build.xml (as currently used)
task compileHtrootServlets {
// Set group property for all Ant tasks.
tasks.matching { task -> task.name.startsWith('ant_') }*.group = 'Ant'
// include compile of htroot servlets in Gradle lifecycle somewhere after compileJava
startScripts.dependsOn("ant_gradle-compile-htroot")
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:'1.8', target:'1.8',
debug:"true", debuglevel:"lines,vars,source", includeantruntime:"false", encoding:"UTF-8") {
classpath (refid:'project.class.path')
}
}
}
startScripts.dependsOn(compileHtrootServlets)

View File

@ -330,20 +330,6 @@
</javac>
</target>
<!-- this is a copy of compile-htroot without dependency on init (likely not needed)
and intended to support / to by used by gradle -->
<target name="gradle-compile-htroot" description="compile YaCy servlets">
<!-- compile htroot, htroot/yacy and htroot/htdocsdefault -->
<loadproperties srcFile="build.properties" />
<javac srcdir="${htroot}/"
excludes="processing/**"
source="${javacSource}" target="${javacTarget}"
debug="true" debuglevel="lines,vars,source" includeantruntime="false" encoding="UTF-8">
<classpath refid="project.class.path" />
<compilerarg value="-Xlint"/>
</javac>
</target>
<target name="compile" depends="compile-core, compile-htroot" description="compile YaCy core and YaCy servlets" />
<target name="all" depends="compile">