aboutsummaryrefslogtreecommitdiff
path: root/tools/make_jni_header.bat
blob: ee636b57ac90128706529ee5efcaf6c6056cd62d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@echo off
:: Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
:: reserved. Use of this source code is governed by a BSD-style license
:: that can be found in the LICENSE file.

set RETURNCODE=
setlocal

cd ..

if "%1" == "" (
echo ERROR: Please specify a target platform: win32 or win64
set ERRORLEVEL=1
goto end
)

if "%2" == "" (
echo ERROR: Please specify a class name
set ERRORLEVEL=1
goto end
)

set OUT_PATH=".\native"
set CLS_PATH=".\third_party\jogamp\jar\*;.\out\%1"
set CLS_NAME=""

SET TMP="%2"
:loop
for /F "tokens=1,* delims=." %%F in (%TMP%) DO (
  set CLS_NAME="%%F"
  set TMP="%%G"
  goto loop
)

call javah.exe -force -classpath %CLS_PATH% -o %OUT_PATH%/%CLS_NAME%.h %2

:end
endlocal & set RETURNCODE=%ERRORLEVEL%
goto omega

:returncode
exit /B %RETURNCODE%

:omega
call :returncode %RETURNCODE%