Skip to content

Commit

Permalink
Adding release conan recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
agosh01 committed Jul 11, 2024
1 parent 5f0ec00 commit 6789f81
Show file tree
Hide file tree
Showing 6 changed files with 244 additions and 0 deletions.
7 changes: 7 additions & 0 deletions up-core-api/release/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
1.6.0:
sources:
url: "https://github.com/eclipse-uprotocol/up-spec/archive/refs/tags/v1.6.0-alpha.2.tar.gz"
sha256: "f0159c57d33aa3d148b5032d5f7f079e7eadc9588723a1ac581808b39e85ffdd"
requirements:
protobuf: "3.21.12"

71 changes: 71 additions & 0 deletions up-core-api/release/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
from conan.tools.scm import Git
from conan.tools.files import copy, get
import os
import yaml

class upCoreApiRecipe(ConanFile):
name = "up-core-api"

# Optional metadata
license = "Apache-2.0"
author = "Contributors to the Eclipse Foundation <uprotocol-dev@eclipse.org>"
url = "https://github.com/eclipse-uprotocol/up-spec"
description = "Provides the uProtocol data model and core services definitions compiled for C++ from source proto files"
topics = ("automotive", "iot", "uprotocol", "messaging")

# Binary configuration
settings = "os", "compiler", "build_type", "arch"
options = {
"shared": [True, False],
"fPIC": [True, False],
}

default_options = {
"shared": False,
"fPIC": True,
}

def requirements(self):
version_data = self.conan_data[self.version]
if "requirements" in version_data:
for requirement, version in version_data["requirements"].items():
self.requires(f"{requirement}/{version}")
else:
self.output.warning("No requirements specified in conandata.yml. Please check your configuration.")


# We are providing our own cmake config since one is not included in the
# spec repo.
def export_sources(self):
copy(self, "CMakeLists.txt",
self.recipe_folder + "/..", self.export_sources_folder)

def source(self):
get(self, **self.conan_data[self.version]["sources"], strip_root=True)

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def layout(self):
cmake_layout(self)

def generate(self):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)
tc.generate()

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def package(self):
cmake = CMake(self)
cmake.install()

def package_info(self):
self.cpp_info.libs = ["up-core-api"]
10 changes: 10 additions & 0 deletions up-cpp/release/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
1.0.0-rc0:
sources:
url: "https://github.com/eclipse-uprotocol/up-cpp/archive/337b4f4b4193fece4d7067ef754b41ea323e1f96.tar.gz"
sha256: "f65fd40e3ba8914e70d3a4a9e5426b646ad6299c94841ff42a918fe75513e128"
requirements:
protobuf: "[>=3.21.12]"
up-core-api: "1.6.0"
spdlog: "1.13.0"


73 changes: 73 additions & 0 deletions up-cpp/release/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
from conan.tools.scm import Git
from conan.tools.files import copy, get
import os
import yaml

class upCoreApiRecipe(ConanFile):
name = "up-cpp"

# Optional metadata
license = "Apache-2.0"
author = "Contributors to the Eclipse Foundation <uprotocol-dev@eclipse.org>"
url = "https://github.com/eclipse-uprotocol/up-transport-zenoh-cpp"
description = "This library provides a Zenoh-based uProtocol transport for C++ uEntities"
topics = ("automotive", "iot", "uprotocol", "messaging")

# Binary configuration
settings = "os", "compiler", "build_type", "arch"
options = {
"shared": [True, False],
"fPIC": [True, False],
}

default_options = {
"shared": False,
"fPIC": True,
}

test_requires = "gtest/1.14.0"

def requirements(self):
version_data = self.conan_data[self.version]
if "requirements" in version_data:
for requirement, version in version_data["requirements"].items():
self.requires(f"{requirement}/{version}")
else:
self.output.warning("No requirements specified in conandata.yml. Please check your configuration.")


# We are providing our own cmake config since one is not included in the
# spec repo.
def export_sources(self):
copy(self, "CMakeLists.txt",
self.recipe_folder + "/..", self.export_sources_folder)

def source(self):
get(self, **self.conan_data[self.version]["sources"], strip_root=True)

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def layout(self):
cmake_layout(self)

def generate(self):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)
tc.generate()

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def package(self):
cmake = CMake(self)
cmake.install()

def package_info(self):
self.cpp_info.libs = ["up-cpp"]
10 changes: 10 additions & 0 deletions up-transport-zenoh-cpp/release/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
1.0.0-rc0:
sources:
url: "https://github.com/eclipse-uprotocol/up-transport-zenoh-cpp/archive/fb8581df5e6acdb2e65c3a557eca49b55b8266e6.tar.gz"
sha256: "c6c7c962e5d9714cdf9358bea84a80ca894a2176ce67965867d377206c57fa82"
requirements:
zenohcpp: "0.11.0"
up-cpp: "1.0.0-rc0"
up-core-api: "[>=1.5.8]"
spdlog: "[>=1.13.0]"
protobuf: "[>=3.21.12]"
73 changes: 73 additions & 0 deletions up-transport-zenoh-cpp/release/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
from conan.tools.scm import Git
from conan.tools.files import copy, get
import os
import yaml

class upZenohTransportRecipe(ConanFile):
name = "up-transport-zenoh-cpp"

# Optional metadata
license = "Apache-2.0"
author = "Contributors to the Eclipse Foundation <uprotocol-dev@eclipse.org>"
url = "https://github.com/eclipse-uprotocol/up-transport-zenoh-cpp"
description = "This library provides a Zenoh-based uProtocol transport for C++ uEntities"
topics = ("automotive", "iot", "uprotocol", "messaging")

# Binary configuration
settings = "os", "compiler", "build_type", "arch"
options = {
"shared": [True, False],
"fPIC": [True, False],
}

default_options = {
"shared": False,
"fPIC": True,
}

test_requires = "gtest/1.14.0"

def requirements(self):
version_data = self.conan_data[self.version]
if "requirements" in version_data:
for requirement, version in version_data["requirements"].items():
self.requires(f"{requirement}/{version}")
else:
self.output.warning("No requirements specified in conandata.yml. Please check your configuration.")


# We are providing our own cmake config since one is not included in the
# spec repo.
def export_sources(self):
copy(self, "CMakeLists.txt",
self.recipe_folder + "/..", self.export_sources_folder)

def source(self):
get(self, **self.conan_data[self.version]["sources"], strip_root=True)

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def layout(self):
cmake_layout(self)

def generate(self):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)
tc.generate()

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def package(self):
cmake = CMake(self)
cmake.install()

def package_info(self):
self.cpp_info.libs = ["up-transport-zenoh-cpp"]

0 comments on commit 6789f81

Please sign in to comment.