Skip to content

Commit

Permalink
Merge branch 'dev/ruby32'
Browse files Browse the repository at this point in the history
  • Loading branch information
thomthom committed Apr 4, 2024
2 parents 8455d94 + cbc67e9 commit de7312a
Show file tree
Hide file tree
Showing 5,047 changed files with 552,787 additions and 188,573 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
45 changes: 45 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: build-binaries

on:
workflow_dispatch:
push:
branches:
- main
- dev/ruby31
- dev/ruby32
- dev/actions
pull_request:

jobs:
windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Add msbuild to PATH
uses: microsoft/[email protected]

- name: Build app for release
run: msbuild Build\SURubyDebugger.sln -property:Configuration=Release

- uses: actions/upload-artifact@v3
with:
name: ruby-debugger-win
path: Build/x64/Release/SURubyDebugger.dll

macos:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build app for release
run: |
cd Build
xcodebuild -scheme SURubyDebugger -configuration Release -derivedDataPath output
- uses: actions/upload-artifact@v3
with:
name: ruby-debugger-mac
path: Build/output/Build/Products/Release/SURubyDebugger.dylib
19 changes: 18 additions & 1 deletion Build/SURubyDebugger.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,22 @@
33CC243418D57BE30079FC3E /* StackFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 33CC243218D57BE30079FC3E /* StackFrame.h */; };
33CC243B18D5808E0079FC3E /* Ruby.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33CC243918D5808E0079FC3E /* Ruby.framework */; };
CE5F5B2125123C3300237692 /* IDebuggerUI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE5F5B2025123C3300237692 /* IDebuggerUI.h */; };
F9D3F8562912B20000BE62A9 /* SURubyDebugger.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33CC241118D57AB80079FC3E /* SURubyDebugger.dylib */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
F9D3F8552912B1E700BE62A9 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "/Applications/SketchUp 2094/SketchUp.app/Contents/Frameworks";
dstSubfolderSpec = 0;
files = (
F9D3F8562912B20000BE62A9 /* SURubyDebugger.dylib in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
33B5057B18D65A33000C89F1 /* DebugServerExports.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DebugServerExports.cpp; path = ../DebugServer/DebugServerExports.cpp; sourceTree = "<group>"; };
33B5057C18D65A33000C89F1 /* DebugServerExports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DebugServerExports.h; path = ../DebugServer/DebugServerExports.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -147,6 +161,7 @@
33CC240D18D57AB80079FC3E /* Sources */,
33CC240E18D57AB80079FC3E /* Frameworks */,
33CC240F18D57AB80079FC3E /* Headers */,
F9D3F8552912B1E700BE62A9 /* CopyFiles */,
);
buildRules = (
);
Expand All @@ -163,7 +178,7 @@
33CC240818D57AB80079FC3E /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1250;
LastUpgradeCheck = 1310;
ORGANIZATIONNAME = "Bugra Barin";
};
buildConfigurationList = 33CC240B18D57AB80079FC3E /* Build configuration list for PBXProject "SURubyDebugger" */;
Expand Down Expand Up @@ -308,6 +323,7 @@
"$(SRCROOT)/../ThirdParty/include",
"$(SRCROOT)/../ThirdParty/include/ruby/mac",
);
OTHER_CFLAGS = "-fdeclspec";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -325,6 +341,7 @@
"$(SRCROOT)/../ThirdParty/include",
"$(SRCROOT)/../ThirdParty/include/ruby/mac",
);
OTHER_CFLAGS = "-fdeclspec";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -40,6 +40,11 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<PathRunnable
runnableDebuggingMode = "0"
BundleIdentifier = "com.sketchup.SketchUp.2094"
FilePath = "/Applications/SketchUp 2094/SketchUp.app">
</PathRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -49,6 +54,12 @@
ReferencedContainer = "container:SURubyDebugger.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CommandLineArguments>
<CommandLineArgument
argument = "-rdebug &quot;ide port=6123&quot;"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
8 changes: 4 additions & 4 deletions DebugServer/DebugServer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down Expand Up @@ -62,7 +62,7 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)../ThirdParty/lib/Debug/x64</AdditionalLibraryDirectories>
<AdditionalDependencies>x64-msvcrt-ruby270.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>x64-ucrt-ruby320.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>set TARGETDIR=$(TargetDir)
Expand All @@ -89,7 +89,7 @@ call $(SolutionDir)postbuild.bat
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>$(SolutionDir)../ThirdParty/lib/Release/x64</AdditionalLibraryDirectories>
<AdditionalDependencies>x64-msvcrt-ruby270.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>x64-ucrt-ruby320.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>set TARGETDIR=$(TargetDir)
Expand Down
1 change: 1 addition & 0 deletions DebugServer/DebuggerSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <Common/BreakPoint.h>

#include <functional>
#include <map>
#include <vector>

Expand Down
Binary file modified DebugServer/Resource.aps
Binary file not shown.
Binary file modified DebugServer/Resource.rc
Binary file not shown.
19 changes: 13 additions & 6 deletions DebugServer/Server.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
// SketchUp Ruby API Debugger. Copyright 2013 Trimble Navigation Ltd.
// SketchUp Ruby API Debugger. Copyright 2013-2022 Trimble Inc.
// Authors:
// - Bugra Barin
//
// - Thomas Thomassen

// Ruby keeps messing with the global namespace.
// In this case it redefines memcpy which causes problems for boost.
// This kludge of undefining memcpy after the Ruby headers allows the
// standard memcpy to be available to boost.
#include <ruby.h>
#include <ruby/debug.h>
#include <ruby/encoding.h>
// Undo things Ruby do to the global namespace.
#undef memcpy

#include "./Server.h"
#include "./DebuggerSettings.h"
#include "./FindSubstringCaseInsensitive.h"
Expand All @@ -10,10 +21,6 @@
#include <Common/BreakPoint.h>
#include <Common/StackFrame.h>

#include <ruby.h>
#include <ruby/debug.h>
#include <ruby/encoding.h>

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcomma"
#include <boost/lexical_cast.hpp>
Expand Down
20 changes: 20 additions & 0 deletions DebugServer/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,26 @@

#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define NOMINMAX

// Kludge from Server.cpp duplicated here because the Windows build uses pre-compiled
// headers. These includes must be done after the macros above that exclude bad things
// the Windows API does to the global namespace.
//
// Ruby keeps messing with the global namespace.
// In this case it redefines memcpy which causes problems for boost.
// This kludge of undefining memcpy after the Ruby headers allows the
// standard memcpy to be available to boost.
#include <ruby.h>
#include <ruby/debug.h>
#include <ruby/encoding.h>
// Undo things Ruby do to the global namespace. This must be done before including
// any standard headers or Win32 API headers.
#undef memcpy
#undef access
#undef fstat
#undef lstat
#undef stati128

// Windows Header Files:
#include <windows.h>
#include <Shlobj.h>
Expand Down
4 changes: 4 additions & 0 deletions Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ TODO:
3. Tag commit it was built from.
4. Upload binaries to GitHub Releases.
5. Update README.md to refer to new download URL and versions.

## Automation

TODO: Setup action to publish release no GitHub when creating new tag. https://trstringer.com/github-actions-create-release-upload-artifacts/
38 changes: 28 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,55 @@ SketchUp Ruby API Debugger

This is a Ruby debugger framework for SketchUp 2014 and later. The `ruby-debug-ide` protocol has been mostly implemented so any Ruby IDE that supports this protocol should work.

| IDE | Stable (1.0.3.0) | Stable (1.1.0.0) | Stable (1.2.0.0) | Stable (1.3.0.0) | Stable (1.4.0.0) |
| --- | --- | --- | --- | --- | --- |
| [Aptana RadRails](https://github.com/SketchUp/sketchup-ruby-debugger/wiki/How-to-set-up-an-IDE-for-debugging-Ruby-extensions-in-SketchUp) | Good | *Untested* | *Untested* | *Untested* | *Untested* |
| NetBeans (with Ruby community plugin) | Good | *Untested* | *Untested* | *Untested* | *Untested* |
| [RubyMine](https://github.com/SketchUp/sketchup-ruby-api-tutorials/wiki/RubyMine-Debugger-Setup) | Good | Good | Good | *Untested* | *Untested* |
| [VS Code](https://github.com/SketchUp/sketchup-ruby-api-tutorials/wiki/VSCode-Debugger-Setup) (with `vscode-ruby` extension) | Not supported | Good | Good | Good | Good |
| IDE | Stable (1.2.0) | Stable (1.3.0) | Stable (1.4.0) | Stable (1.5.0) |
| --- | --- | --- | --- | --- |
| [RubyMine](https://github.com/SketchUp/sketchup-ruby-api-tutorials/wiki/RubyMine-Debugger-Setup) | *Untested* | Good | Good | Good |
| [VS Code](https://github.com/SketchUp/sketchup-ruby-api-tutorials/wiki/VSCode-Debugger-Setup) (with `vscode-ruby` extension) | Not supported | Good | Good | Good |

## Instructions for Windows:

- Download the pre-built dynamic library (SURubyDebugger.dll) from the [latest release](https://github.com/SketchUp/sketchup-ruby-debugger/releases) or build from the sources.
- Copy the DLL into the SketchUp installation directory. As the exact path will depend on the version of SketchUp you have installed, look for a folder similar to the following:
```
C:\Program Files\SketchUp\SketchUp 2022\
C:\Program Files\SketchUp\SketchUp 2024\
C:\Program Files (x86)\SketchUp\SketchUp 2015\
```
- Start SketchUp from the command line or the "Run..." dialog:
```
SketchUp.exe -rdebug "ide port=7000"
SketchUp.exe -rdebug "ide port=6123"
```

## Instructions for Mac OS X:

- Install SketchUp 2014 Maintenance 1 Release (version 14.1.1283) or later.
- Download `SURubyDebugger.dylib` into the Frameworks directory of the app bundle:
```
curl -L https://github.com/SketchUp/sketchup-ruby-debugger/releases/download/1.4.0.0/SURubyDebugger.dylib -o /Applications/SketchUp\ 2022/SketchUp.app/Contents/Frameworks/SURubyDebugger.dylib
curl -L https://github.com/SketchUp/sketchup-ruby-debugger/releases/download/1.5.0.0/SURubyDebugger.dylib -o /Applications/SketchUp\ 2024/SketchUp.app/Contents/Frameworks/SURubyDebugger.dylib
```
- Run SketchUp from the command line:
```
open -a /Applications/SketchUp\ 2022/SketchUp.app --args -rdebug "ide port=7000"
/Applications/SketchUp\ 2024/SketchUp.app/Contents/MacOS/SketchUp -rdebug "ide port=6123"
```
Alternatively:
```
open -a /Applications/SketchUp\ 2024/SketchUp.app --args -rdebug "ide port=6123"
```

## Known Issues

If the connection cannot be made, for instance the port is in use, the debugger will crash.

These docs previously used port 7000 as an example, but as of macOS Monterey that is now in use by the OS itself.

To list active ports on macOS:

```
sudo lsof -i -P | grep LISTEN | grep :$PORT
```

## Command-line arguments:

When launching SketchUp with debugging enabled, the following command-line arguments are supported:

```
Expand All @@ -46,6 +63,7 @@ When launching SketchUp with debugging enabled, the following command-line argum
- `wait` - Instructs the SketchUp debugger to wait for an initial connection from an IDE before allowing execution to continue. This is necessary to debug scripts that run automatically, for instance when an extension is loaded. When using this option, the SketchUp process will appear to be frozen until an IDE is attached.

## Notes:

While most common debugging functionality has been implemented, there are few TODOs:
- Debugging of multi-threaded execution
- Function breakpoints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#ifndef BOOST_ACCUMULATORS_STATISTICS_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_03_19_2012
#define BOOST_ACCUMULATORS_STATISTICS_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_03_19_2012

#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
#if defined(_MSC_VER) || defined(__BORLANDC__) && !defined(__clang__) || defined(__DMC__)
# pragma message ("Warning: This header is deprecated. Please use: boost/accumulators/statistics/p_square_cumul_dist.hpp")
#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__) || defined(__BORLANDC__)
# warning "This header is deprecated. Please use: boost/accumulators/statistics/p_square_cumul_dist.hpp"
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#ifndef BOOST_ACCUMULATORS_STATISTICS_WEIGHTED_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_03_19_2012
#define BOOST_ACCUMULATORS_STATISTICS_WEIGHTED_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_03_19_2012

#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
#if defined(_MSC_VER) || defined(__BORLANDC__) && !defined(__clang__) || defined(__DMC__)
# pragma message ("Warning: This header is deprecated. Please use: boost/accumulators/statistics/weighted_p_square_cumul_dist.hpp")
#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__) || defined(__BORLANDC__)
# warning "This header is deprecated. Please use: boost/accumulators/statistics/weighted_p_square_cumul_dist.hpp"
#endif

Expand Down
1 change: 0 additions & 1 deletion ThirdParty/include/boost/algorithm/apply_permutation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#define BOOST_ALGORITHM_APPLY_PERMUTATION_HPP

#include <algorithm>
#include <type_traits>

#include <boost/config.hpp>
#include <boost/range/begin.hpp>
Expand Down
Loading

0 comments on commit de7312a

Please sign in to comment.