mirror of https://github.com/apache/lucene.git
LUCENE-9978: Integrate Luke with the binary release package.
This commit is contained in:
parent
39d388330c
commit
627ef4d469
|
@ -15,6 +15,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import org.apache.tools.ant.filters.ExpandProperties
|
||||||
|
|
||||||
// Configure Lucene's binary release. This is a bit convoluted so is placed
|
// Configure Lucene's binary release. This is a bit convoluted so is placed
|
||||||
// in a separate script.
|
// in a separate script.
|
||||||
|
@ -28,6 +29,9 @@ configure(project(":lucene:distribution")) {
|
||||||
|
|
||||||
jars
|
jars
|
||||||
jarsTestFramework
|
jarsTestFramework
|
||||||
|
jarsThirdParty
|
||||||
|
|
||||||
|
log4j
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies { DependencyHandler handler ->
|
dependencies { DependencyHandler handler ->
|
||||||
|
@ -37,13 +41,11 @@ configure(project(":lucene:distribution")) {
|
||||||
// (with a few exceptions explicitly filtered below).
|
// (with a few exceptions explicitly filtered below).
|
||||||
// We don't copy their transitive dependencies.
|
// We don't copy their transitive dependencies.
|
||||||
def binaryModules = rootProject.ext.mavenProjects.findAll { p -> !(p in [
|
def binaryModules = rootProject.ext.mavenProjects.findAll { p -> !(p in [
|
||||||
// Will end up in a separate binary
|
// Placed in a separate folder (module layer conflicts).
|
||||||
project(":lucene:luke"),
|
|
||||||
// Placed in a separate module folder.
|
|
||||||
project(":lucene:test-framework"),
|
project(":lucene:test-framework"),
|
||||||
]) }
|
]) }
|
||||||
for (Project module : binaryModules) {
|
for (Project module : binaryModules) {
|
||||||
jars(project(path: module.path), {
|
jars(module, {
|
||||||
transitive = false
|
transitive = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -53,6 +55,19 @@ configure(project(":lucene:distribution")) {
|
||||||
jarsTestFramework(project(":lucene:test-framework"), {
|
jarsTestFramework(project(":lucene:test-framework"), {
|
||||||
transitive = false
|
transitive = false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// The third-party JARs consist of all the transitive dependencies from these modules.
|
||||||
|
// Not sure whether we have to include all the thirdparty JARs from across all the modules.
|
||||||
|
for (Project module : [
|
||||||
|
project(":lucene:luke")
|
||||||
|
]) {
|
||||||
|
jarsThirdParty(module, {
|
||||||
|
transitive = true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Just to collect the version.
|
||||||
|
log4j "org.apache.logging.log4j:log4j-api"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,8 +85,19 @@ configure(project(":lucene:distribution")) {
|
||||||
copy.setMode(0755)
|
copy.setMode(0755)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attach binary release exclusive files.
|
// Attach binary release - only files.
|
||||||
|
|
||||||
|
// We need to substitute log4j jar name because it's a proper module (for luke)
|
||||||
|
// and is otherwise invisible.
|
||||||
|
dependsOn configurations.log4j
|
||||||
|
def antPrj = new org.apache.tools.ant.Project()
|
||||||
|
doFirst {
|
||||||
|
antPrj.setProperty("log4j.api.jar", configurations.log4j.singleFile.name)
|
||||||
|
}
|
||||||
|
|
||||||
from(file("src/binary-release"), {
|
from(file("src/binary-release"), {
|
||||||
|
filteringCharset = 'UTF-8'
|
||||||
|
filter(ExpandProperties, project: antPrj)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Cherry-pick certain files from the root.
|
// Cherry-pick certain files from the root.
|
||||||
|
@ -86,7 +112,6 @@ configure(project(":lucene:distribution")) {
|
||||||
include "JRE_VERSION_MIGRATION.md"
|
include "JRE_VERSION_MIGRATION.md"
|
||||||
include "MIGRATE.md"
|
include "MIGRATE.md"
|
||||||
include "SYSTEM_REQUIREMENTS.md"
|
include "SYSTEM_REQUIREMENTS.md"
|
||||||
|
|
||||||
include "licenses/*"
|
include "licenses/*"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -95,12 +120,17 @@ configure(project(":lucene:distribution")) {
|
||||||
into 'docs'
|
into 'docs'
|
||||||
})
|
})
|
||||||
|
|
||||||
// Binary artifacts from modules.
|
// Binary modules (Lucene).
|
||||||
from(configurations.jars, {
|
from(configurations.jars, {
|
||||||
into 'jars'
|
into 'modules'
|
||||||
})
|
})
|
||||||
from(configurations.jarsTestFramework, {
|
from(configurations.jarsTestFramework, {
|
||||||
into 'test-framework'
|
into 'modules-test-framework'
|
||||||
|
})
|
||||||
|
|
||||||
|
// Binary modules (with dependencies). Don't duplicate project artifacts.
|
||||||
|
from((configurations.jarsThirdParty - configurations.jars), {
|
||||||
|
into 'modules-thirdparty'
|
||||||
})
|
})
|
||||||
|
|
||||||
// Internal archive folder for all files.
|
// Internal archive folder for all files.
|
||||||
|
|
|
@ -29,10 +29,16 @@ and an API that can easily be used to add search capabilities to applications.
|
||||||
|
|
||||||
## Files in a binary distribution
|
## Files in a binary distribution
|
||||||
|
|
||||||
Files are organized by module, for example in core/:
|
The following sub-folders are included in the binary Lucene distribution:
|
||||||
|
|
||||||
* `core/lucene-core-XX.jar`:
|
* `bin/`:
|
||||||
The compiled core Lucene library.
|
Convenience scripts to launch Lucene Luke and other index-maintenance tools.
|
||||||
|
* `modules/`:
|
||||||
|
All binary Lucene Java modules (JARs).
|
||||||
|
* `modules-thirdparty/`
|
||||||
|
Third-party binary modules required to run Lucene Luke.
|
||||||
|
* `licenses/`
|
||||||
|
Third-party licenses and notice files.
|
||||||
|
|
||||||
To review the documentation, read the main documentation page, located at:
|
To review the documentation, read the main documentation page, located at:
|
||||||
`docs/index.html`
|
`docs/index.html`
|
||||||
|
|
|
@ -14,15 +14,8 @@
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
|
|
||||||
@echo off
|
@echo off
|
||||||
@setlocal enabledelayedexpansion
|
|
||||||
|
|
||||||
cd /d %~dp0
|
SETLOCAL
|
||||||
|
SET MODULES=%~dp0..
|
||||||
set JAVA_OPTIONS=%JAVA_OPTIONS% -Xmx1024m -Xms512m -XX:MaxMetaspaceSize=256m
|
start javaw --module-path %MODULES%\modules;%MODULES%\modules-thirdparty -cp %MODULES%\modules-thirdparty\${log4j.api.jar} --module lucene.luke
|
||||||
|
ENDLOCAL
|
||||||
set CLASSPATHS=.\*;.\lib\*;..\core\*;..\codecs\*;..\backward-codecs\*;..\queries\*;..\queryparser\*;..\suggest\*;..\misc\*
|
|
||||||
for /d %%A in (..\analysis\*) do (
|
|
||||||
set "CLASSPATHS=!CLASSPATHS!;%%A\*;%%A\lib\*"
|
|
||||||
)
|
|
||||||
|
|
||||||
start javaw -cp %CLASSPATHS% %JAVA_OPTIONS% org.apache.lucene.luke.app.desktop.LukeMain
|
|
18
lucene/luke/bin/luke.sh → lucene/distribution/src/binary-release/bin/luke.sh
Executable file → Normal file
18
lucene/luke/bin/luke.sh → lucene/distribution/src/binary-release/bin/luke.sh
Executable file → Normal file
|
@ -15,19 +15,5 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
LUKE_HOME=$(cd $(dirname $0) && pwd)
|
MODULES=$(cd $(dirname $0) && pwd)
|
||||||
cd ${LUKE_HOME}
|
java --module-path $MODULES/modules;$MODULES/modules-thirdparty -cp $MODULES/modules-thirdparty/${log4j.api.jar} --module lucene.luke
|
||||||
|
|
||||||
JAVA_OPTIONS="${JAVA_OPTIONS} -Xmx1024m -Xms512m -XX:MaxMetaspaceSize=256m"
|
|
||||||
|
|
||||||
CLASSPATHS="./*:./lib/*:../core/*:../codecs/*:../backward-codecs/*:../queries/*:../queryparser/*:../suggest/*:../misc/*"
|
|
||||||
for dir in `ls ../analysis`; do
|
|
||||||
CLASSPATHS="${CLASSPATHS}:../analysis/${dir}/*:../analysis/${dir}/lib/*"
|
|
||||||
done
|
|
||||||
|
|
||||||
LOG_DIR=${HOME}/.luke.d/
|
|
||||||
if [[ ! -d ${LOG_DIR} ]]; then
|
|
||||||
mkdir ${LOG_DIR}
|
|
||||||
fi
|
|
||||||
|
|
||||||
nohup java -cp ${CLASSPATHS} ${JAVA_OPTIONS} org.apache.lucene.luke.app.desktop.LukeMain > ${LOG_DIR}/luke_out.log 2>&1 &
|
|
|
@ -57,13 +57,6 @@ tasks.withType(Jar) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure the default JAR without any class path information
|
|
||||||
// (this may actually be wrong - perhaps we should add the
|
|
||||||
// "distribution" paths here.
|
|
||||||
jar {
|
|
||||||
manifest {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Configure "stand-alone" JAR with proper dependency classpath links.
|
// Configure "stand-alone" JAR with proper dependency classpath links.
|
||||||
task standaloneJar(type: Jar) {
|
task standaloneJar(type: Jar) {
|
||||||
|
|
|
@ -56,9 +56,18 @@ public class MessageUtils {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private static ResourceBundle bundle =
|
private static ResourceBundle bundle;
|
||||||
ResourceBundle.getBundle(
|
|
||||||
MESSAGE_BUNDLE_BASENAME, Locale.ENGLISH, UTF8_RESOURCEBUNDLE_CONTROL);
|
static {
|
||||||
|
Class<?> self = MessageUtils.class;
|
||||||
|
if (self.getModule().isNamed()) {
|
||||||
|
bundle = ResourceBundle.getBundle(MESSAGE_BUNDLE_BASENAME, Locale.ENGLISH, self.getModule());
|
||||||
|
} else {
|
||||||
|
bundle =
|
||||||
|
ResourceBundle.getBundle(
|
||||||
|
MESSAGE_BUNDLE_BASENAME, Locale.ENGLISH, UTF8_RESOURCEBUNDLE_CONTROL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private MessageUtils() {}
|
private MessageUtils() {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue