Checking in vendor folder for ease of using go get.

This commit is contained in:
Renan DelValle 2018-10-23 23:32:59 -07:00
parent 7a1251853b
commit cdb4b5a1d0
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9
3554 changed files with 1270116 additions and 0 deletions

View file

@ -0,0 +1,28 @@
How to use the test case:
----------------------------------------------
- copy and the template batch file
- open the batch file and adjust configuration as necessary
- run the batch
Configuration:
----------------------------------------------
SVNWORKDIR
should point to the Thrift working copy root
MY_THRIFT_FILES
can be set to point to a folder with more thrift IDL files.
If you don't have any such files, just leave the setting blank.
BIN
Local MSYS binary folder. Your THRIFT.EXE is installed here.
MINGW_BIN
Local MinGW bin folder. Contains DLL files required by THRIFT.EXE
DCC
Identifies the Delphi Command Line compiler (dcc32.exe)
To be configuired only, if the default is not suitable.
----------------------------------------------
*EOF*

View file

@ -0,0 +1,55 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// make sure generated code does not produce name collisions with predefined keywords
typedef i32 Cardinal
typedef string message
typedef list< map< Cardinal, message>> program
struct unit {
1: Cardinal downto;
2: program procedure;
}
typedef set< unit> units
exception exception1 {
1: program message;
2: unit array;
}
service constructor {
unit Create(1: Cardinal asm; 2: message inherited) throws (1: exception1 label);
units Destroy();
}
const Cardinal downto = +1
const Cardinal published = -1
enum keywords {
record = 1,
repeat = 2,
deprecated = 3
}

View file

@ -0,0 +1,173 @@
REM /*
REM * Licensed to the Apache Software Foundation (ASF) under one
REM * or more contributor license agreements. See the NOTICE file
REM * distributed with this work for additional information
REM * regarding copyright ownership. The ASF licenses this file
REM * to you under the Apache License, Version 2.0 (the
REM * "License"); you may not use this file except in compliance
REM * with the License. You may obtain a copy of the License at
REM *
REM * http://www.apache.org/licenses/LICENSE-2.0
REM *
REM * Unless required by applicable law or agreed to in writing,
REM * software distributed under the License is distributed on an
REM * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
REM * KIND, either express or implied. See the License for the
REM * specific language governing permissions and limitations
REM * under the License.
REM */
@echo off
if ""=="%1" goto CONFIG
goto HANDLEDIR
REM -----------------------------------------------------
:CONFIG
REM -----------------------------------------------------
rem * CONFIGURATION BEGIN
rem * configuration settings, adjust as necessary to meet your system setup
set SVNWORKDIR=
set MY_THRIFT_FILES=
set BIN=C:\MSys10\local\bin
set MINGW_BIN=C:\MinGW\bin
set DCC=
set SUBDIR=gen-delphi
rem * CONFIGURATION END
REM -----------------------------------------------------
:START
REM -----------------------------------------------------
rem * configured?
if "%SVNWORKDIR%"=="" goto CONFIG_ERROR
rem * try to find dcc32.exe
echo Looking for dcc32.exe ...
if not exist "%DCC%" set DCC=%ProgramFiles%\Embarcadero\RAD Studio\8.0\bin\dcc32.exe
if not exist "%DCC%" set DCC=%ProgramFiles(x86)%\Embarcadero\RAD Studio\8.0\bin\dcc32.exe
if not exist "%DCC%" goto CONFIG_ERROR
echo Found %DCC%
echo.
rem * some helpers
set PATH=%BIN%;%MINGW_BIN%;%PATH%
set TARGET=%SVNWORKDIR%\..\thrift-testing
set SOURCE=%SVNWORKDIR%
set TESTAPP=TestProject
set UNITSEARCH=%SOURCE%\lib\pas\src;%SOURCE%\lib\delphi\src
set OUTDCU="%TARGET%\dcu"
set LOGFILE=%TARGET%\%SUBDIR%\codegen.log
rem * create and/or empty target dirs
if not exist "%TARGET%" md "%TARGET%"
if not exist "%TARGET%\%SUBDIR%" md "%TARGET%\%SUBDIR%"
if not exist "%OUTDCU%" md "%OUTDCU%"
if exist "%TARGET%\*.thrift" del "%TARGET%\*.thrift" /Q
if exist "%TARGET%\%SUBDIR%\*.*" del "%TARGET%\%SUBDIR%\*.*" /Q
if exist "%OUTDCU%\*.*" del "%OUTDCU%\*.*" /Q
rem * recurse through thrift WC and "my thrift files" folder
rem * copies all .thrift files into thrift-testing
call %0 %SOURCE%
if not "%MY_THRIFT_FILES%"=="" call %0 %MY_THRIFT_FILES%
rem * compile all thrift files, generate PAS and C++ code
echo.
echo Generating code, please wait ...
cd "%TARGET%"
for %%a in (*.thrift) do "%BIN%\thrift.exe" -v --gen delphi:register_types,constprefix,events,xmldoc "%%a" 2>> "%LOGFILE%"
REM * for %%a in (*.thrift) do "%BIN%\thrift.exe" -v --gen cpp "%%a" >> NUL:
cmd /c start notepad "%LOGFILE%"
cd ..
rem * check for special Delphi testcases being processed
if not exist "%TARGET%\%SUBDIR%\ReservedKeywords.pas" goto TESTCASE_MISSING
rem * generate a minimal DPR file that uses all generated pascal units
cd "%TARGET%\%SUBDIR%\"
if exist inherited.* ren inherited.* _inherited.*
echo program %TESTAPP%; > %TESTAPP%.dpr
echo {$APPTYPE CONSOLE} >> %TESTAPP%.dpr
echo. >> %TESTAPP%.dpr
echo uses >> %TESTAPP%.dpr
for %%a in (*.pas) do echo %%~na, >> %TESTAPP%.dpr
echo Windows, Classes, SysUtils; >> %TESTAPP%.dpr
echo. >> %TESTAPP%.dpr
echo begin >> %TESTAPP%.dpr
echo Writeln('Successfully compiled!'); >> %TESTAPP%.dpr
echo Writeln('List of units:'); >> %TESTAPP%.dpr
for %%a in (*.pas) do echo Write('%%~na':30,'':10); >> %TESTAPP%.dpr
echo Writeln; >> %TESTAPP%.dpr
echo end. >> %TESTAPP%.dpr
echo. >> %TESTAPP%.dpr
cd ..\..
rem * try to compile the DPR
rem * this should not throw any errors, warnings or hints
"%DCC%" -B "%TARGET%\%SUBDIR%\%TESTAPP%" -U"%UNITSEARCH%" -I"%UNITSEARCH%" -N"%OUTDCU%" -E"%TARGET%\%SUBDIR%"
dir "%TARGET%\%SUBDIR%\%TESTAPP%.exe"
if not exist "%TARGET%\%SUBDIR%\%TESTAPP%.exe" goto CODEGEN_FAILED
echo.
echo -----------------------------------------------------------------
echo The compiled program is now executed. If it hangs or crashes, we
echo have a serious problem with the generated code. Expected output
echo is "Successfully compiled:" followed by a list of generated units.
echo -----------------------------------------------------------------
"%TARGET%\%SUBDIR%\%TESTAPP%.exe"
echo -----------------------------------------------------------------
echo.
pause
GOTO EOF
REM -----------------------------------------------------
:DXE_NOT_FOUND
REM -----------------------------------------------------
echo Delphi Compiler (dcc32.exe) not found.
echo Please check the "DCC" setting in this batch.
echo.
cmd /c start notepad README.MD
cmd /c start notepad %0
pause
GOTO EOF
REM -----------------------------------------------------
:CONFIG_ERROR
REM -----------------------------------------------------
echo Missing, incomplete or wrong configuration settings!
cmd /c start notepad README.MD
cmd /c start notepad %0
pause
GOTO EOF
REM -----------------------------------------------------
:TESTCASE_MISSING
REM -----------------------------------------------------
echo Missing an expected Delphi testcase!
pause
GOTO EOF
REM -----------------------------------------------------
:CODEGEN_FAILED
REM -----------------------------------------------------
echo Code generation FAILED!
pause
GOTO EOF
REM -----------------------------------------------------
:HANDLEDIR
REM -----------------------------------------------------
REM echo %1
for /D %%a in (%1\*) do call %0 %%a
if exist "%1\*.thrift" copy /b "%1\*.thrift" "%TARGET%\*.*"
GOTO EOF
REM -----------------------------------------------------
:EOF
REM -----------------------------------------------------