xref: /Lucene/lucene/distribution/src/binary-release/bin/luke.cmd (revision 25c4310bd56fee8d7474f041f2eebb54c6133c42)
1627ef4d4SDawid Weiss@rem Licensed to the Apache Software Foundation (ASF) under one or more
2627ef4d4SDawid Weiss@rem contributor license agreements.  See the NOTICE file distributed with
3627ef4d4SDawid Weiss@rem this work for additional information regarding copyright ownership.
4627ef4d4SDawid Weiss@rem The ASF licenses this file to You under the Apache License, Version 2.0
5627ef4d4SDawid Weiss@rem the "License"); you may not use this file except in compliance with
6627ef4d4SDawid Weiss@rem the License.  You may obtain a copy of the License at
7627ef4d4SDawid Weiss@rem
8627ef4d4SDawid Weiss@rem     http://www.apache.org/licenses/LICENSE-2.0
9627ef4d4SDawid Weiss@rem
10627ef4d4SDawid Weiss@rem Unless required by applicable law or agreed to in writing, software
11627ef4d4SDawid Weiss@rem distributed under the License is distributed on an "AS IS" BASIS,
12627ef4d4SDawid Weiss@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13627ef4d4SDawid Weiss@rem See the License for the specific language governing permissions and
14627ef4d4SDawid Weiss@rem limitations under the License.
15627ef4d4SDawid Weiss
16*25c4310bSDawid Weiss@ECHO OFF
17627ef4d4SDawid Weiss
18627ef4d4SDawid WeissSETLOCAL
19627ef4d4SDawid WeissSET MODULES=%~dp0..
2072ba7ae2SDawid Weiss
2181ab1e59SDawid WeissIF DEFINED LAUNCH_CMD GOTO testing
22*25c4310bSDawid WeissREM Windows 'start' command takes the first quoted argument to be the title of the started window. Since we
23*25c4310bSDawid WeissREM quote the LAUNCH_CMD (because it can contain spaces), it misinterprets it as the title and fails to run.
24*25c4310bSDawid WeissREM force the window title here.
25*25c4310bSDawid WeissSET LAUNCH_START=start "Lucene Luke"
26*25c4310bSDawid WeissSET LAUNCH_CMD=javaw
2781ab1e59SDawid WeissSET LAUNCH_OPTS=
2881ab1e59SDawid Weissgoto launch
2981ab1e59SDawid Weiss
3081ab1e59SDawid Weiss:testing
31*25c4310bSDawid WeissREM For distribution testing we don't use start and pass an explicit java command path,
32*25c4310bSDawid WeissREM This is required because otherwise we can't block on luke invocation and can't intercept
33*25c4310bSDawid WeissREM the return status. We also force UTF-8 encoding so that we don't have to interpret the output in
34*25c4310bSDawid WeissREM an unknown local platform encoding.
35*25c4310bSDawid WeissSET LAUNCH_START=
3681ab1e59SDawid WeissSET LAUNCH_OPTS=-Dfile.encoding=UTF-8
3772ba7ae2SDawid Weiss
3872ba7ae2SDawid Weiss:launch
39*25c4310bSDawid Weiss%LAUNCH_START% "%LAUNCH_CMD%" %LAUNCH_OPTS% --module-path "%MODULES%\modules;%MODULES%\modules-thirdparty" --module org.apache.lucene.luke %*
4072ba7ae2SDawid WeissSET EXITVAL=%errorlevel%
4172ba7ae2SDawid WeissEXIT /b %EXITVAL%
42627ef4d4SDawid WeissENDLOCAL
43