Skip to content

Commit 0910444

Browse files
0xebclaude
andcommitted
feat: Improve build system resilience and multi-platform releases
- Auto-fetch idacpp into build folder if missing from IDASDK - Remove idax dependency (no longer needed) - Simplify CI workflow (remove manual idacpp cloning) - Add automatic zip packaging for releases containing all platforms - Update documentation with new prerequisites and CI/CD instructions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 48a6677 commit 0910444

File tree

4 files changed

+53
-23
lines changed

4 files changed

+53
-23
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ jobs:
3232
git clone --depth 1 https://github.com/HexRaysSA/ida-sdk ida-sdk
3333
mkdir -p "${IDASDK}"
3434
git clone --depth 1 https://github.com/allthingsida/ida-cmake "${IDASDK}/ida-cmake"
35-
mkdir -p "${IDASDK}/include"
36-
git clone --depth 1 https://github.com/allthingsida/idax "${IDASDK}/include/idax"
37-
git clone --depth 1 https://github.com/allthingsida/idacpp "${IDASDK}/include/idacpp"
3835
3936
- name: Configure (Linux)
4037
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
@@ -64,9 +61,6 @@ jobs:
6461
git clone --depth 1 https://github.com/HexRaysSA/ida-sdk ida-sdk
6562
mkdir -p "${IDASDK}"
6663
git clone --depth 1 https://github.com/allthingsida/ida-cmake "${IDASDK}/ida-cmake"
67-
mkdir -p "${IDASDK}/include"
68-
git clone --depth 1 https://github.com/allthingsida/idax "${IDASDK}/include/idax"
69-
git clone --depth 1 https://github.com/allthingsida/idacpp "${IDASDK}/include/idacpp"
7064
7165
- name: Configure (macOS)
7266
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
@@ -96,9 +90,6 @@ jobs:
9690
git clone --depth 1 https://github.com/HexRaysSA/ida-sdk ida-sdk
9791
mkdir -p "${IDASDK}"
9892
git clone --depth 1 https://github.com/allthingsida/ida-cmake "${IDASDK}/ida-cmake"
99-
mkdir -p "${IDASDK}/include"
100-
git clone --depth 1 https://github.com/allthingsida/idax "${IDASDK}/include/idax"
101-
git clone --depth 1 https://github.com/allthingsida/idacpp "${IDASDK}/include/idacpp"
10293
10394
- name: Configure (Windows)
10495
run: cmake -S . -B build -A x64
@@ -129,15 +120,22 @@ jobs:
129120
run: |
130121
ls -la release || true
131122
123+
- name: Create zip package
124+
run: |
125+
cd release
126+
zip -9 qscripts-${{ github.ref_name }}.zip qscripts.dll qscripts.so qscripts.dylib
127+
ls -lh *.zip
128+
132129
- name: Create GitHub Release and upload assets
133130
uses: softprops/action-gh-release@v2
134131
with:
135132
tag_name: ${{ github.ref_name }}
136-
name: ${{ github.ref_name }}
133+
name: QScripts ${{ github.ref_name }}
137134
draft: false
138135
prerelease: false
139136
generate_release_notes: true
140137
files: |
141-
release/qscripts.dylib
142-
release/qscripts.so
138+
release/qscripts-${{ github.ref_name }}.zip
143139
release/qscripts.dll
140+
release/qscripts.so
141+
release/qscripts.dylib

CLAUDE.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ QScripts is an IDA Pro plugin that enables automatic script execution upon file
1010

1111
### Prerequisites
1212
- **IDASDK**: Environment variable must be set to IDA SDK path
13-
- **IDAX**: Must be installed at `$IDASDK/include/idax/`
1413
- **ida-cmake**: Must be installed at `$IDASDK/ida-cmake/`
14+
- **idacpp**: Optional - will be automatically fetched if not found at `$IDASDK/include/idacpp/`
1515

1616
### Build with ida-cmake agent
1717
Always use the ida-cmake agent for building:
@@ -84,8 +84,27 @@ Scripts can be in three states:
8484

8585
## Important Implementation Notes
8686

87-
- Plugin uses IDAX framework for enhanced UI capabilities
87+
- Plugin uses idacpp wrapper library for enhanced C++ API
8888
- Shares script list with IDA's built-in "Recent Scripts" (Alt-F9)
8989
- Maximum 512 scripts in list (IDA_MAX_RECENT_SCRIPTS)
9090
- Special unload function: `__quick_unload_script` called before reload
91-
- Supports undo via IDA's undo system when enabled in options
91+
- Supports undo via IDA's undo system when enabled in options
92+
93+
## CI/CD and Releases
94+
95+
### Automated Builds
96+
- GitHub Actions builds for Linux (.so), macOS (.dylib), and Windows (.dll)
97+
- Runs on every push and pull request
98+
- CMake automatically fetches idacpp if not available in IDASDK
99+
100+
### Creating Releases
101+
To create a new release with pre-built binaries:
102+
```bash
103+
git tag v1.0.0 # Create version tag
104+
git push origin v1.0.0 # Push tag to trigger release
105+
```
106+
This will automatically:
107+
1. Build qscripts for all 3 platforms
108+
2. Create a GitHub Release page
109+
3. Upload all platform binaries (.dll, .so, .dylib)
110+
4. Generate release notes from commits

CMakeLists.txt

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,27 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
88
include($ENV{IDASDK}/ida-cmake/bootstrap.cmake)
99
find_package(idasdk REQUIRED)
1010

11-
# Add idacpp library
12-
add_subdirectory($ENV{IDASDK}/include/idacpp ${CMAKE_CURRENT_BINARY_DIR}/idacpp)
11+
# Add idacpp library with fallback
12+
# First, try to use idacpp from IDASDK
13+
set(IDACPP_SDK_PATH "$ENV{IDASDK}/include/idacpp")
14+
set(IDACPP_LOCAL_PATH "${CMAKE_CURRENT_BINARY_DIR}/idacpp")
15+
16+
if(EXISTS "${IDACPP_SDK_PATH}/CMakeLists.txt")
17+
message(STATUS "Using idacpp from IDASDK: ${IDACPP_SDK_PATH}")
18+
add_subdirectory(${IDACPP_SDK_PATH} ${CMAKE_CURRENT_BINARY_DIR}/idacpp)
19+
else()
20+
message(STATUS "idacpp not found in IDASDK, fetching to build directory...")
21+
22+
# Use FetchContent to download idacpp into build directory
23+
include(FetchContent)
24+
FetchContent_Declare(
25+
idacpp
26+
GIT_REPOSITORY https://github.com/allthingsida/idacpp.git
27+
GIT_TAG main
28+
SOURCE_DIR ${IDACPP_LOCAL_PATH}
29+
)
30+
FetchContent_MakeAvailable(idacpp)
31+
endif()
1332

1433
# Convert paths to native format
1534
set(SAMPLE_IDB "${IDA_CMAKE_DIR}/samples/wizmo32.exe.i64")

prep-cmake.bat

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ if not defined IDASDK (
99
goto :eof
1010
)
1111

12-
if not exist %IDASDK%\include\idax\xkernwin.hpp (
13-
echo IDAX framework not properly installed in the IDA SDK folder.
14-
echo See: https://github.com/ida-cmake/idax
15-
goto :eof
16-
)
17-
1812
if not exist %IDASDK%\ida-cmake\idasdkConfig.cmake (
1913
echo ida-cmake not properly installed in the IDA SDK folder.
2014
echo See: https://github.com/allthingsida/ida-cmake

0 commit comments

Comments
 (0)