Skip to content

Commit

Permalink
Added -Z command line option to the script
Browse files Browse the repository at this point in the history
  • Loading branch information
ypujante committed Oct 30, 2021
1 parent 118da8f commit dc9eba9
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Note that this script is expecting the `cmake` command line tool to be in the `P

```
# ./re.sh -h
usage: re.sh [-hnvlbdtR] <command> [<command> ...] [-- [native-options]]
usage: re.sh [-hnvlbdtRZ] <command> [<command> ...] [-- [native-options]]
positional arguments:
command See "Commands" section
Expand All @@ -184,6 +184,7 @@ optional arguments:
-d, --debugging Use 'Debugging' for local45 command
-t, --testing Use 'Testing' for local45 command
-R, --release Invoke CMake in Release mode (for multi-config generators)
-Z Clears the Recon Graphics Cache (workaround)
Commands
---- Native build commands ----
Expand Down Expand Up @@ -234,6 +235,9 @@ CMake Target | Script Command | Description
`jbox-u45-build` | `universal45` | Builds the universal45 (`.u45`) package with the jbox toolchain ready to be uploaded to Reason servers
`jbox-validate45` | `validate45` | Builds the (sandboxed) plugin with the jbox toolchain (`local45`) and runs Recon validation on it

> #### Note
> 2021/10/30: Due to a caching issue with Recon 12 and Hi Res graphics, you can use `-Z` command line argument to delete the cache directory (this is a hack/workaround)
Understanding the different kinds of builds
-------------------------------------------
It is pretty critical to understand the various kinds of builds that are available for a Rack Extension. They are very specific to the RE SDK.
Expand Down Expand Up @@ -291,6 +295,10 @@ It is strongly recommended to check the [re-blank-plugin](https://github.com/pon

Release notes
-------------
#### 1.3.8 - 2021/10/30

- Added `-Z` command line option to the script to work around the graphics caching issue of Recon 12

#### 1.3.7 - 2021/10/28

- Added Recon12 name to list of Recon executables
Expand Down
33 changes: 31 additions & 2 deletions re-cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import argparse
import platform
import os

script_name = ''

Expand All @@ -28,7 +29,7 @@


parser = argparse.ArgumentParser(allow_abbrev=False,
usage=f'{script_name} [-hnvlbdtR] <command> [<command> ...] [-- [native-options]]',
usage=f'{script_name} [-hnvlbdtRZ] <command> [<command> ...] [-- [native-options]]',
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog='''
Commands
Expand Down Expand Up @@ -62,10 +63,39 @@
parser.add_argument("-d", "--debugging", help="Use 'Debugging' for local45 command", action="store_true")
parser.add_argument("-t", "--testing", help="Use 'Testing' for local45 command", action="store_true")
parser.add_argument("-R", "--release", help="Invoke CMake in Release mode (for multi-config generators)", action="store_true")
parser.add_argument("-Z", help="Clears the Recon Graphics Cache (workaround)", action="store_true", dest="clear_recon_graphics_cache")
parser.add_argument('command', help='See "Commands" section', nargs=argparse.REMAINDER)

args = parser.parse_args()

# compute Recon cache dir path
def recon_cache_dirpath():
if os.name == 'nt':
dirpath_localappdata = os.path.normpath(os.getenv('LOCALAPPDATA') )
r = os.path.join(dirpath_localappdata, 'Propellerhead Software', 'Reason Recon', 'GraphicsCache')
else:
dirpath_userprofile = os.path.normpath(os.path.expanduser('~') )
r = os.path.join(dirpath_userprofile, 'Library', 'Caches', 'Reason Recon', 'GraphicsCache')

return r


# Clear the cache
def clear_recon_graphics_cache():
import shutil

dirpath = recon_cache_dirpath()
if os.path.isdir(dirpath):
if args.dry_run:
print(f'Deleting "{dirpath}"')
else:
shutil.rmtree(dirpath)
print(f'Deleted "{dirpath}"')

# Check for clearing cache
if args.clear_recon_graphics_cache:
clear_recon_graphics_cache()

# determines '--' position
commands = args.command
native_tool_options = []
Expand Down Expand Up @@ -122,7 +152,6 @@
if args.dry_run:
print(' '.join(cmake_command))
else:
import os
import sys
import subprocess

Expand Down
2 changes: 1 addition & 1 deletion sdk.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ endif()

set(RE_CMAKE_MAJOR_VERSION 1)
set(RE_CMAKE_MINOR_VERSION 3)
set(RE_CMAKE_PATCH_VERSION 6)
set(RE_CMAKE_PATCH_VERSION 8)

# Capturing this outside function call due to scope...
set(BUILD45_SRC_DIR ${CMAKE_CURRENT_LIST_DIR})
Expand Down

0 comments on commit dc9eba9

Please sign in to comment.