Compare commits

...

21 Commits

Author SHA1 Message Date
  Thomas 9c6f5de489 Merge branch 'master' of https://gitea.pep.foundation/pEp.foundation/pEpJNIAdapter 2 months ago
  Thomas 573d410f7e Merge branch 'build-windows' 2 months ago
  Thomas 288b83b787 Merge remote-tracking branch 'upstream/Release_2.1' into build-windows 2 months ago
  Devan Carpenter 8029ef2ec0 CI: update script path for building libpEpAdapter 3 months ago
  heck ed0fcb3027 Merge branch 'android-build' into Release_2.1 4 months ago
  Hussein Kasem dba1a16f82
Android build: Use sequoia patch release v1.3.1 4 months ago
  Thomas 3be75d3129 Merge tag 'Release_2.1.36' of https://gitea.pep.foundation/pEp.foundation/pEpJNIAdapter into build-windows 5 months ago
  heck cf462c53e1 libpEpAdapter=Release_2.1.22 5 months ago
  heck fc208b835c pEpEngine=Release_2.1.49 5 months ago
  heck 661abc4205 Merge branch 'JNI-158' into Release_2.1 5 months ago
  Devan Carpenter 992988ac9c CI: match RPM version string to JNI Adapter 6 months ago
  Devan Carpenter 58dd0dc9cd CI: build CentOS/RedHat 8 RPM packages 6 months ago
  Thomas cb16fa75eb Merge remote-tracking branch 'upstream/Release_2.1' into build-windows 6 months ago
  heck 1c500d3561 pEpEngine=Release_2.1.45 6 months ago
  Thomas 85efc99cde Update Windows build file 6 months ago
  Thomas b9ec5fba98 Cancel building if code generation fails 7 months ago
  Thomas 97d1f5f1fe Adjust paths 7 months ago
  Thomas f128bea2c4 Complete merge 7 months ago
  Thomas 231acbd1a1 Generate Status files 7 months ago
  Thomas 515250d13a Add Windows build project and reference platform.h 7 months ago
  Thomas d93e3d10db Add Windows build project and reference platform.h 7 months ago
11 changed files with 281 additions and 7 deletions
Split View
  1. +7
    -0
      .gitignore
  2. +2
    -2
      DEPENDENCIES
  3. +1
    -1
      android/external/Makefile.conf
  4. +52
    -0
      build-windows/generate_code.cmd
  5. +139
    -0
      build-windows/pEpJNIAdapter.vcxproj
  6. +75
    -0
      build-windows/pEpJNIAdapter.vcxproj.filters
  7. +1
    -1
      scripts/debian10/java8.pEpJNIAdapter.debian10.Dockerfile
  8. +1
    -1
      scripts/debian10/pEpJNIAdapter.debian10.Dockerfile
  9. +1
    -2
      src/cxx/jniutils.cc
  10. +1
    -0
      src/cxx/jniutils.hh
  11. +1
    -0
      utils/gen_status_codes.sh

+ 7
- 0
.gitignore View File

@ -89,5 +89,12 @@ org.tar.gz
android/external/[?]*
android/external/build
# Ignore Windows build
build-windows/Debug
build-windows/Release
build-windows/.vs
build-windows/pEpJNIAdapter.vcxproj.user
# Default ignored files
?idea/

+ 2
- 2
DEPENDENCIES View File

@ -1,5 +1,5 @@
# 1st Party Dependencies
## Prefer git tags instead of SHA hashes when possible.
libpEpAdapter=Release_2.1.21
pEpEngine=Release_2.1.42
libpEpAdapter=Release_2.1.22
pEpEngine=Release_2.1.49

+ 1
- 1
android/external/Makefile.conf View File

@ -20,7 +20,7 @@ NETTLE_VERSION=3.7.3
### Git deps repos
EXTERNAL_GIT_REPOS += libetpan|https://gitea.pep.foundation/pEp.foundation/libetpan.git?0123f34ec4ef7711b3670b744b3ae7e97178afe1
EXTERNAL_GIT_REPOS += sequoia|https://gitlab.com/sequoia-pgp/sequoia.git?openpgp/v1.3.0
EXTERNAL_GIT_REPOS += sequoia|https://gitlab.com/sequoia-pgp/sequoia.git?openpgp/v1.3.1
### Common variables
#### Source code targets


+ 52
- 0
build-windows/generate_code.cmd View File

@ -0,0 +1,52 @@
SET current_directory=%~dp0
SET dist_directory=%current_directory:~0,-15%\dist
SET build_directory=%current_directory:~0,-15%\build
SET marker_dir=%build_directory%\marker
SET exceptions_directory=%current_directory:~0,-15%\src\java\foundation\pEp\jniadapter\exceptions
SET java_build_root=%build_directory%\java
SET java_pkg_basename=foundation\pEp\jniadapter
:: Create directories as necessary
MKDIR %marker_dir%
MKDIR %exceptions_directory%
:: Generate Status files
SH ..\utils\gen_status_codes.sh ..\..\pEp\pEpEngine.h
MV passphrase_status_list.yml2 ..\src\codegen\
MV status_list.yml2 ..\src\codegen\
:: Generate YML2 code
PUSHD ..
CD src
CD codegen
PY -m yml2.yml2proc -E utf-8 -y gen_java_Engine.ysl2 pEp.yml2
IF %ERRORLEVEL% NEQ 0 GOTO end
PY -m yml2.yml2proc -E utf-8 -y gen_java_Message.ysl2 pEp.yml2
IF %ERRORLEVEL% NEQ 0 GOTO end
PY -m yml2.yml2proc -E utf-8 -y gen_cpp_Engine.ysl2 pEp.yml2
IF %ERRORLEVEL% NEQ 0 GOTO end
PY -m yml2.yml2proc -E utf-8 -y gen_cpp_Message.ysl2 pEp.yml2
IF %ERRORLEVEL% NEQ 0 GOTO end
PY -m yml2.yml2proc -E utf-8 -y gen_throw_pEp_exception.ysl2 pEp.yml2
IF %ERRORLEVEL% NEQ 0 GOTO end
:: Compile the Java part
CD ..
CD java
javac -encoding UTF-8 -d "%java_build_root%" -h ..\cxx %java_pkg_basename%\*.java
IF %ERRORLEVEL% NEQ 0 GOTO end
javac -encoding UTF-8 -d "%java_build_root%" %java_pkg_basename%\*.java
IF %ERRORLEVEL% NEQ 0 GOTO end
javac -encoding UTF-8 -d "%java_build_root%" %java_pkg_basename%\exceptions\*.java
IF %ERRORLEVEL% NEQ 0 GOTO end
javac -encoding UTF-8 -d "%java_build_root%" %java_pkg_basename%\interfaces\*.java
IF %ERRORLEVEL% NEQ 0 GOTO end
"C:\Program Files\Java\jdk-16\bin\jar" -cvf "%java_build_root%\pEp.jar" -C "%java_build_root%" foundation
IF %ERRORLEVEL% NEQ 0 GOTO end
:end
POPD
EXIT /B %ERRORLEVEL%

+ 139
- 0
build-windows/pEpJNIAdapter.vcxproj View File

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\cxx\basic_api.cc" />
<ClCompile Include="..\src\cxx\foundation_pEp_jniadapter_AbstractEngine.cc" />
<ClCompile Include="..\src\cxx\foundation_pEp_jniadapter_Engine.cc" />
<ClCompile Include="..\src\cxx\foundation_pEp_jniadapter_Message.cc" />
<ClCompile Include="..\src\cxx\foundation_pEp_jniadapter__Blob.cc" />
<ClCompile Include="..\src\cxx\get_header.cc" />
<ClCompile Include="..\src\cxx\identity_api.cc" />
<ClCompile Include="..\src\cxx\jniutils.cc" />
<ClCompile Include="..\src\cxx\throw_pEp_exception.cc" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\cxx\foundation_pEp_jniadapter_AbstractEngine.h" />
<ClInclude Include="..\src\cxx\foundation_pEp_jniadapter_Engine.h" />
<ClInclude Include="..\src\cxx\foundation_pEp_jniadapter_Identity.h" />
<ClInclude Include="..\src\cxx\foundation_pEp_jniadapter_Message.h" />
<ClInclude Include="..\src\cxx\foundation_pEp_jniadapter__Blob.h" />
<ClInclude Include="..\src\cxx\jniutils.hh" />
<ClInclude Include="..\src\cxx\passphrase_callback.hh" />
<ClInclude Include="..\src\cxx\passphrase_callback.hxx" />
<ClInclude Include="..\src\cxx\throw_pEp_exception.hh" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\libpEpAdapter\build-windows\libpEpAdapter.vcxproj">
<Project>{ec44fec9-2f3a-4a0c-b60e-0f22aa43ef58}</Project>
</ProjectReference>
<ProjectReference Include="..\..\pEpEngine\build-windows\pEpEngine.vcxproj">
<Project>{146e69f8-e1da-456a-b048-6dd29d9acf6b}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{2a1167be-f438-4e08-b32e-25f130d97c33}</ProjectGuid>
<RootNamespace>pEpJNIAdapter</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<LibraryPath>$(ProjectDir)..\..\pEpForWindowsAdapterSolution\Debug\;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>__LP64__;WIN32;_DEBUG;PEPJNIADAPTER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<AdditionalIncludeDirectories>C:\Program Files\Java\jdk-16\include\win32;C:\Program Files\Java\jdk-16\include;$(ProjectDir)..\..\</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
<PreBuildEvent>
<Command>IF NOT EXIST "..\build" CALL generate_code.cmd</Command>
</PreBuildEvent>
<PostBuildEvent>
<Command>CP "..\build\java\pEp.jar" "$(SolutionDir)\$(Configuration)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>__LP64__;WIN32;NDEBUG;PEPJNIADAPTER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<AdditionalIncludeDirectories>C:\Program Files\Java\jdk-16\include\win32;C:\Program Files\Java\jdk-16\include;$(ProjectDir)..\..\</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
<PreBuildEvent>
<Command>IF NOT EXIST "..\build" CALL generate_code.cmd</Command>
</PreBuildEvent>
<PostBuildEvent>
<Command>CP "..\build\java\pEp.jar" "$(SolutionDir)\$(Configuration)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<Target Name="CustomClean" BeforeTargets="Clean">
<RemoveDir Directories="..\build" />
</Target>
</Project>

+ 75
- 0
build-windows/pEpJNIAdapter.vcxproj.filters View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\cxx\basic_api.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\cxx\foundation_pEp_jniadapter__Blob.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\cxx\foundation_pEp_jniadapter_AbstractEngine.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\cxx\foundation_pEp_jniadapter_Engine.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\cxx\foundation_pEp_jniadapter_Message.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\cxx\get_header.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\cxx\identity_api.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\cxx\jniutils.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\cxx\throw_pEp_exception.cc">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\cxx\jniutils.hh">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\cxx\passphrase_callback.hh">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\cxx\passphrase_callback.hxx">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\cxx\throw_pEp_exception.hh">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\cxx\foundation_pEp_jniadapter__Blob.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\cxx\foundation_pEp_jniadapter_AbstractEngine.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\cxx\foundation_pEp_jniadapter_Engine.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\cxx\foundation_pEp_jniadapter_Identity.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\cxx\foundation_pEp_jniadapter_Message.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

+ 1
- 1
scripts/debian10/java8.pEpJNIAdapter.debian10.Dockerfile View File

@ -20,7 +20,7 @@ RUN git clone --depth=1 \
WORKDIR ${BUILDROOT}/libpEpAdapter
### Build libpEpAdapter
RUN sh ./scripts/${CURRENT_DISTRO}/build_libpEpAdapter.sh && \
RUN sh ./scripts/common/build_libpEpAdapter.sh && \
rm -rf ${BUILDROOT}/*


+ 1
- 1
scripts/debian10/pEpJNIAdapter.debian10.Dockerfile View File

@ -20,7 +20,7 @@ RUN git clone --depth=1 \
WORKDIR ${BUILDROOT}/libpEpAdapter
### Build libpEpAdapter
RUN sh ./scripts/${CURRENT_DISTRO}/build_libpEpAdapter.sh && \
RUN sh ./scripts/common/build_libpEpAdapter.sh && \
rm -rf ${BUILDROOT}/*
### Install system dependencies


+ 1
- 2
src/cxx/jniutils.cc View File

@ -237,7 +237,6 @@ jbyteArray from_string(JNIEnv *env,
const char *str)
{
if (str && str[0]) {
jboolean isCopy;
size_t l = strlen(str);
jbyteArray _str = env->NewByteArray(l);
env->SetByteArrayRegion(_str, 0, l, (jbyte *) str);
@ -433,7 +432,7 @@ timestamp *to_timestamp(JNIEnv *env,
if (t) {
time_t clock = t / 1000;
gmtime_r(&clock, ts);
gmtime_r(&clock, (struct tm*)ts);
//LOGD("/* Seconds (0-60) */ TO :%d", ts->tm_sec);
//LOGD("/* Minutes (0-59) */ :%d", ts->tm_min);


+ 1
- 0
src/cxx/jniutils.hh View File

@ -10,6 +10,7 @@
#include <pEp/message.h>
#include <pEp/sync_api.h>
#include <pEp/passphrase_cache.hh>
#include <pEp/platform.h>
#if 0 // Enable if log needed
#include <android/log.h>


+ 1
- 0
utils/gen_status_codes.sh View File

@ -23,6 +23,7 @@ OS="$(uname -s)"
case "${OS}" in
Linux*) SED=sed;;
Darwin*) SED=gsed;;
MSYS*) SED=sed;;
CYGWIN*) echo "UNSUPORTED YET" && exit;;
MINGW*) echo "UNSUPORTED YET" && exit;;
*) echo "UNKNOWN:${OS}" && exit;;


Loading…
Cancel
Save