ููุฏ ู
ุฑ ุฃูุซุฑ ู
ู ุนุงู
ููุตู ู
ูุฐ ูุดุฑ ุงูุฌุฒุก ุงูุณุงุจู ุ ูุชู
ุชูููุฐ ู
ุฌู
ูุนุฉ ูุจูุฑุฉ ู
ู ุงูู
ูุฒุงุช ุ ูุชู
ุฅุตุฏุงุฑ ุงูุนุฏูุฏ ู
ู ุงูุฅุตุฏุงุฑุงุช ุ ูููู ูู ูุชู
ู
ูุงูุดุฉ ุฐูู. ุญุฏุซ ุญุฏุซ ู
ูู
ูุจู ููู
ูู ูู ุญูุงุฉ ุงูู
ูุชุจุฉ: ุชู
ุช ุฅุถุงูุชู ุฅูู ู
ุณุชูุฏุน ูููุงู ุงูุฑุฆูุณู (ููุฑุณ ู
ุฑูุฒ ูููุงู). ุญูู ููููุฉ ุญุฏูุซ ุฐูู ุ ู
ุง ุงูุฐู ูุฌุจ ุงูููุงู
ุจู ููุฐุง ุ ูู
ุง ูุฌุจ ุงูููุงู
ุจู ุจุดูู ุนุงู
ูุฅุถุงูุฉ ู
ูุชุจุชู ููุงู ุ ูุณูุชุญุฏุซ ุชุญุช ุงูุฎูุถ.
JFrog ูุจุฐููู ูุตุงุฑู ุฌูุฏูู
ุจุงุฏุฆ ุฐู ุจุฏุก ุ ุจุถุน ููู
ุงุช ุญูู ู
ุง ูู ูููุงู (ููุนุฑู ุฃูุถูุง ุจุงุณู
ูููุงู ุ ููุนุฑู ุฃูุถูุง ุจุงุณู
conan.io) ูู
ุคุดุฑ ู
ุฑูุฒ ูููุงู. ูููุงู ูู ู
ุฏูุฑ ุญุฒู
ุฉ ูุงุนุชู
ุงุฏ ุนูู C ++ (ุขุฎุฑ ุ ูููู ุดุนุจูุชู ุชูู
ู ุจุณุฑุนุฉ). ู
ู ุงูุณูู ุฌุฏูุง ุงูุชุซุจูุช ูุงูุชููุฆุฉ ูููุง ุงูุนุฏูุฏ ู
ู ุงูู
ุฒุงูุง ุงูุชู ูุง ุดู ูููุง:
- ูุง ูุฑุชุจุท ุจุฃู ูุธุงู
ุจูุงุก ู
ุนูู ุฃู ู
ุชุฑุฌู
ุฃู ูุธุงู
ุชุดุบูู ุ
- ูู
ูู ุงุณุชุฎุฏุงู
ูุธุงู
ุงูู
ุณุชูุฏุนุงุช ุงูู
ูุฒุนุฉ ุ
- ูุณู
ุญ ูู ุงุณุชุฎุฏุงู
ุงูู
ุตููุนุงุช ุงููุฏููุฉ ุจูุดุฑ ู
ุณุชูุฏุนุงุช ุงูู
ุดุฑูุน / ุงููุฑูู ุงูู
ุญููุฉ (ุงูุฎุงุตุฉ) ุ
- ูุฏุนู
ุชูุตูู ุงูุชุจุนูุงุช ูู ุดูู ุซูุงุฆู (ุชู
ุชุฌู
ูุนูุง ุจุงููุนู) ูุชุฌู
ูุนูุง ู
ุญูููุง ู
ู ุงูู
ุตุฏุฑ ูู
ูู ุชุนุฑูู ู
ุญุฏุฏ ุ
- ู
ู ุงูุณูู ูุณุจูุง ุชูููู ูุงุณุชุฎุฏุงู
.
ูู ุงููุงูุน ุ ู
ุน ูููุงู ุ ูู
ููู ุจุจุณุงุทุฉ ุณุฑุฏ ุงูุชุจุนูุงุช ุงูุชู ูุชุทูุจูุง ู
ุดุฑูุนู ุ ุซู
ููุนู ูู ุดูุก ุจููุณู. ูุดุฑูุทุฉ ุฃู ูุชู
ุชุญุฏูุฏ ุฌู
ูุน ุงูุฅุนุฏุงุฏุงุช (ู
ูู ุชุนุฑูู conan) ููู
ุดุฑูุน ุจุดูู ุตุญูุญ ุ ูุฅูู ุชุฐูุจ ู
ุน ุงูู
ูุชุจุงุช ุบูุฑ ุงูู
ุญู
ูุฉ ูุงูู
ุชุฑุฌู
ุฉ ูุงูู
ููููุฉ. ุณุญุฑ! ูููู ููุฐุง ุ ูุฌุจ ุฃู ุชููู ุจูุงุก ุงูู
ูุชุจุฉ ููุตูุงุช ุจูุงุกูู
ูู ุงูู
ููุน ูู ู
ูุงู ู
ุง. ูู ู
ูุงู ู
ุง ุญูุซ ูู
ููู ุงูุนุซูุฑ ุนูููุง. ู
ู ุงููุงุถุญ ุฃููู
ูู ุงูู
ุณุชูุฏุนุงุช. ู
ุฌู
ูุนุฉ ุฑุณู
ูุฉ ูุงุญุฏุฉ ููุง ููุงุฆูุฉ ู
ู ุงูุดุฎุตูุฉ (ุฃู ุงููุฑูู).
, . bincrafters โ , . bincrafters ( ) : .
, conan.io conan-center-index. โ -, . (, โ ) pull request . โ ( , ) . : jinja2cpp/1.1.0
Nothing to do all day but stay in bed
- , conan.io , , , . . , , โ , conan-, . . , bincrafters : https://github.com/bincrafters/templates.
, . , bintray ( ) โ . : 130. conan-index ( ) 130 . , Jinja2C++. :
- (Windows/Linux)
- (x86/x64)
- ( MSVC โ , gcc โ ABI )
- (debug/release)
- (shared/static)
, , , CI . appveyor, travis, Github Actions , โ -, , . ? ? ? โฆ .
Errors flying over your head
โ1: , , ( ) โ , .
โ2: , , .
โ3: , -, .

, . , , CI , : "Debug CI build", CI .
, . , - , . โ . , . , , ( conan-index bincrafters). , , , , , . , - ( ), . - , issue.
: Jinja2C++ GitHub Actions 30- Linux, 48- Windows, 16 appveyor 5 . : conan-center-index .
If you want to survive, get out of bed!
, . ? :
- , . windows, linux, . CI . .
- (, . .) . conan index . .
- Early Access Programm conan index, . , . issue . : https://github.com/conan-io/conan-center-index/issues/4
- . . , - . , , , , , ( โ ). .
- conan-center-index. PR conan.io team.
conan-center-index , : https://github.com/conan-io/conan-center-index/wiki , , - .
You've got your orders better shoot on sight
, . github-, , . , Jinja2C++. โ . :
.
+-- recipes
| +-- jinja2cpp
| +-- config.yml
| +-- 1.1.0
| +-- CMakeLists.txt
| +-- conanfile.py
| +-- conandata.yml
| +-- test_package
| +-- CMakeLists.txt
| +-- conanfile.py
:
config.yml
โ , :
---
versions:
"1.1.0":
folder: 1.1.0
, , , all, config.yml โ ( โ ).
1.1.0
, . . . . (conanfile.py), (conandata.yml) test_package, โ . , , .
1.1.0/conanfile.py
. โ , .
1.1.0/conandata.yml
. , . . , master' . conan-center-index . :
sources:
"1.1.0":
url: https://github.com/jinja2cpp/Jinja2Cpp/archive/1.1.0.tar.gz
sha256: 3d321a144f3774702d3a6252e3a6370cdaff9c96d8761d850bb79cdb45b372c5
- .
1.1.0/CMakeFile.txt
, . , conan', CMake- :
cmake_minimum_required(VERSION 3.4.3)
project(cmake_wrapper)
include(conanbuildinfo.cmake)
conan_basic_setup()
unset (BUILD_SHARED_LIBS CACHE)
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE ${JINJA2CPP_CONAN_BUILD_TYPE})
endif ()
add_subdirectory(source_subfolder)
? cmake- (conanbuildinfo.cmake), , . , , , , PIC . ( ) CMake- , conan , . โ -. , - . โ , msbuild.exe.
1.1.0/test_package
. (conanfile.py) (CMakeLists.txt) (main.cpp), - . , "Hello World!".
1.1.0/test_package/conanfile.py
. , -. :
from conans import ConanFile, CMake, tools
import os
class Jinja2CppTestPackage(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "cmake", "cmake_find_package"
def build(self):
cmake = CMake(self)
compiler = self.settings.get_safe("compiler")
if compiler == 'Visual Studio':
runtime = self.settings.get_safe("compiler.runtime")
cmake.definitions["MSVC_RUNTIME_TYPE"] = '/' + runtime
cmake.configure()
cmake.build()
def test(self):
if not tools.cross_building(self.settings):
ext = ".exe" if self.settings.os == "Windows" else ""
bin_path = os.path.join("bin", "jinja2cpp-test-package" + ext)
self.run(bin_path, run_environment=True)
, . โ ( build
) ( test
). โ . , MSVC. โ . , . CMake โ cmake
cmake_find_package
. โ .
1.1.0/test_package/CMakeLists.txt
:
cmake_minimum_required(VERSION 2.8.0)
project(Jinja2CppTestPackage)
set(CMAKE_CXX_STANDARD 14)
include (${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
find_package(jinja2cpp REQUIRED)
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if (CMAKE_BUILD_TYPE MATCHES "Debug" AND MSVC_RUNTIME_TYPE)
set (MSVC_RUNTIME_TYPE "${MSVC_RUNTIME_TYPE}d")
endif ()
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${MSVC_RUNTIME_TYPE}")
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${MSVC_RUNTIME_TYPE}")
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${MSVC_RUNTIME_TYPE}")
set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/PROFILE")
message (STATUS "Build type: ${CMAKE_BUILD_TYPE}")
message (STATUS "USE MSVC RUNTIME: ${MSVC_RUNTIME_TYPE}")
endif()
add_executable(jinja2cpp-test-package main.cpp)
target_link_libraries(jinja2cpp-test-package PRIVATE jinja2cpp::jinja2cpp)
cmake
, , conanbuildinfo.cmake
, cmake_find_package
โ find', conan- . : โ case-sensitive, (, ) . .
, , , .
1.1.0/test_package/main.cpp
, , conan- :
#include <jinja2cpp/template.h>
#include <iostream>
int main()
{
std::string source = R"(
{{ ("Hello", 'world') | join }}!!!
{{ ("Hello", 'world') | join(', ') }}!!!
{{ ("Hello", 'world') | join(d = '; ') }}!!!
{{ ("Hello", 'world') | join(d = '; ') | lower }}!!!)";
jinja2::Template tpl;
tpl.Load(source);
std::string result = tpl.RenderAsString(jinja2::ValuesMap()).value();
std::cout << result << "\n";
}
! smoke-, . โ "!", !
Your finger's on the keyboard
, . , , . โ -, PEP8. โ , , , . :
import os
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
class Jinja2cppConan(ConanFile):
def config_options(self):
def configure(self):
def source(self):
def build(self):
def package(self):
def package_info(self):
conan. :
- config_options โ
- configure โ
- source โ
- build โ
- package โ ( install, )
- package_info โ ,
, . Jinja2C++, CMake-, .
name = "jinja2cpp"
license = "MIT"
homepage = "https://jinja2cpp.dev/"
url = "https://github.com/conan-io/conan-center-index"
description = "Jinja2 C++ (and for C++) almost full-conformance template engine implementation"
topics = ("conan", "cpp14", "cpp17", "jinja2", "string templates", "templates engine")
exports_sources = ["CMakeLists.txt"]
generators = "cmake", "cmake_find_package"
settings = "os", "compiler", "build_type", "arch"
options = {
"shared": [True, False], "fPIC": [True, False]
}
default_options = {'shared': False, "fPIC": True}
requires = (
"variant-lite/1.2.2",
"expected-lite/0.3.0",
"optional-lite/3.2.0",
"string-view-lite/1.3.0",
"boost/1.72.0",
"fmt/6.1.2",
"rapidjson/1.1.0"
)
_source_subfolder = "source_subfolder"
_build_subfolder = "build_subfolder"
_cpp_std = 14
(name
, license
, homepage
, url
, description
, topics
), (generators
, settings
, options
, default_options
), (requires
) , (_source_subfloder
, _build_subfolder
_cpp_std
).
, conan-center-index:
- , community, (
author
); url
conan-center-index;- โ
homepage
; - static, shared-. -fPIC. hook-;
- โ ( ), , conan-center-index.
config_options
, :
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
Windows fPIC โ . .
config
. , . .
def configure(self):
if self.options.shared:
del self.options.fPIC
cppstd = self.settings.get_safe("compiler.cppstd")
if cppstd:
cppstd_pattern = re.compile(r'^(gnu)?(?P<cppstd>\d+)$')
m = cppstd_pattern.match(cppstd)
cppstd_profile = int(m.group("cppstd"))
if cppstd_profile < 14:
raise ConanInvalidConfiguration("Minimum C++ Standard required is 14 (provided '{}')".format(cppstd))
else:
self._cpp_std = cppstd_profile
โ shared- fPIC , (14). - , . : ConanInvalidConfiguration
โ . , , .
source
:
def source(self):
tools.get(**self.conan_data["sources"][self.version])
extracted_dir = "Jinja2Cpp-" + self.version
os.rename(extracted_dir, self._source_subfolder)
"" .
build
. , . . CMake :
def build(self):
cmake = CMake(self)
cmake.definitions["JINJA2CPP_BUILD_TESTS"] = False
cmake.definitions["JINJA2CPP_STRICT_WARNINGS"] = False
cmake.definitions["JINJA2CPP_BUILD_SHARED"] = self.options.shared
cmake.definitions["JINJA2CPP_DEPS_MODE"] = "conan-build"
cmake.definitions["JINJA2CPP_CXX_STANDARD"] = self._cpp_std
cmake.definitions["JINJA2CPP_CONAN_BUILD_TYPE"] = self.settings.build_type
compiler = self.settings.get_safe("compiler")
if compiler == 'Visual Studio':
runtime = self.settings.get_safe("compiler.runtime")
if runtime == 'MTd':
runtime = 'MT'
if runtime == 'MDd':
runtime = 'MD'
cmake.definitions["JINJA2CPP_MSVC_RUNTIME_TYPE"] = '/' + runtime
cmake.configure(build_folder=self._build_subfolder)
cmake.build()
, , cmake' . CMake- , Jinja2C++, .
package
, . , :
def package(self):
self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include"))
self.copy("*.hpp", dst="include", src=os.path.join(self._source_subfolder, "include"))
self.copy("*.lib", dst="lib", keep_path=False)
self.copy("*.dll", dst="bin", keep_path=False)
self.copy("*.so", dst="lib", keep_path=False)
self.copy("*.so.*", dst="lib", keep_path=False)
self.copy("*.dylib", dst="lib", keep_path=False)
self.copy("*.a", dst="lib", keep_path=False)
โ install-. , โ . , , :
โ , , install'.
package_info
, : , , , . . , , . :
def package_info(self):
self.cpp_info.libs = ["jinja2cpp"]
. define' , .
The sergeant calls (stand up and fight!)
โ . . . , ( PR): . , :
> conan create . jinja2cpp/1.1.0@
( jinja2cpp/1.1.0 โ )
, . conan- . . . , , . โฆ .
, ( ) . Windows-, Linux-. Windows โ shared
. Linuxโฆ Linux โ . - -, conan . : https://hub.docker.com/u/conanio GitHub Actions.
:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=Visual Studio
compiler.runtime=MD
compiler.version=15
os=Windows
os_build=Windows
[options]
jinja2cpp:shared=False
[env]
[build_requires]
. :
> conan create . jinja2cpp/1.1.0@ -p profile_md.txt
profile_md.txt
โ .
: ( โ , , ) . , , . , pull request' conan-center-index . , , , . โ conan'. , , Visual Studio . , , .
You'll be the hero of the neighbourhood
, conan-center-index , , , , , . , , C++ . conan โ , , . , , , . , โ .
:
conan-center-index
Issue EAP
Jinja2C++
conan-center
ูู ูุต ุงูู
ูุงูุฉ ุ ุชู
ุงุณุชุฎุฏุงู
ุงูุณุทูุฑ ู
ู ุฃุบููุฉ "ุฃูุช ูู ุงูุฌูุด ุงูุขู" ู
ู ูุจู Status Quo ููุชุฑุฌู
ุงุช