Skip to content

Commit 6befc48

Browse files
committed
Update to Conan 2
1 parent 454707b commit 6befc48

File tree

9 files changed

+72
-74
lines changed

9 files changed

+72
-74
lines changed

.github/workflows/build-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: actions/setup-dotnet@v1
2626
with:
2727
dotnet-version: |
28-
6.0.x
28+
8.0.x
2929
3030
- name: Add msbuild to PATH
3131
uses: microsoft/[email protected]

build-windows.ps1

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@ Param(
66
[Parameter(ParameterSetName="WithoutProfile", Mandatory)]
77
[string]$build_type,
88
[Parameter(Mandatory=$false)]
9-
[bool]$build_nfc,
10-
[Parameter(Mandatory=$false)]
11-
[bool]$build_unittest
9+
[bool]$build_nfc
1210
)
1311

1412
Write-Host $arch $build_type $build_nfc
1513
Set-Location installer
1614
if($with_profile) {
17-
.\conan-imports.ps1 -with_profile -build_nfc $build_nfc -build_unittest $build_unittest
15+
.\conan-imports.ps1 -with_profile -build_nfc $build_nfc
1816
} else {
19-
.\conan-imports.ps1 -arch $arch -build_type $build_type -build_nfc $build_nfc -build_unittest $build_unittest
17+
.\conan-imports.ps1 -arch $arch -build_type $build_type -build_nfc $build_nfc
2018
}
2119
Set-Location ../sources/scripts
2220
pip install -r requirements.txt
@@ -25,9 +23,9 @@ Set-Location ../../
2523
.\sources/scripts/generate-swig.ps1
2624
Set-Location sources/LibLogicalAccessNet.native
2725
if($with_profile) {
28-
.\conan-build.ps1 -with_profile -build_nfc $build_nfc -build_unittest $build_unittest
26+
.\conan-build.ps1 -with_profile -build_nfc $build_nfc
2927
} else {
30-
./conan-build.ps1 -arch $arch -build_type $build_type -build_nfc $build_nfc -build_unittest $build_unittest
28+
./conan-build.ps1 -arch $arch -build_type $build_type -build_nfc $build_nfc
3129
}
3230
Set-Location ..
3331

installer/conan-imports.ps1

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ Param(
66
[Parameter(ParameterSetName="WithoutProfile", Mandatory)]
77
[string]$build_type,
88
[Parameter(Mandatory=$false)]
9-
[bool]$build_nfc,
10-
[Parameter(Mandatory=$false)]
11-
[bool]$build_unittest
9+
[bool]$build_nfc
1210
)
1311

1412
if($with_profile) {
15-
conan install -pr compilers/x64_msvc_debug -o LLA_BUILD_NFC=$build_nfc -o LLA_BUILD_UNITTEST=$build_unittest -u .
16-
conan install -pr compilers/x64_msvc_release -o LLA_BUILD_NFC=$build_nfc -o LLA_BUILD_UNITTEST=$build_unittest -u .
17-
conan install -pr compilers/x86_msvc_debug -o LLA_BUILD_NFC=$build_nfc -o LLA_BUILD_UNITTEST=$build_unittest -u .
18-
conan install -pr compilers/x86_msvc_release -o LLA_BUILD_NFC=$build_nfc -o LLA_BUILD_UNITTEST=$build_unittest -u .
13+
conan install -pr compilers/x64_msvc_debug -u -o LLA_BUILD_NFC=$build_nfc .
14+
conan install -pr compilers/x64_msvc_release -u -o LLA_BUILD_NFC=$build_nfc .
15+
conan install -pr compilers/x86_msvc_debug -u -o LLA_BUILD_NFC=$build_nfc .
16+
conan install -pr compilers/x86_msvc_release -u -o LLA_BUILD_NFC=$build_nfc .
1917
} else {
20-
conan install -s arch=$arch -s build_type=$build_type -o LLA_BUILD_NFC=$build_nfc -o LLA_BUILD_UNITTEST=$build_unittest --build=missing -u .
18+
conan install -s arch=$arch -s build_type=$build_type -u -o LLA_BUILD_NFC=$build_nfc --build=missing .
2119
}

installer/conanfile.py

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,27 @@
1-
from conans import ConanFile, tools
2-
from conans.errors import ConanException
1+
from conan import ConanFile
2+
from conan.errors import ConanException
3+
from conan.tools.files import copy
34
import os
45

56
class LogicalAccessSwigConan(ConanFile):
6-
name = "LogicalAccessSwig"
7+
name = "logicalaccess-swig"
78
version = "3.2.0"
89
settings = "build_type", "arch", "os"
9-
options = { 'LLA_BUILD_NFC': [True, False],
10-
'LLA_BUILD_UNITTEST': [True, False]}
11-
default_options = 'LogicalAccess:LLA_BUILD_PKCS=True', 'LLA_BUILD_NFC=False', 'LLA_BUILD_UNITTEST=False'
10+
options = { 'LLA_BUILD_NFC': [True, False] }
11+
default_options = { 'logicalaccess/*:LLA_BUILD_PKCS': True, 'LLA_BUILD_NFC': False }
1212
revision_mode = "scm"
1313

14-
def configure(self):
15-
self.options['LogicalAccess'].LLA_BUILD_UNITTEST = self.options.LLA_BUILD_UNITTEST
16-
1714
def requirements(self):
1815
if self.options.LLA_BUILD_NFC:
19-
self.requires('LogicalAccessNFC/' + self.version)
16+
self.requires('logicalaccess-nfc/' + self.version)
2017
else:
21-
self.requires('LogicalAccess/' + self.version)
18+
self.requires('logicalaccess/' + self.version)
2219

23-
def imports(self):
24-
self.copy("bin/*.dll", keep_path=False, dst="./packages/dll/" + str(self.settings.arch) + "/" + str(self.settings.build_type))
25-
self.copy("bin/*.exe", keep_path=False, dst="./packages/dll/" + str(self.settings.arch) + "/" + str(self.settings.build_type))
26-
self.copy("lib/*.lib", keep_path=False, dst="./packages/lib/" + str(self.settings.arch) + "/" + str(self.settings.build_type))
27-
28-
self.copy("lib/*.so*", keep_path=False, dst="./packages/dll/")
29-
30-
if not os.path.exists("./packages/include"):
31-
self.copy("include/*.*", dst="./packages")
20+
def generate(self):
21+
for dep in self.dependencies.values():
22+
copy(self, "*.dll", dep.cpp_info.bindirs[0], "./packages/dll/" + str(self.settings.arch) + "/" + str(self.settings.build_type))
23+
copy(self, "*.exe", dep.cpp_info.bindirs[0], "./packages/dll/" + str(self.settings.arch) + "/" + str(self.settings.build_type))
24+
copy(self, "*.lib", dep.cpp_info.libdirs[0], "./packages/lib/" + str(self.settings.arch) + "/" + str(self.settings.build_type))
25+
copy(self, "*.so", dep.cpp_info.bindirs[0], "./packages/dll/")
26+
if not os.path.exists("./packages/include"):
27+
copy(self, "*.*", dep.cpp_info.includedirs[0], "./packages/include")

sources/LibLogicalAccessNet.native/CMakeLists.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ project(LibLogicalAccessNetNative)
22

33
set(CMAKE_SUPPRESS_REGENERATION true)
44
MESSAGE(STATUS "DIR: ${CMAKE_BINARY_DIR}")
5-
include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake)
6-
conan_basic_setup(TARGETS)
5+
6+
if(LLA_BUILD_NFC)
7+
find_package(logicalaccess-nfc)
8+
endif()
9+
find_package(logicalaccess)
10+
find_package(nlohmann_json)
711

812
set(LLA_SWIG_SOURCES liblogicalaccess_reader_wrap.cxx
913
liblogicalaccess_card_wrap.cxx
@@ -30,9 +34,9 @@ endif()
3034
set(LLA_LINK)
3135
if(LLA_BUILD_NFC)
3236
add_compile_definitions(BUILD_NFC)
33-
list(APPEND LLA_LINK CONAN_PKG::LogicalAccessNFC)
37+
list(APPEND LLA_LINK logicalaccess-nfc::logicalaccess-nfc)
3438
else()
35-
list(APPEND LLA_LINK CONAN_PKG::LogicalAccess)
39+
list(APPEND LLA_LINK logicalaccess::logicalaccess)
3640
endif()
3741

3842
target_link_libraries(${TARGET_NAME} PUBLIC

sources/LibLogicalAccessNet.native/conan-build.ps1

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ Param(
88
[string]$build_type,
99
[Parameter(Mandatory=$false)]
1010
[bool]$build_nfc,
11-
[Parameter(Mandatory=$false)]
12-
[bool]$build_unittest,
1311
[Parameter(Mandatory=$false)]
1412
[switch]$publish
1513
)
@@ -35,7 +33,7 @@ if($with_profile) {
3533

3634
Set-Location build
3735

38-
$PackageName = "LogicalAccessSwig/3.2.0@lla/master"
36+
$PackageName = "logicalaccess-swig/3.2.0@lla/master"
3937
$Profiles = @(("compilers/x64_msvc_release", "Release", "x86_64"),
4038
("compilers/x86_msvc_release", "Release", "x86"),
4139
("compilers/x86_msvc_debug", "Debug", "x86"),
@@ -45,7 +43,7 @@ $env:ASSEMBLYAPPENDER = 'CE'
4543

4644
if($with_profile) {
4745
foreach ($Profile in $Profiles) {
48-
ExecExternal { conan install -pr $Profile[0] -o LLA_BUILD_NFC=$build_nfc -o LLA_BUILD_UNITTEST=$build_unittest --build=missing .. }
46+
ExecExternal { conan install -pr $Profile[0] -o LLA_BUILD_NFC=$build_nfc --build=missing .. }
4947
ExecExternal { conan build .. }
5048
$config = $Profile[1]
5149
$arch = $Profile[2]
@@ -57,7 +55,7 @@ if($with_profile) {
5755
Remove-Item * -Recurse -Force
5856
}
5957
} else {
60-
ExecExternal { conan install -s arch=$arch -s build_type=$build_type -o LLA_BUILD_NFC=$build_nfc -o LLA_BUILD_UNITTEST=$build_unittest --build=missing .. }
58+
ExecExternal { conan install -s arch=$arch -s build_type=$build_type -o LLA_BUILD_NFC=$build_nfc --build=missing .. }
6159
ExecExternal { conan build .. }
6260
Copy-Item bin/LibLogicalAccessNet.native.* ../bin/$arch/$build_type/
6361
if ($publish) {
Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,54 @@
1-
from conans import ConanFile, CMake, tools
2-
from conans.errors import ConanException
1+
from conan import ConanFile
2+
from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout
3+
from conan.errors import ConanException
4+
from conan.tools.files import copy
35
import os
46

57
class LLASwig(ConanFile):
6-
name = "LogicalAccessSwig"
8+
name = "logicalaccess-swig"
79
version = "3.2.0"
810
license = "LGPL"
911
url = "https://github.com/liblogicalaccess/liblogicalaccess-swig"
1012
description = "SWIG wrapper for LibLogicalAccess"
1113
settings = "os", "compiler", "build_type", "arch"
12-
options = { 'LLA_BUILD_NFC': [True, False],
13-
'LLA_BUILD_UNITTEST': [True, False]}
14-
default_options = 'LogicalAccess:LLA_BUILD_PKCS=True', 'LLA_BUILD_NFC=False', 'LLA_BUILD_UNITTEST=False'
15-
generators = "cmake"
14+
options = { 'LLA_BUILD_NFC': [True, False] }
15+
default_options = { 'logicalaccess/*:LLA_BUILD_PKCS': True, 'LLA_BUILD_NFC': False }
1616
revision_mode = "scm"
1717

1818
def requirements(self):
1919
if self.options.LLA_BUILD_NFC:
20-
self.requires('LogicalAccessNFC/' + self.version)
20+
self.requires('logicalaccess-nfc/' + self.version)
2121
else:
22-
self.requires('LogicalAccess/'+ self.version)
23-
24-
def configure(self):
25-
self.options['LogicalAccess'].LLA_BUILD_UNITTEST = self.options.LLA_BUILD_UNITTEST
26-
27-
def configure_cmake(self):
28-
cmake = CMake(self, build_type=self.settings.build_type)
22+
self.requires('logicalaccess/'+ self.version)
23+
self.requires('nlohmann_json/3.11.3') # shoulnd't be required
24+
25+
def layout(self):
26+
cmake_layout(self)
27+
28+
def generate(self):
29+
for dep in self.dependencies.values():
30+
if len(dep.cpp_info.bindirs) > 0:
31+
copy(self, "*.so", dep.cpp_info.bindirs[0], "lib")
32+
33+
tc = CMakeToolchain(self)
2934
if self.options.LLA_BUILD_NFC:
30-
cmake.definitions['LLA_BUILD_NFC'] = True
35+
tc.variables['LLA_BUILD_NFC'] = True
3136
else:
32-
cmake.definitions['LLA_BUILD_NFC'] = False
33-
cmake.configure()
34-
return cmake
37+
tc.variables['LLA_BUILD_NFC'] = False
38+
39+
tc.generate()
40+
41+
deps = CMakeDeps(self)
42+
deps.generate()
3543

3644
def build(self):
37-
cmake = self.configure_cmake()
45+
cmake = CMake(self)
46+
cmake.configure()
3847
cmake.build()
3948

4049
def package(self):
41-
cmake = self.configure_cmake()
50+
cmake = CMake(self)
4251
cmake.install()
43-
44-
def imports(self):
45-
self.copy("*.so*", "lib", "lib")
4652

4753
def package_info(self):
4854
pass

sources/LibLogicalAccessNet.native/liblogicalaccess_card.i

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@
6464
#include <logicalaccess/plugins/readers/iso7816/commands/samav1iso7816commands.hpp>
6565
#include <logicalaccess/plugins/cards/samav/samav2commands.hpp>
6666
#include <logicalaccess/plugins/readers/iso7816/commands/samav2iso7816commands.hpp>
67-
#include <logicalaccess/plugins/cards/samav/samav3commands.hpp>
68-
#include <logicalaccess/plugins/readers/iso7816/commands/samav3iso7816commands.hpp>
6967
#include <logicalaccess/plugins/cards/desfire/desfireev2crypto.hpp>
7068
#include <logicalaccess/plugins/cards/desfire/desfireev3commands.hpp>
7169
#include <logicalaccess/plugins/cards/desfire/desfireev3chip.hpp>
@@ -161,6 +159,7 @@
161159
#include <logicalaccess/plugins/cards/samav/samav1chip.hpp>
162160
#include <logicalaccess/plugins/cards/samav/samav2chip.hpp>
163161
#include <logicalaccess/plugins/cards/samav/samav3chip.hpp>
162+
#include <logicalaccess/plugins/cards/samav/samav3commands.hpp>
164163
#include <logicalaccess/plugins/cards/seos/lla_cards_seos_api.hpp>
165164
#include <logicalaccess/plugins/cards/seos/seoscommands.hpp>
166165
#include <logicalaccess/plugins/cards/seos/seoschip.hpp>
@@ -349,8 +348,6 @@ using LibLogicalAccess.Reader;
349348
%import <logicalaccess/plugins/readers/iso7816/commands/samav1iso7816commands.hpp>
350349
%include <logicalaccess/plugins/cards/samav/samav2commands.hpp>
351350
%import <logicalaccess/plugins/readers/iso7816/commands/samav2iso7816commands.hpp>
352-
%include <logicalaccess/plugins/cards/samav/samav3commands.hpp>
353-
%import <logicalaccess/plugins/readers/iso7816/commands/samav3iso7816commands.hpp>
354351
%include <logicalaccess/plugins/cards/desfire/desfireev2crypto.hpp>
355352
%include <logicalaccess/plugins/cards/desfire/desfireev3commands.hpp>
356353
%include <logicalaccess/plugins/cards/desfire/desfireev3chip.hpp>
@@ -446,6 +443,7 @@ using LibLogicalAccess.Reader;
446443
%include <logicalaccess/plugins/cards/samav/samav1chip.hpp>
447444
%include <logicalaccess/plugins/cards/samav/samav2chip.hpp>
448445
%include <logicalaccess/plugins/cards/samav/samav3chip.hpp>
446+
%include <logicalaccess/plugins/cards/samav/samav3commands.hpp>
449447
%include <logicalaccess/plugins/cards/seos/lla_cards_seos_api.hpp>
450448
%include <logicalaccess/plugins/cards/seos/seoscommands.hpp>
451449
%include <logicalaccess/plugins/cards/seos/seoschip.hpp>

sources/LibLogicalAccessNet/LibLogicalAccessNet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<RootNamespace>LibLogicalAccess</RootNamespace>
66
<Description>LibLogicalAccess RFID library layer for C#</Description>
77
<Copyright>Copyright (C) LibLogicalAccess 2025</Copyright>
8-
<Version>3.2.0-3</Version>
8+
<Version>3.2.0-6</Version>
99
<AssemblyVersion>3.2.0.0</AssemblyVersion>
1010
<FileVersion>3.2.0.0</FileVersion>
1111
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>

0 commit comments

Comments
 (0)