Skip to content

Commit ee7e54b

Browse files
committed
Update robotpy-xrp to semiwrap
1 parent 23cebdd commit ee7e54b

File tree

15 files changed

+86
-76
lines changed

15 files changed

+86
-76
lines changed

subprojects/robotpy-xrp/.gitignore

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
*.egg-info
55

66
/build
7+
/dist
78

8-
/xrp/include
9-
/xrp/lib
10-
/xrp/_init_xrp.py
9+
/xrp/_init__xrp.py
1110
/xrp/pkgcfg.py
1211
/xrp/version.py
13-
/xrp/extension/_init_xrp_ext.py
14-
/xrp/extension/include
15-
/xrp/extension/pkgcfg.py
12+
/xrp/extension/lib
13+
/xrp/trampolines

subprojects/robotpy-xrp/meson.build

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
project('robotpy-xrp', ['cpp'],
2+
default_options: ['warning_level=1', 'cpp_std=c++20',
3+
'b_colorout=auto', 'optimization=2', 'b_pie=true'])
4+
5+
subdir('semiwrap')
6+
7+
xrp_sources += files(
8+
'xrp/src/main.cpp',
9+
)
10+
11+
subdir('semiwrap/modules')
Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
[tool.robotpy-build.metadata]
1+
[build-system]
2+
build-backend = "hatchling.build"
3+
requires = [
4+
"semiwrap~=0.1",
5+
"hatch-meson~=0.1.0b2",
6+
"hatch-robotpy~=0.2",
7+
"hatchling",
8+
"robotpy-native-xrp==2025.3.2",
9+
"wpilib==2025.3.2.2",
10+
]
11+
12+
13+
[project]
214
name = "robotpy-xrp"
15+
version = "2025.3.2.2"
316
description = "Binary wrapper for WPILib XRP Vendor library"
4-
author = "RobotPy Development Team"
5-
author_email = "[email protected]"
6-
url = "https://github.com/robotpy/mostrobotpy"
17+
authors = [
18+
{name = "RobotPy Development Team", email = "[email protected]"},
19+
]
720
license = "BSD-3-Clause"
8-
install_requires = [
9-
"wpilib==THIS_VERSION"
21+
dependencies = [
22+
"wpilib==2025.3.2.2"
1023
]
1124

12-
[tool.robotpy-build.metadata.entry_points]
13-
robotpysimext = [
14-
"xrp = xrp.extension",
15-
]
25+
[project.entry-points.robotpysimext]
26+
xrp = "xrp.extension"
1627

17-
[build-system]
18-
requires = [
19-
"robotpy-build~=2025.1.0",
20-
"wpilib~=2025.3.2"
21-
]
2228

23-
[tool.robotpy-build]
24-
base_package = "xrp"
29+
[tool.hatch.build.hooks.robotpy]
30+
version_file = "xrp/version.py"
31+
32+
[[tool.hatch.build.hooks.robotpy.maven_lib_download]]
33+
artifact_id = "halsim_xrp"
34+
group_id = "edu.wpi.first.halsim"
35+
repo_url = "https://frcmaven.wpi.edu/artifactory/release"
36+
version = "2025.3.2"
37+
use_headers = false
38+
39+
extract_to = "xrp/extension"
40+
libs = ["halsim_xrp"]
41+
42+
[tool.hatch.build.hooks.semiwrap]
2543

26-
[tool.robotpy-build.wrappers."xrp"]
44+
[tool.hatch.build.hooks.meson]
45+
46+
[tool.hatch.build.targets.wheel]
47+
packages = ["xrp"]
48+
49+
50+
[tool.semiwrap]
51+
update_init = ["xrp"]
52+
53+
[tool.semiwrap.extension_modules."xrp._xrp"]
2754
name = "xrp"
28-
sources = ["xrp/src/main.cpp"]
29-
generation_data = "gen"
30-
depends = [
31-
"wpilib_core", "wpilibc_interfaces", "wpilibc",
32-
"wpimath_cpp", "wpimath_geometry",
33-
"wpiHal", "wpiutil", "ntcore",
34-
]
55+
wraps = ["robotpy-native-xrp"]
56+
depends = ["wpilib", "wpimath_geometry"]
3557

36-
[tool.robotpy-build.wrappers."xrp".autogen_headers]
58+
[tool.semiwrap.extension_modules."xrp._xrp".headers]
3759
# frc/xrp
3860
XRPGyro = "frc/xrp/XRPGyro.h"
3961
XRPMotor = "frc/xrp/XRPMotor.h"
4062
XRPOnBoardIO = "frc/xrp/XRPOnBoardIO.h"
4163
XRPRangefinder = "frc/xrp/XRPRangefinder.h"
4264
XRPReflectanceSensor = "frc/xrp/XRPReflectanceSensor.h"
4365
XRPServo = "frc/xrp/XRPServo.h"
44-
45-
46-
[tool.robotpy-build.wrappers."xrp".maven_lib_download]
47-
artifact_id = "xrpVendordep-cpp"
48-
group_id = "edu.wpi.first.xrpVendordep"
49-
# repo_url = "https://frcmaven.wpi.edu/artifactory/release"
50-
repo_url = "https://frcmaven.wpi.edu/artifactory/release"
51-
version = "2025.3.2"
52-
libs = ["xrpVendordep"]
53-
54-
[tool.robotpy-build.wrappers."xrp.extension".maven_lib_download]
55-
artifact_id = "halsim_xrp"
56-
group_id = "edu.wpi.first.halsim"
57-
# repo_url = "https://frcmaven.wpi.edu/artifactory/release"
58-
repo_url = "https://frcmaven.wpi.edu/artifactory/release"
59-
version = "2025.3.2"
60-
61-
dlopenlibs = ["halsim_xrp"]
62-
63-
[tool.robotpy-build.wrappers."xrp.extension"]
64-
name = "xrp_ext"
65-
depends = ["wpiHal", "wpinet"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/meson.build
2+
/modules/meson.build
3+
/trampolines/meson.build

subprojects/robotpy-xrp/gen/XRPGyro.yml renamed to subprojects/robotpy-xrp/semiwrap/XRPGyro.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
---
21

32
classes:
4-
XRPGyro:
3+
frc::XRPGyro:
54
methods:
65
XRPGyro:
76
GetAngle:

subprojects/robotpy-xrp/gen/XRPMotor.yml renamed to subprojects/robotpy-xrp/semiwrap/XRPMotor.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
---
21

32
classes:
4-
XRPMotor:
3+
frc::XRPMotor:
54
methods:
65
XRPMotor:
76
Set:

subprojects/robotpy-xrp/gen/XRPOnBoardIO.yml renamed to subprojects/robotpy-xrp/semiwrap/XRPOnBoardIO.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
---
21

32
classes:
4-
XRPOnBoardIO:
3+
frc::XRPOnBoardIO:
54
attributes:
65
kMessageInterval:
76
m_nextMessageTime:
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
---
21

32
classes:
4-
XRPRangefinder:
3+
frc::XRPRangefinder:
54
methods:
65
GetDistance:
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
---
21

32
classes:
4-
XRPReflectanceSensor:
3+
frc::XRPReflectanceSensor:
54
methods:
65
GetLeftReflectanceValue:
76
GetRightReflectanceValue:

subprojects/robotpy-xrp/gen/XRPServo.yml renamed to subprojects/robotpy-xrp/semiwrap/XRPServo.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
---
21

32
classes:
4-
XRPServo:
3+
frc::XRPServo:
54
methods:
65
XRPServo:
76
SetAngle:

0 commit comments

Comments
 (0)